Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mod_rewrite proxy timeout

I have apache setup to proxy requests to backend app servers. There are several backend servers and there is a big rewrite_rules file which is processed for each request to properly proxy all the requests to app servers. One particular app server sometimes takes a long time to respond back, causing the proxy server to become slow if a lot of requests are being proxied to that particular server, as the requests are waiting to get the response back and eventually timeout after the timeout specified for apache requessts. I would like to put a timeout for this particular rewrite rule only, which is less than the apache timeout value, so that the resources are quickly free and avoid other problems during peak traffic times. I tried using

or directive to put ProxyTimeout ProxyTimeout 30

however this is not allowed. Appreciate any help from experts on this issue.

Thanks,

like image 425
user1860462 Avatar asked Nov 03 '22 10:11

user1860462


1 Answers

I just ran into this issue, and solved it by incrementing the overall timeout directive in httpd.conf. So, change:

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 60

to a more appropriate value.

It would be great do be able to do this for individual URLs, but it doesn't appear to be possible due to the lack of responses here and the Apache mailing list.

like image 102
mpenkov Avatar answered Nov 14 '22 09:11

mpenkov