HTTPD using a lot of CPU
nichele Jan 26, 2012 4:44 AMHi all,
i was experiencing strange behaviour using tomcat 6.0.13 + mod-cluster 1.1.3 + apache 2.2.21.
I have 1 apache and 3 tomcat instances.
Using this configuration tomcat side:
advertise="false"
maxAttempts="3"
nodeTimeout="600"
workerTimeout="900"
ping="60"
stickySession="true"
stickySessionRemove="true"
stickySessionForce="false"
I saw that stopping one on the tomcat instances, httpd starts asap to have a very high CPU usage. Also restarting tomcat the CPU usage stays high.
Strange thing...i found that setting "stickySessionForce" to true, this behaviour doesn't happen.
I continued my investigation and I fixed the issue compiling mod_manager and mod_proxy_cluster on the host with httpd (not sure if the issue was in the mod_manager or in mod_proxy_cluster but if needed i can try).
So now i'm pretty confused :-) since using .so modules from this package http://downloads.jboss.org/mod_cluster//1.1.3.Final/mod_cluster-1.1.3.Final-linux2-x64-so.tar.gz i have the issue aforementioned, but compiling mod-cluster source i don't have it.
For completeness:
[root]# httpd -V
Server version: Apache/2.2.21 (Unix)
Server built: Jan 12 2012 15:28:45
Server's Module Magic Number: 20051115:30
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 64-bit
Server MPM: Worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/httpd-2.2.21"
-D SUEXEC_BIN="/usr/local/httpd-2.2.21/bin/suexec"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
To note that from mod_cluster i'm using just these .so:
- mod_advertise.so
- mod_manager.so
- mod_proxy_cluster.so
- mod_slotmem.so
About mod_proxy, mod_proxy_ajp, mod_proxy_http i use tha ones coming from httpd
since otherwise i have issues (stickysession doesn't work).
At this point i don't know if i'm installing mod-cluster in the right way or if i'm missing something.
Could you help me in understanding what is happening and where i'm doing wrong ?
Thanks
ste