乘客问题

发布于 2024-10-25 17:10:38 字数 308 浏览 3 评论 0原文

最近我们的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天旳寂寞 2024-11-01 17:10:38

我不认为问题出在乘客身上。如果您的数据库盒 CPU 出现大幅峰值,那么您的问题可能就在那里。如果没有有关数据库的更多信息,很难为您提供具体信息,但您可以尝试以下一些操作:

  1. 运行 top 并检查 mysqld 或其他数据库进程消耗了多少总内存。如果这个数量不高,那么您可能需要调整 MySQL 设置以利用数据库盒上的 RAM。
  2. 使用 mytop 命令分析正在运行的数据库查询。您可能有一些查询占用了所有系统资源或导致大量交换。
  3. 查看 MySQL 慢速日志,看看是否有运行时间超过 1 秒的查询。
  4. 检查您的数据库引擎。您使用 MYISAM 和/或 InnoDB 吗?您可能需要以不同的方式调整数据库,以便它可以为每个引擎分配适当数量的内存和资源。
  5. 咨询 DBA。他们将能够查看您的使用情况和应用程序,并更明确地告诉您问题是否出在您的数据库或应用程序上。

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:

  1. Run 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.
  2. Analyze your running database queries with the mytop command. You might have some queries that are hogging all of your system resources or causing lots of swapping.
  3. Look through your MySQL slow log and see if you have queries that are taking over 1 second to run.
  4. Check your database engines. Are you using MYISAM and/or InnoDB? You might need to tune your database differently so that it can allocate the proper amount of memory and resources to each engine.
  5. Consult a DBA. They'll be able to take a look at your usage and application and tell you more definitively if the issue lies with your database or application.

P.S: I would recommend upgrading to Passenger 3, it performs better than Passenter 2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文