1

I have the following VirtualHost configured (Apache 2.2.22)

<VirtualHost *:80>
    ServerName ************

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ErrorLog /var/log/apache2/dalo-lt_error_log
    LogLevel warn
    TransferLog /var/log/apache2/dalo-lt_access_log

    ProxyPass / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/

    <Location />
        Order allow,deny
        Allow from all
    </Location>

</VirtualHost>

With the following in my Tomcat's server.xml (7.0.39)

<Connector port="8009" protocol="AJP/1.3"
           redirectPort="8443"
           connectionTimeout="60000"
           maxConnections="36864"
           maxThreads="600" />

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           maxConnections="36864"
           maxThreads="600"
           redirectPort="8443" />

When I run my stress test through the vhost:80 + ajp, I start seeing dropped connections after a certain point. However, if i run the test directly through tomcat's http connector (:8080) I see no dropped connections whatsoever.

What is the best way to determine what is causing this?

Just for completeness, here are some settings from my apache2.conf

<IfModule mpm_prefork_module>
    StartServers          10
    MinSpareServers       10
    MaxSpareServers      20
    MaxClients          500
    MaxRequestsPerChild   0
</IfModule>

<IfModule mpm_worker_module>
    StartServers          4
    MinSpareThreads      50
    MaxSpareThreads      450
    ThreadLimit          256
    ThreadsPerChild      150
    MaxClients          300
    MaxRequestsPerChild   0
</IfModule>

<IfModule mpm_event_module>
    StartServers          4
    MinSpareThreads      50
    MaxSpareThreads      450
    ThreadLimit          256
    ThreadsPerChild      150
    MaxClients          300
    MaxRequestsPerChild   0
</IfModule>

Update: Requesting server-status?auto yields the following while during the phase of the load test when requests are being dropped - so it looks to me like there are enough workers etc. to spare

jlb
  • 123
  • 7

1 Answers1

1

Apache web server will start droping connections if it is getting too many request. You could use mod_status in order to look at the scoreboard, if it is full, you can increase the number of workers. (should be investigated if the increased number of workers fits your environment)

  • Thanks for the suggestion. Unfortunately the dropped connections start occurring before the scoreboard fills up - in fact there is a lot of room. – jlb Feb 11 '15 at 13:50
  • haven't you seen any problem in ajp log file? (timeout, etc ..) – gabor.harsanyi Feb 11 '15 at 14:51
  • I don't have a dedicated ajp log file - how can I set that up? – jlb Feb 11 '15 at 15:04
  • I'd suggest mod_log_forensic: http://httpd.apache.org/docs/2.2/mod/mod_log_forensic.html – gabor.harsanyi Feb 11 '15 at 15:19
  • Thanks - though I've tried `log_forensic` and didn't find anything in the output specifically related to AJP / proxy requests. Only request headers for everything coming into the system. – jlb Feb 11 '15 at 15:33
  • last idea I've got, do you have anything between tomcat and apache? (proxy, etc) because I you have you might try out with: ProxyPass / ajp://localhost:8009/ keepalive=on – gabor.harsanyi Feb 11 '15 at 15:53
  • Nope there is nothing in between. I've tried with keepalive=on anyway but with no luck. Thanks for your help! – jlb Feb 11 '15 at 16:13
  • I'm sorry then, I'm out of ideas – gabor.harsanyi Feb 11 '15 at 16:20