Subject: kern/29284: Default SysV IPC limits are very low
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <cjs@cynic.net>
List: netbsd-bugs
Date: 02/08/2005 08:57:02
>Number:         29284
>Category:       kern
>Synopsis:       Default SysV IPC limits are very low
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 08 08:57:02 +0000 2005
>Originator:     Curt Sampson
>Release:        NetBSD 2.0_STABLE
>Organization:
>Environment:
System: NetBSD cjs.tabemo.com 2.0_STABLE NetBSD 2.0_STABLE ($Id: TABEMO.WORKSTATION,v 1.1 2004/09/27 07:02:01 cjs Exp $) #1: Tue Feb 8 16:21:31 JST 2005 cjs@cjs.tabemo.com:/u/netbsd/src-2/sys/arch/i386/compile/TABEMO.WORKSTATION i386
Architecture: i386
Machine: i386
>Description:
    The limits for SysV IPC resources are very low. It's not unusual for one
    to want to set up PostgreSQL, for example, with several tens of megabytes
    of shared memory, but the default maximum is sixteen. One instance of
    PostgreSQL and three instances of apache will entirely exhaust the
    available semaphores. Ideally these limits should vanish; less optimally
    they should probably be raised to something more suitable for modern
    machines.

    SysV shared memory used to be implemented with mmap, and all appropriate
    process and system-wide limits were enforced by mmap, so in the past the
    limit wasn't really necessary. That seems to have changed; I can no longer
    tell if the limit is necessary.

    Semaphore data structures appear to be allocated statically at boot time.

    For a standard web/database server on an i386 (with 256-1024 MB of
    RAM), I use:

	options         SEMMNI=100      # number of semaphore identifiers
	options         SEMMNS=600      # number of semaphores in system
	options         SEMUME=100      # max number of undo entries per process
	options         SEMMNU=300      # number of undo structures in system
	options         SYSVSHM         # System V-like memory sharing
	options         SHMMAXPGS=131072        # 2048 pages is the default

>How-To-Repeat:
    Have four developers trying to play with apache-based applications on
    a single system.
>Fix: