简体   繁体   English

Apache2无法处理高流量(使用Ruby on Rails站点)

[英]Apache2 not handling high traffic (with Ruby on Rails site)

Hi I have devloped a website in Ruby on Rails and configured it with apache2 and passenger, normally the site working very smooth but when it get traffic then it slow very down and most time it produces error "Server not responding" (I guess because of apache2 is out of memory) can anyone please suggest how to handle this situation. 嗨,我在Ruby on Rails上开发了一个网站,并使用apache2和passenger配置了该网站,通常该网站运行非常平稳,但是当它获得流量时,它的运行速度会非常缓慢,并且大多数情况下会产生错误“服务器无响应”(我想是因为apache2内存不足)是否有人可以建议如何处理这种情况。

When I have gone through the Gtmatix report it was F grade for PageSpeed and YSlow Score. 当我浏览完Gtmatix报告后,PageSpeed和YSlow得分为F级。

Please suggest how to scale apache2. 请建议如何缩放apache2。

Thanks! 谢谢!

I believe you can check and do following things 我相信您可以检查并执行以下操作

1) Change your app server to PUMA or UNICORN 1)将您的应用服务器更改为PUMA或UNICORN

2) Check you server RAM if its less add some new or add SWAP 2)检查服务器RAM是否少添加一些新的或添加SWAP

3) Do some caching and use CDN like Cloudflare to cahce the assets data so that your server will not requested unnecessarily 3)进行一些缓存并使用Cloudflare之类的CDN来处理资产数据,这样就不会不必要地请求您的服务器

4) Use New Relic to monitor the server CPU, RAM, DATABASE and can also check the loads 4)使用New Relic监视服务器CPU,RAM,数据库,还可以检查负载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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