will passenger continue to serve the request, when nginx terminates connection through timeout?

25 views
Skip to first unread message

Sivalingam S

unread,
Apr 1, 2017, 3:30:37 AM4/1/17
to Phusion Passenger Discussions
We are running rails app in passenger+nginx, nginx has timeout of 1 minute, whereas in newrelic, we can see the long running SQL query has ran for more than 3 minutes.
Nginx had terminated the connection due to request timeout.

Can passenger run the request even after nginx terminated the request because of timeout?

We are running rails in passenger as nginx integration mode.

Daniel Knoppel

unread,
Apr 1, 2017, 3:39:54 PM4/1/17
to Phusion Passenger Discussions
If a request times out, Passenger lets your application know (connection half close).

SQL queries are not run by Passenger but by your application and the database. I can imagine that the database just keeps running the query for however long it takes, unless the application does something special to kill it (which, depending on the database, may not even be supported).

- Daniel

Sivalingam S

unread,
Apr 3, 2017, 1:59:14 PM4/3/17
to Phusion Passenger Discussions


hi Daniel Knoppel,
We are using MySQL. I want the whole request to be killed after the request timeout in nginx. How to achieve that?
Instead of half close, I want the request to be terminated in passenger. So that i can avoid stale passenger process.

Daniel Knoppel

unread,
Apr 3, 2017, 5:23:37 PM4/3/17
to Phusion Passenger Discussions
Passenger has the max_request_time option to prevent stale application processes:

- Daniel

Sivalingam S

unread,
Apr 4, 2017, 2:10:38 AM4/4/17
to Phusion Passenger Discussions

Thanks Daniel Knoppel,

passenger_max_request_time option turns out to be available only in enterprise edition.
Our app server is Ruby on Rails, how to get the trigger for half closed connection inside rails app.
Is their any way to identify and kill the request inside app server?
Reply all
Reply to author
Forward
0 new messages