我如何确定 mongrel_cluster 中的每个进程都在处理请求?

发布于 2024-08-03 11:07:57 字数 470 浏览 3 评论 0原文

我有一个 Rails 应用程序需要一段时间来处理某些请求(因为它处理图像上传)。目前,我的集群中有三个混合进程,如果第一个进程繁忙,我希望另外两个进程中的一个能够处理第二个请求。

然而,这似乎并没有发生。如果我观察服务器上 top 的输出,我可以知道它何时调整图像大小,因此,如果我尝试使用简单的请求(通常会很快完成)来访问应用程序,似乎等待长时间运行的请求完成。

当我查看 log/mongrel.xxxx.log 文件时,我看到的只是应用程序启动的输出。

如何验证哪个进程正在实际处理每个请求?

我能让他们杂种记录每个请求(即使它只是一个时间戳,以及类似“GET /path/to/resource”的东西)?

任何想法为什么集群可能不首先共享负载?

前端 Web 服务器是 nginx,所以也许这就是我应该寻找的地方? nginx access_log 中似乎没有任何关于请求被代理到的位置的信息。

I have a rails application that takes a while to process certain requests (as it processes image uploads). I currently have three mongrel processes in a cluster, and I expect one of the other two to handle a second request if the first one is busy.

However, this doesn't seem to be happening. If I watch the output from top on the server, I can tell when it is resizing an image, so if I try to hit the application with an easy request (which would normally finish quickly), it seems to wait until the long-running request in finished.

When I look in the log/mongrel.xxxx.log files, all I see is the output from the application starting up.

How can I verify which process is actually handling each request?

Can I get them mongrels to log each request (even if it is just a timestamp, and something like 'GET /path/to/resource')?

Any ideas why the cluster might not be sharing the load in the first place?

The front-end web server is nginx, so maybe that is where I should be looking? The nginx access_log doesn't seem to have anything in it about where the request was proxied to.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

东京女 2024-08-10 11:07:58

不久前,我们在 reevoo.com 上遇到了类似的问题。看看 由此产生的博客文章

特别令人感兴趣的是使用 mongrel_proctitle 来诊断问题。它将允许 ps aux 看到特定的杂种正在处理什么。

We encountered similar issues on reevoo.com some time ago. Have a look at the resultant blog post.

Of specific interest is the use of mongrel_proctitle to diagnose the issue. It will allow a ps aux to see what a specific mongrel is handling.

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