SEMMNI is the number of semaphore ids, i.e., the number of times you
can call 'semget()' without deleting any semaphores.  SEMMNS is the
actual number of semaphores in the system, which should be >= SEMMNI.
Of course, you can ask 'semget()' to give you up to SEMMSL semaphores
on each call, so SEMMNS should usually be larger than SEMMNI.

Ideally, if you know the max number of semaphores that a program
obtains via a semget call, set SEMMSL to that value.  Then, if you
know the max number of semid's that are in use at any given time, then
set SEMMNI to that value.  Then compute SEMMNS = SEMMNI*SEMMNS.  This
will guarantee you have enough, as long as your usage information is
accurate.

Personally, I would just bump up SEMMNI and SEMMNS by 20% (or
whatever).  Your documentation that came with your application should
give you an idea of it's semaphore usage.  Use that as the guide as to
what to set these things to as a starting point.

-Brian

Andrey Novikov wrote:
> > struct seminfo seminfo = {
> >                 SEMMAP,         /* # of entries in semaphore map */
> >                 SEMMNI,         /* # of semaphore identifiers */
> >                 SEMMNS,         /* # of semaphores in system */
> >                 SEMMNU,         /* # of undo structures in system */
> >                 SEMMSL,         /* max # of semaphores per id */
> >                 SEMOPM,         /* max # of operations per semop call */
> >                 SEMUME,         /* max # of undo entries per process */
> >                 SEMUSZ,         /* size in bytes of undo structure */
> >                 SEMVMX,         /* semaphore maximum value */
> >                 SEMAEM          /* adjust on exit max value */
> > };
> > You probably want to increase either SEMMNI or SEMMNS.
> 
> I've noticed that but why are they so "round"? Is there any corelation
> between all these numbers? I don't want to break my kernel by guessing.
> 
> > > options         SEMMAP=31
> > > options         SEMMNI=11
> > > options         SEMMNS=61
> > > options         SEMMNU=31
> > > options         SEMMSL=61
> > > options         SEMOPM=101
> > > options         SEMUME=11


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to