该网站是重载+ ROR下 [英] The website is under heavy load + ROR

查看:295
本文介绍了该网站是重载+ ROR下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们运行的是具有与2 Web服务器和1个数据库服务器的CentOS 6 ROR一个网站。有些时候,它显示消息该网站是在重负载下......可以将某些普莱舍帮助,你怎么在这里检查。

我们使用的是4.0.21乘客使用Ruby 1.8.7和Apache 2.2.15。 Web服务器使用默认设置运行。

下面是乘客身份的一些输出:

#乘客状态

 版本:4.0.21
日期:星期四12月12日2时02分44秒-0500 2013
实例:20126
- - - - - - 一般信息 - - - - - -
最大池大小:6
过程:6
请在顶级队列:0-----------应用程序组-----------
/家庭/网络/ HTML#默认:
  应用程序根目录:/​​家居/网络/ HTML
  请求队列:100
  * PID:20290会话:1加工:53运行时间:24小时3米5S
    CPU:0%内存:634M上次使用时间:23小时16米8
  * PID:22657会话:1加工:37运行时间:23小时15米55S
    CPU:0%内存:609M上次使用时间:22小时44米
  * PID:29147会话:加工1:146的正常运行时间:20小时47米48S
    CPU:0%内存:976M上次使用时间:18小时20米
  * PID:22216会话:1加工:26运行时间:10小时3米19S
    CPU:0%内存:538M上次使用:9H44米4
  * PID:23306会话:1加工:75运行时间:9H43米22S
    CPU:0%内存:483M上次使用时间:8小时44米4
  * PID:25626会话:加工1:115的正常运行时间:8小时46米42秒
    CPU:0%内存:540M上次使用时间:7小时59米5


解决方案

您在队列太多的请求。自4.0.15版本有一个极限是100默认。下面是从<一个很短的摘录href=\"http://blog.phusion.nl/2013/09/06/phusion-passenger-4-0-16-released/\">http://blog.phusion.nl/2013/09/06/phusion-passenger-4-0-16-released/它说:


  

Phusion的乘客现在将显示一个错误信息给客户,如果太多
  请求正在排队,而不是让他们等待。这么多
  提高服务质量。默认情况下,太多是100你可能
  与 PassengerMaxRequestQueueSize (阿帕奇)或自定义此
   passenger_max_request_queue_size (Nginx的)。


有一个在这个用户指南:<一href=\"http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerMaxRequestQueueSize\">http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerMaxRequestQueueSize

您可以尝试增加,或为了将其设置为 0 来禁用它。

修改

您也应该检查你的日志,看看是否有哪些需要太长时间的请求。也许你有你的code,它需要太长时间某些进程。我preFER使用了NewRelic的监测这些事情。

We are running a website with ROR on CentOS 6 with 2 web server and 1 database server. Some times it shows message "The website is under heavy load"... Can some plese help you what to check here.

We are using Passenger 4.0.21 with Ruby 1.8.7 and Apache 2.2.15. Web server is running with the default settings.

Below is some output of passenger-status:

# passenger-status

Version : 4.0.21
Date    : Thu Dec 12 02:02:44 -0500 2013
Instance: 20126
----------- General information -----------
Max pool size : 6
Processes     : 6
Requests in top-level queue : 0

----------- Application groups -----------
/home/web/html#default:
  App root: /home/web/html
  Requests in queue: 100
  * PID: 20290   Sessions: 1       Processed: 53      Uptime: 24h 3m 5s
    CPU: 0%      Memory  : 634M    Last used: 23h 16m 8
  * PID: 22657   Sessions: 1       Processed: 37      Uptime: 23h 15m 55s
    CPU: 0%      Memory  : 609M    Last used: 22h 44m
  * PID: 29147   Sessions: 1       Processed: 146     Uptime: 20h 47m 48s
    CPU: 0%      Memory  : 976M    Last used: 18h 20m
  * PID: 22216   Sessions: 1       Processed: 26      Uptime: 10h 3m 19s
    CPU: 0%      Memory  : 538M    Last used: 9h 44m 4
  * PID: 23306   Sessions: 1       Processed: 75      Uptime: 9h 43m 22s
    CPU: 0%      Memory  : 483M    Last used: 8h 44m 4
  * PID: 25626   Sessions: 1       Processed: 115     Uptime: 8h 46m 42s
    CPU: 0%      Memory  : 540M    Last used: 7h 59m 5

解决方案

You have too many requests in queue. Since version 4.0.15 there is a limit which is 100 by default. Here is a short excerpt from http://blog.phusion.nl/2013/09/06/phusion-passenger-4-0-16-released/ which says:

Phusion Passenger now displays an error message to clients if too many requests are queued up, instead of letting them wait. This much improves quality of service. By default, "too many" is 100. You may customize this with PassengerMaxRequestQueueSize (Apache) or passenger_max_request_queue_size (Nginx).

Have a look at the user guide about this: http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerMaxRequestQueueSize

You could try increasing it or setting it to 0in order to disable it.

EDIT

You should also check your logs to see whether there are requests which take too long. Maybe you have some processes in your code that take too long. I prefer using NewRelic for monitoring those things.

这篇关于该网站是重载+ ROR下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆