Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5991957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:27:46+00:00 2026-05-22T23:27:46+00:00

I have the latest Nginx running with Passenger, SQLite and Rails 3.1. Somehow, when

  • 0

I have the latest Nginx running with Passenger, SQLite and Rails 3.1. Somehow, when I have Passenger running for a while, I start getting “502 bad gateway” errors when visiting my website.

Here is a snippet from my Nginx error log:

2011/06/27 08:55:33 [error] 20331#0: *11270 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xx.x, server: www.example.com, request: "GET / HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "example.com"
2011/06/27 08:55:47 [info] 20331#0: *11273 client closed prematurely connection, so upstream connection is closed too while sending request to upstream, client: xxx.xxx.xx.x, server: www.example.com, request: "GET / HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "example.com"

Here is my passenger-status --show=backtraces output:

Thread 'Client thread 7':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 10':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 11':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 12':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 13':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 14':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 15':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 16':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 17':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 18':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 19':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 20':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 21':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 22':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 23':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'Client thread 24':
 in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:160)
 in 'void Client::threadMain()' (HelperAgent.cpp:603)

Thread 'MessageServer thread':
 in 'void Passenger::MessageServer::mainLoop()' (MessageServer.h:537)

Thread 'MessageServer client thread 35':
 in 'virtual bool Passenger::BacktracesServer::processMessage(Passenger::MessageServer::CommonClientContext&, boost::shared_ptr<Passenger::MessageServer::ClientContext>&, const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)' (BacktracesServer.h:47)
 in 'void Passenger::MessageServer::clientHandlingMainLoop(Passenger::FileDescriptor&)' (MessageServer.h:470)

This is what my passenger-memory-stats shows:

---------- Nginx processes ----------
PID    PPID   VMSize   Private  Name
-------------------------------------
16291  1      35.4 MB  0.1 MB   nginx: master process /home/apps/.nginx/sbin/nginx
16292  16291  36.0 MB  0.8 MB   nginx: worker process
16293  16291  35.8 MB  0.5 MB   nginx: worker process
16294  16291  35.8 MB  0.5 MB   nginx: worker process
16295  16291  35.8 MB  0.5 MB   nginx: worker process
### Processes: 5
### Total private dirty RSS: 2.46 MB


----- Passenger processes ------
PID    VMSize    Private   Name
--------------------------------
16251  87.0 MB   0.3 MB    PassengerWatchdog
16254  100.4 MB  1.3 MB    PassengerHelperAgent
16256  41.6 MB   5.7 MB    Passenger spawn server
16259  134.8 MB  0.8 MB    PassengerLoggingAgent
18390  770.4 MB  17.1 MB   Passenger ApplicationSpawner: /home/apps/manager/current
18415  853.3 MB  147.7 MB  Rack: /home/apps/manager/current
18424  790.5 MB  57.2 MB   Rack: /home/apps/manager/current
18431  774.7 MB  18.7 MB   Rack: /home/apps/manager/current
### Processes: 8
### Total private dirty RSS: 248.85 MB

It seems there is an issue with my the communication between Passenger and Nginx?

Also, looking at the Rails logs, it is clear that the request never reaches Rails at all, as there are no log entries for visits that get the 502 error. So my initial thought of something being wrong with any Rack middleware should not be possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:27:46+00:00Added an answer on May 22, 2026 at 11:27 pm

    The “V” in VM is for Virtual. See also answers on other SO questions, e.g. Virtual Memory Usage from Java under Linux, too much memory used.

    That top 147 MB does not hint of anything unusual whatsoever. Your 502 errors mean something else is wrong with the worker processes from Passenger’s point of view. You should check your Rails & Nginx log files for clues, and perhaps passenger-status --show=backtraces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Windows XP SP3 and I do have the latest .NET libraries installed,
I am on rails 2.3.5 and have the latest Ruby installed and my application
I do have the latest Android API and a ICS emulator running, but I
I have an application running on thin 1.2.11 behind nginx. I was trying to
I have the latest 64 bit version of PostgreSQL. I am running Win 7
I have installed latest version of pligg on my local server. It's running fine.
I have been trying to setup nginx with passenger for a few days now
I have the latest ReSharper 5.0 build (1655), where I have encountered the suggestion
I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But
I have downloaded the latest build of pyscopg2 and have tried to build and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.