简体   繁体   中英

mod_proxy in apache being slow

I wanted to setup a proxy on my local computer from my apache server to my rails server at another port so I added this to my httpd.conf file:

<VirtualHost manage.dev:80> 
  ProxyPreserveHost On
  ProxyRequests Off
  ServerName manage.dev
  ProxyPass / http://localhost:5000/
  ProxyPassReverse / http://localhost:5000/
</VirtualHost> 

This allows me to access manage.dev, my ruby on rails application, from my web browser without specifying a port in the URL and without having to run rails on port 80.

It works well, however it takes up to 20 seconds to resolve each request.

The solution to speed up the requests was to add this to my httpd.conf:

StartServers 14
MaxClients 128
MinSpareServers 7
MaxSpareServers 14
MaxRequestsPerChild 10000

Now the initial request still takes up to 20 seconds, however subsequent requests are much faster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM