The problem of using the JBoss processor

I am using JBoss AS 4.2.3 along with a seam framework. My processor usage increases as the number of users increases and reaches 99% for only 80 users. We also use Hibernate, EJB3 and Apache with mod_jk for load balancing.

When I took a thread dump, all executable threads perform the same action with the following trace:

at java.net.SocketInputStream.socketRead0(Native Method) 
at java.net.SocketInputStream.read(SocketInputStream.java:129) 
at org.apache.coyote.ajp.AjpProcessor.read(AjpProcessor.java:1012) 
at org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:1091) 
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:384) 
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366) 
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 
at java.lang.Thread.run(Thread.java:662)

I cannot interpret this with a stack trace. I also found that even when users are logged out, the processor load still remains unchanged for threads in the same state.

+3
source share
2 answers

Socket. mod_jk Apache. , , , .

.

(.. ), - , , . , , , .

, - , .

+1

AJP Apache Jboss, https://developer.jboss.org/wiki/OptimalModjk12Configuration

JBoss Web (Tomcat) server.xml AJP:

<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
         emptySessionPath="true" enableLookups="false" redirectPort="8443" ></Connector>   Apache httpd.conf:

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

, mod_jk , HTTP . - - , , , employee.properties, Apache Tomcat.

. :

Socket.read() - . , , , .

, (Java VM), ; - .

:

  • , , / Socket. XML. ,
  • Java EE. , /

, , , -!

?

Jboss Apache.

JBoss

server.xml connectionTimeout SO_TIMEOUT . , Tomcat , connectionTimeout, . , , mod_jk.

, maxThreads Tomcat, Tomcat - . Timeout 600000 (10 ) - , . , , connectionTimeout 60000 1 .

connectionTimeout Tomcat mod_jk connect_timeout/prepost_timeout, , Tomcat .

maxThreads - 200 , . , 800 .

<Connector port="8009"
           address="${jboss.bind.address}"
           emptySessionPath="true"
           enableLookups="false"
           redirectPort="8443"
           protocol="AJP/1.3"
           maxThreads="200"
           connectionTimeout="600000"></Connector>

Apache

employee.properties

. .

worker.list=loadbalancer,status

worker.template.port=8009
worker.template.type=ajp13
worker.template.lbfactor=1
#ping_timeout was introduced in 1.2.27
worker.template.ping_timeout=1000
#ping_mode was introduced in 1.2.27, if not 
#using 1.2.27 please specify connect_timeout=10000 
#and prepost_timeout=10000 as an alternative
worker.template.ping_mode=A
worker.template.socket_timeout=10
#It is not necessary to specify connection_pool_timeout if you are running the worker mpm 
worker.template.connection_pool_timeout=600

#Referencing the template worker properties makes the workers.properties shorter and more concise
worker.node1.reference=worker.template
worker.node1.host=192.168.1.2

worker.node2.reference=worker.template
worker.node2.host=192.168.1.3

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=True

worker.status.type=status

work.properties mod_jk . - . ping_mode ping_timeout, connection_pool_timeout, server.xml connectionTimeout mpm. , , x , mod_jk Tomcat , .

Apache

, maxThreads AJP MaxClients, Apache httpd.conf. MaxClients Apache.

, httpd -V:

# httpd -V

Server version: Apache/2.2.3
Server built:   Sep 11 2006 09:43:05
Server Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.8
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-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="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

, MPM - Prefork. 100% /etc/sysconfig/httpd , : HTTPD =/usr/sbin/httpd.worker. , , , .

httpd.conf:

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
MaxClients       200
MaxRequestsPerChild  0
</IfModule>

, Apache ,

<IfModule worker.c>
StartServers         2
MaxClients         200
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

MaxRequestsPerChild 0, mod_jk, mod_jk . - MaxClients MaxRequestsPerChild, . , MaxRequestsPerChild 0, 0 , Apache , .

, .

0

All Articles