Re: Solved: ModPython + Virtual Hosting Apache2 instance = poor performance.

Graham Dumpleton <[email protected]> Tue, 9 Mar 2010 09:50:31 +1100
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
On 9 March 2010 04:58, Christopher Sean Hilton <chris-7VRIiXHg8cFWk0Htik3J/[email protected]> wrote=
:
> To call it solved would mean that I actually know what going on. This i=
s more of a work around. Here's what I found:
>
> Apache 2.0.63 + mod_python 3.3.1 + python 2.x (threaded)
>
> =A0 yields poor performance under freebsd for static content and dynami=
c content using php5.
>
> Changing from threaded python to non-threaded python fixes the performa=
nce issues.
>
> Django requires threaded python.

It should perhaps be qualified that Django doesn't require threads to
work and the conservative would run it in single threaded prefork MPM.
Whether it expects the threading module to still be importable is a
different matter though.

> Apache 2.2.21 + the threaded APR from devel/apr + mod_python 3.3.1 + py=
thon 2.6 with threads works!
>
> There isn't much difference configuring Apache 2.2 compared to Apache 2=
.0 but the mod_python port isn't as helpful. It doesn't put the line:
>
> =A0 =A0 LoadModule python_module libexec/apache22/mod_python.so
>
> Into the configuration.
>
> Given that it should also include:
>
> =A0 =A0 <IfModule python_module>
> =A0 =A0 PythonOptimize Off

That is not a valid option to PythonOptimize and with that value
results would be unpredictable. It is off by default anyway.

> =A0 =A0 PythonDebug Off

This is also off by default.

> =A0 =A0 </IfModule>

In other words, you didn't need either of those definitions.

Graham

> lines in also, that's okay.
>
> Here's the output from Apache:
>
> tatooine apache22 # httpd -V
> httpd -V
> Server version: Apache/2.2.14 (FreeBSD)
> Server built: =A0 Mar =A08 2010 12:21:44
> Server's Module Magic Number: 20051115:23
> Server loaded: =A0APR 1.3.9, APR-Util 1.3.9
> Compiled using: APR 1.3.9, APR-Util 1.3.9
> Architecture: =A0 32-bit
> Server MPM: =A0 =A0 Prefork
> =A0threaded: =A0 =A0 no
> =A0 =A0forked: =A0 =A0 yes (variable process count)
> Server compiled with....
> =A0-D APACHE_MPM_DIR=3D"server/mpm/prefork"
> =A0-D APR_HAS_SENDFILE
> =A0-D APR_HAS_MMAP
> =A0-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
> =A0-D APR_USE_FLOCK_SERIALIZE
> =A0-D APR_USE_PTHREAD_SERIALIZE
> =A0-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
> =A0-D APR_HAS_OTHER_CHILD
> =A0-D AP_HAVE_RELIABLE_PIPED_LOGS
> =A0-D DYNAMIC_MODULE_LIMIT=3D128
> =A0-D HTTPD_ROOT=3D"/usr/local"
> =A0-D SUEXEC_BIN=3D"/usr/local/bin/suexec"
> =A0-D DEFAULT_PIDLOG=3D"/var/run/httpd.pid"
> =A0-D DEFAULT_SCOREBOARD=3D"/var/run/apache_runtime_status"
> =A0-D DEFAULT_LOCKFILE=3D"/var/run/accept.lock"
> =A0-D DEFAULT_ERRORLOG=3D"/var/log/httpd-error.log"
> =A0-D AP_TYPES_CONFIG_FILE=3D"etc/apache22/mime.types"
> =A0-D SERVER_CONFIG_FILE=3D"etc/apache22/httpd.conf"
>
> -- Chris
>
>
> -----------------------------------------------------------------------=
-----
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 "There will be an answer, Let it be."
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0chris-7VRIiXHg8cFWk0Htik3J/[email protected]
>
>
>
>
> _______________________________________________
> Mod_python mailing list
> [email protected]
> http://mailman.modpython.org/mailman/listinfo/mod_python
>