How should I configure Nginx to maximise the throughput for single Ruby application running on Passenger? How should I configure Nginx to maximise the throughput for single Ruby application running on Passenger? nginx nginx

How should I configure Nginx to maximise the throughput for single Ruby application running on Passenger?


Passenger dev here.

"Can the Nginx configuration be improved further?"

Probably, Nginx has a lot of levers, and if all you are doing is serving known payloads in a benchmark then you can seriously improve performance with Nginx's caching, for example.

"Is it using HTTP/1.1 persistent connections to the Passenger application servers?"

No it uses unix sockets.

"Is using a dynamic module causing any performance issues?"

No, once nginx loads the library, making a function call into it is the same as any other c++ function call.

"Do I need to do anything else to maximize the efficiency of how the integration is working?"

You might want to look into Passenger's turbo caching, and/or nginx caching.

"I haven't set a passenger log file to ensure that logging IO is not a bottleneck."

Good, but turn the logging level down to 0 to avoid a bit of processing.

"Would it make sense to use threads per application server? I assume it's only relevant for IO bound workloads."

Not sure exactly what you mean, are you talking about Passenger's multithreading support or nginx's?

"If I am pegging the processors with 8 application servers, does that indicate a sufficient amount of servers?"

If you are CPU bound then adding more processes won't help.

"What is the expected performance difference between Nginx+Passenger vs Passenger Standalone?"

Not much, Passenger standalone uses nginx internally. You might see some improvement if you use the builtin engine with passenger standalone, but that means you can't use caching which is far more important.