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
worker.template.ping_timeout=1000
worker.template.ping_mode=A
worker.template.socket_timeout=10
worker.template.connection_pool_timeout=600
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 , .
, .