更新到 Rails 3.1.0.rc5 Passenger with nginx 后出现间歇性 502 错误

发布于 2024-11-26 17:17:58 字数 2281 浏览 0 评论 0原文

看起来只有一个乘客实例处理请求,其他实例仅处理 502 错误。这会导致间歇性错误模式,因为只有定向到第二个实例的请求才会失败。

~$ rvmsudo passenger-status
----------- General information -----------
max      = 4
count    = 2
active   = 0
inactive = 2
Waiting on global queue: 0

----------- Application groups -----------
/u/apps/pixie.strd6.com/current:
  App root: /u/apps/pixie.strd6.com/current
  * PID: 3179    Sessions: 0    Processed: 121     Uptime: 3m 57s
  * PID: 3762    Sessions: 0    Processed: 0       Uptime: 2s

更新到 Rails 3.1.0 rc5 后发生这种情况

2011/07/27 21:37:37 [error] 3125#0: *608 upstream prematurely closed connection while reading response header from upstream, client: 68.226.71.148, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/projects/426/ide"
2011/07/27 21:38:31 [error] 3125#0: *596 upstream prematurely closed connection while reading response header from upstream, client: 76.102.14.57, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/pixel-editor"
2011/07/27 21:39:12 [error] 3125#0: *576 upstream prematurely closed connection while reading response header from upstream, client: 68.8.173.234, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/community/forums/1"
2011/07/27 21:39:12 [error] 3125#0: *687 upstream prematurely closed connection while reading response header from upstream, client: 201.231.103.247, server: pixieengine.com, request: "GET /chats/active_users HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/projects/demo/ide"
2011/07/27 21:39:12 [error] 3125#0: *686 upstream prematurely closed connection while reading response header from upstream, client: 201.231.103.247, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/projects/demo/ide"

It appears that only one passenger instance serves requests, the others just serve 502 errors. This causes an intermittent error pattern because only the requests that are directed to the second instance fail.

~$ rvmsudo passenger-status
----------- General information -----------
max      = 4
count    = 2
active   = 0
inactive = 2
Waiting on global queue: 0

----------- Application groups -----------
/u/apps/pixie.strd6.com/current:
  App root: /u/apps/pixie.strd6.com/current
  * PID: 3179    Sessions: 0    Processed: 121     Uptime: 3m 57s
  * PID: 3762    Sessions: 0    Processed: 0       Uptime: 2s

This happened after updating to Rails 3.1.0 rc5

2011/07/27 21:37:37 [error] 3125#0: *608 upstream prematurely closed connection while reading response header from upstream, client: 68.226.71.148, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/projects/426/ide"
2011/07/27 21:38:31 [error] 3125#0: *596 upstream prematurely closed connection while reading response header from upstream, client: 76.102.14.57, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/pixel-editor"
2011/07/27 21:39:12 [error] 3125#0: *576 upstream prematurely closed connection while reading response header from upstream, client: 68.8.173.234, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/community/forums/1"
2011/07/27 21:39:12 [error] 3125#0: *687 upstream prematurely closed connection while reading response header from upstream, client: 201.231.103.247, server: pixieengine.com, request: "GET /chats/active_users HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/projects/demo/ide"
2011/07/27 21:39:12 [error] 3125#0: *686 upstream prematurely closed connection while reading response header from upstream, client: 201.231.103.247, server: pixieengine.com, request: "GET /chats/recent HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "pixieengine.com", referrer: "http://pixieengine.com/projects/demo/ide"

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

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

发布评论

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

评论(2

蓝眼泪 2024-12-03 17:17:58

我通过切换到 Unicorn 解决了这个问题。

我实际上无法弄清楚如何修复乘客,但我能够验证它是由于从 Rails 3.0.9 到 3.1.0.rc5 的过渡而损坏的。

I solved this by switching to Unicorn.

I wasn't actually able to figure out how to fix passenger, but I was able to verify that it broke because of the transition from Rails 3.0.9 to 3.1.0.rc5.

戏蝶舞 2024-12-03 17:17:58

临时修复是在乘客中使用保守的 PassengerSpawnMethod,这会禁用分叉正在运行的进程。

The temporary fix is to use PassengerSpawnMethod conservative in passenger, which disables forking running processes.

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