You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Igor Katson <de...@gmail.com> on 2009/09/26 17:14:14 UTC

[users@httpd] Extremely high virtual memory usage

I am facing an extremely high virtual memory usage by apache. In fact it 
is not using as much swap space as it shows, but if there are many 
threads, apache starts swapping extensively and the system becomes 
totally unresponsive.

Look at the "VIRT" column (this is the output of top)

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7449 www-data 20 0 6007m 93m 2760 S 13 1.2 0:06.97 apache2
865 www-data 20 0 5882m 111m 4848 S 0 1.4 0:43.21 apache2
4180 www-data 20 0 5745m 84m 4856 S 0 1.1 0:01.42 apache2
32608 www-data 20 0 5386m 70m 2864 S 0 0.9 0:01.26 apache2
7450 www-data 20 0 5145m 92m 4716 S 17 1.2 0:06.65 apache2
7135 www-data 20 0 5138m 92m 4712 S 14 1.2 0:06.65 apache2
28893 www-data 20 0 5058m 96m 2868 S 0 1.2 0:07.43 apache2
26227 island 20 0 5015m 1.7g 5460 S 0 21.2 1:49.72 java
15773 www-data 20 0 4931m 93m 2828 S 0 1.2 0:17.83 apache2
1124 www-data 20 0 4612m 27m 4832 S 0 0.3 1:39.70 apache2
7018 www-data 20 0 4597m 96m 4844 S 0 1.2 0:24.83 apache2
10690 www-data 20 0 4482m 27m 2860 S 0 0.3 0:00.09 apache2
4811 www-data 20 0 4264m 63m 2868 S 0 0.8 0:00.64 apache2
12061 www-data 20 0 3003m 53m 4832 S 0 0.7 1:07.48 apache2
5164 www-data 20 0 2781m 53m 4832 S 0 0.7 0:00.31 apache2
28266 www-data 20 0 2774m 89m 4816 S 0 1.1 0:26.60 apache2

I tried disabling mod_jk (the most used one, as the backend is tomcat), 
and wsgi (because it is custom built), but the situation is the same. As 
soon as I start apache, some processes are eating around 5 GiB of VIRT 
memory, but as time passes, other apache instances eat virtual memory 
quickly.

How can I debug the problem? What can the possible reasons be?

OS: Debian Lenny, fully up to date
apache2 package version: 2.2.9-10+lenny4
MPM: worker
Enabled modules: alias auth_basic authn_file authz_default 
authz_groupfile authz_host authz_user cache cgid deflate dir disk_cache 
env headers jk mime proxy proxy_http rewrite rpaf setenvif status wsgi

Worker configuration:
<IfModule mpm_worker_module>
StartServers 4
ThreadLimit»»···512
MaxClients 2048
MinSpareThreads 64
MaxSpareThreads 128·
ThreadsPerChild 512
MaxRequestsPerChild 0
</IfModule>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Extremely high virtual memory usage

Posted by Steve <ai...@gmail.com>.
I also face a similar problem.
I find that after 5 days I'm hitting swap space and have to reboot.

Does no one here on the list have any advice on how to find these sorts of
issues? Command line tools, directories to look in, etc?

Any suggestions would be greatly appreciated.

Steve


2009/9/26 Igor Katson <de...@gmail.com>

> I am facing an extremely high virtual memory usage by apache. In fact it is
> not using as much swap space as it shows, but if there are many threads,
> apache starts swapping extensively and the system becomes totally
> unresponsive.
>
> Look at the "VIRT" column (this is the output of top)
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 7449 www-data 20 0 6007m 93m 2760 S 13 1.2 0:06.97 apache2
> 865 www-data 20 0 5882m 111m 4848 S 0 1.4 0:43.21 apache2
> 4180 www-data 20 0 5745m 84m 4856 S 0 1.1 0:01.42 apache2
> 32608 www-data 20 0 5386m 70m 2864 S 0 0.9 0:01.26 apache2
> 7450 www-data 20 0 5145m 92m 4716 S 17 1.2 0:06.65 apache2
> 7135 www-data 20 0 5138m 92m 4712 S 14 1.2 0:06.65 apache2
> 28893 www-data 20 0 5058m 96m 2868 S 0 1.2 0:07.43 apache2
> 26227 island 20 0 5015m 1.7g 5460 S 0 21.2 1:49.72 java
> 15773 www-data 20 0 4931m 93m 2828 S 0 1.2 0:17.83 apache2
> 1124 www-data 20 0 4612m 27m 4832 S 0 0.3 1:39.70 apache2
> 7018 www-data 20 0 4597m 96m 4844 S 0 1.2 0:24.83 apache2
> 10690 www-data 20 0 4482m 27m 2860 S 0 0.3 0:00.09 apache2
> 4811 www-data 20 0 4264m 63m 2868 S 0 0.8 0:00.64 apache2
> 12061 www-data 20 0 3003m 53m 4832 S 0 0.7 1:07.48 apache2
> 5164 www-data 20 0 2781m 53m 4832 S 0 0.7 0:00.31 apache2
> 28266 www-data 20 0 2774m 89m 4816 S 0 1.1 0:26.60 apache2
>
> I tried disabling mod_jk (the most used one, as the backend is tomcat), and
> wsgi (because it is custom built), but the situation is the same. As soon as
> I start apache, some processes are eating around 5 GiB of VIRT memory, but
> as time passes, other apache instances eat virtual memory quickly.
>
> How can I debug the problem? What can the possible reasons be?
>
> OS: Debian Lenny, fully up to date
> apache2 package version: 2.2.9-10+lenny4
> MPM: worker
> Enabled modules: alias auth_basic authn_file authz_default authz_groupfile
> authz_host authz_user cache cgid deflate dir disk_cache env headers jk mime
> proxy proxy_http rewrite rpaf setenvif status wsgi
>
> Worker configuration:
> <IfModule mpm_worker_module>
> StartServers 4
> ThreadLimit»»···512
> MaxClients 2048
> MinSpareThreads 64
> MaxSpareThreads 128·
> ThreadsPerChild 512
> MaxRequestsPerChild 0
> </IfModule>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>