Hacker News new | ask | show | jobs
by BobVerg 4590 days ago
And even more:

"send_timeout 2;" Mobile clients from another continent will "thank you" for this setting when they cannot open your site.

"error_log /var/log/nginx/error.log crit;" A way to be unaware when something is wrong with your server. Nginx produces not only "crit" errors, but a bunch of very useful warnings, that need attention.

"limit_conn addr 10;" Chrome and Firefox usually open more than 10 connections. And btw, have you ever heard about NAT?

"Most browsers will open up 2 connections" 15 years ago this was true.

3 comments

"Chrome and Firefox usually open more than 10 connections"

"and our value is 10,"

Both comments are similar in that there's no explanation why.

The correct value for limit_conn needs to be a balance between whatever your page designer or testing addons measured under normal operation, vs DOS/DDOS harm reduction (not prevention, just... reduction) where setting it to 100000 is probably a bad idea unless you're intentionally doing something really bizarre.

I liked the article for what it is, "explain which settings in nginx can be fine tuned in order to optimize performance for handling a large number of clients". It does a really poor job of explaining how to close the loop by benchmarking and monitoring followed by methodically determining which setting to fine tune and doesn't say much about config file version management either, but that's OK, it self described as a shopping list of performance oriented config options, and at that specific sub-task it delivered successfully. One minor area of improvement would have been to bracket the story with what comes before and after in the process... so your monitoring systems and operations procedures indicates xyz which implies you should ...

  > Chrome and Firefox usually open more than 10 connections.
According to browserscope.org both browsers open only 6 connections per hostname.
For http connections that's true. Websockets have a separate pool though, and a much higher cap (200 in Firefox). Nginx recently added websocket support.
And gzip_min_length should probably be set to the MTU size