[mod_python] Apache/mod_python process sizes. Help wanted.

Clodoaldo clodoaldo.pinto.neto at gmail.com
Sat Mar 3 08:27:02 EST 2007


2007/3/2, Graham Dumpleton <grahamd at dscpl.com.au>:
>
> So, what do other people get?

# uname -a
Linux s0.localdomain 2.6.19-1.2895.fc6 #1 SMP Wed Jan 10 18:32:37 EST
2007 i686 athlon i386 GNU/Linux

$ ls -las /usr/lib/httpd/modules/mod_python.so
1580 -rwxr-xr-x 1 root root 1611019 Feb  1 15:55
/usr/lib/httpd/modules/mod_python.so

$ ls -las /usr/lib/python2.4/config/libpython2.4.a
1736 -rw-r--r-- 1 root root 1767520 Oct 23 17:58
/usr/lib/python2.4/config/libpython2.4.a

# ldd /usr/lib/httpd/modules/mod_python.so
        linux-gate.so.1 =>  (0x00308000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x008b4000)
        libdl.so.2 => /lib/libdl.so.2 (0x003ce000)
        libutil.so.1 => /lib/libutil.so.1 (0x00110000)
        libm.so.6 => /lib/libm.so.6 (0x00114000)
        libc.so.6 => /lib/libc.so.6 (0x0013b000)
        /lib/ld-linux.so.2 (0x80000000)

>5. Work out how much memory Apache uses when mod_python is not being
loaded. One can use 'top' for this. Hopefully others may suggest
better ways.

# top -U apache

top - 13:04:02 up 27 days, 14:07,  3 users,  load average: 1.03, 1.04, 1.01
Tasks: 116 total,   2 running, 114 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.0%sy, 99.7%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1538488k total,  1483200k used,    55288k free,    19692k buffers
Swap:  4087888k total,      572k used,  4087316k free,  1313956k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1367 apache    25   0 28728 5552  648 S  0.0  0.4   0:00.00 httpd

>6. Work out how much memory Apache uses when mod_python is loaded
but before any requests have occurred. Ensure that no PythonImport
directives have been used.

# top -U apache

top - 13:06:41 up 27 days, 14:10,  3 users,  load average: 1.00, 1.02, 1.00
Tasks: 116 total,   2 running, 114 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.6%us,  1.1%sy, 90.2%ni,  1.5%id,  0.2%wa,  0.2%hi,  0.2%si,  0.0%st
Mem:   1538488k total,  1486348k used,    52140k free,    20000k buffers
Swap:  4087888k total,      572k used,  4087316k free,  1316220k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1423 apache    25   0 30948 6724  808 S  0.0  0.4   0:00.00 httpd

>If eager, use a hello world mod_python example and trigger one request
against it and see how size changes.

After one publisher helloword request:

# top -U apache

top - 13:20:49 up 27 days, 14:24,  3 users,  load average: 1.00, 1.00, 1.00
Tasks: 117 total,   2 running, 115 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,100.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1538488k total,  1490996k used,    47492k free,    21880k buffers
Swap:  4087888k total,      572k used,  4087316k free,  1314228k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1423 apache    15   0 35020  12m 3212 S  0.0  0.8   0:00.26 httpd
 1452 apache    15   0 30948 6724  808 S  0.0  0.4   0:00.00 httpd

>7. If you are also loading lots of other Apache modules, such as
mod_perl,
module for PHP etc, list any significant ones so we might understand
what
else may be using memory. Ideally, do the tests with as little
modules loaded
as possible.

# httpd -M
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 file_cache_module (shared)
 mem_cache_module (shared)
 cgi_module (shared)
 php5_module (shared)
 proxy_ajp_module (shared)
 python_module (shared)
Syntax OK

HTH. Regards,
-- 
Clodoaldo Pinto Neto


More information about the Mod_python mailing list