乘客问题
最近我们的 ruby on Rails 应用程序升级到了 2.3.8。我们还在升级过程中用 Phusion Passenger 替换了 Mongrel/Mongrel 集群。
每当我们尝试部署应用程序时,它最初似乎响应速度更快,但响应时间逐渐增加。我们还注意到数据库盒上的 CPU 使用率飙升至 400%,并且大量请求在全局队列中等待。这似乎只发生在我们的生产环境中。
谁能告诉我应该如何调试这个问题?
我们是否可以限制乘客和 DB 之间的转机数量?
还有一种方法可以在乘客中设置连接池?
谢谢,
西瓦库玛尔。
Recently our ruby on rails application was upgraded to 2.3.8. We also replaced Mongrel/Mongrel cluster with Phusion Passenger during upgrade.
Whenever we try to deploy our application, it seems to be responding faster initially but response time gradually increases. We also noticed that cpu usage on the database box spiking to 400% and lot of requests waiting in global queue. This seems to be happening only in our production environment.
Can anyone let me know how I should go about debugging this issue?
Is there anyway we can restrict the number of connections between passenger and DB?
Also is there a way we can setup connection pooling in passenger?
Thanks,
Sivakumar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为问题出在乘客身上。如果您的数据库盒 CPU 出现大幅峰值,那么您的问题可能就在那里。如果没有有关数据库的更多信息,很难为您提供具体信息,但您可以尝试以下一些操作:
top
并检查 mysqld 或其他数据库进程消耗了多少总内存。如果这个数量不高,那么您可能需要调整 MySQL 设置以利用数据库盒上的 RAM。mytop
命令分析正在运行的数据库查询。您可能有一些查询占用了所有系统资源或导致大量交换。PS:我建议升级到 Passenger 3,它的性能比 Passenter 2 更好。
I don't think the issue is with Passenger. If you are having a large spike on your DB box CPU, your issue probably lies there. Without more information about your database it's hard to give you specifics, but here are a few things you could try:
top
and check how much of your total memory the mysqld or other database process is consuming. If this amount is not high then you probably need to tune MySQL settings to take advantage of the RAM on your DB box.mytop
command. You might have some queries that are hogging all of your system resources or causing lots of swapping.P.S: I would recommend upgrading to Passenger 3, it performs better than Passenter 2.