[mod_python] Problems with Apache

Graham Dumpleton graham.dumpleton at gmail.com
Wed Oct 24 23:00:20 EDT 2007

On 25/10/2007, Stefan Schulze <algroth at gmx.de> wrote:
> Hi there...
> I'm trying to teach my apache-server to understand python. The Apache 2.2.6
> runs on NetBSD 3.1 with Python 2.4.4. I compiled the mod_python 3.2.10 with
> pkgsrc and nothing strange happens while building the the lib. But when I
> add "LoadModule python_module lib/httpd/mod_python.so" to my httpd.conf I
> get lots of errors in the startup-log: [notice] mod_python: Creating 8
> session mutexes based on 256 max processes and 0 max threads. [notice]
> mod_python: using mutex_directory /tmp [error] (28)No space left on device:
> mod_python: Failed to create global mutex 5 of 8 (/tmp/mpmtx208245). [error]
> mod_python: We can probably continue, but with diminished ability to process
> session locks. [error] mod_python: Hint: On Linux, the problem may be the
> number of available semaphores, check 'sysctl kernel.sem'
> On /tmp is lots of space and it's seems not to be a permission-problem,
> because the user pgsql can create files there. Everybody has "rwt"-rights on
> /tmp.
> "sysctl kernel.sem" results in "sysctl: top level name 'kernel' in
> 'kernel.sem' is invalid".
> Can anybody give me a hint how to solve this problem?

The '/tmp' bit has nothing to do with.

The 'sysctl kernel.sem' is the Linux command to use. You will need to
work out the NetBSD way of listing how many kernel semaphores have
been configured. What ever is in use, it appears to be too low.

You can also configure mod_python to use less semaphores. Use the
option '--with-max-locks=4' to the 'configure' script when you are
building mod_python. If you don't know how to override that with
pkgsrc, then you can instead do it at run time by setting:

  PythonOption mod_python.mutex_locks 4

at global scope (outside of VirtualHost containers) in the Apache
configuration file.

Since a value of 4 would use up last semaphore, highly recommend you
increase number of kernel semaphores provided by OS.


More information about the Mod_python mailing list