Skip to content

Comment on Optimizing Nginx for High Traffic Loads

Comments

I think he's got a little math problem. Many browsers will open up to 4 connections (possibly more, if config tweaked) to overlap requests for content, so you might want to consider this when configuring your worker_connections.

This is not a math problem. It's a perception problem. In fact, even your assumption is wrong, on the number of connections a browser will open. Modern browsers will be found opening 6 to 8 connections, by default.

http://stevesouders.com/ua/report.php

Each worker can handle many thousands of concurrent connections so this isn't really an issue. This is where nginx and Apache differ. Generally you want one worker per CPU core.

I know how nginx works, I use it all the time. He is saying if you have 1024 woker_connections, at 2 per connections per user, you'll get 512 users per worker process. But the truth with most modern browsers is it is 4 connections per user, woker_connections = 1024, that is more like 256 users. So if you really want to service 512 users, you need to set woker_connections to 2048. This is the math problem I was highlighting, a simple division problem.

I believe you are talking about worker_processes

Oops -- you're right I misread your comment. Sorry about that.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.