(70007)The timeout specified has expired: proxy: e

2019-08-05 05:38发布

问题:

I have this error in my apache acces log.

I work with apache 2.2 and tomcat 7. In the access file i see that apache send request to tomcat but tomcat can't treat them all. And when the error occures, i must restart tomcat to make my application work.

I have 2 j2ee applications application on tomcat. That application use connexion to posgres database via jdbc connexion pool. I see in my application log their is at least 4 free connexions. So i don't think there is trouble with database.

Does someone know what could cause this error ? Thank you in advence !

回答1:

It seems that your application take more time to respond that apache ProxyTimeout ProxyTimeout try to increase proxytimeout in you vhost/httpd configuration and try again The root cause is slowness in you application. you need to find the root cause of slowness



回答2:

The settings for the packet data transfer needs to be increased which is now low and the ab tool is not able to serve any data after the completion of the mentioned packets. You can change the configuration as below and then can enjoy running ab tool for your applications. On Ubuntu Server you can find them in /etc/sysctl.conf

net.ipv4.netfilter.ip_conntrack_max = 32768
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_fin_timeout = 25
net.ipv4.tcp_max_orphans = 8192
net.ipv4.ip_local_port_range = 32768    61000


回答3:

Try adding following apache parameters inside the virtual host section which should be in httpd.conf file or any other place per your server configuration

Timeout 2400
ProxyTimeout 2400
ProxyBadHeader Ignore

This resolved problem in my case. I am using Apache 2.4 and tomcat ajp/http configurations.