News for hackers. Stuff that matters.
Re:How to handle 1000s of concurrent users on a 360MB VPS by otterley on Saturday May 28, 2011 @02:43PM (#2594958)
This technique naïvely assumes the only thing that is slow is the client. If a backend data provider that the web server communicates with (e.g., database) is also slow, this arrangement merely adds complexity without much corresponding benefit. The origin server will still block waiting on the data provider, which can cause process starvation in the pathological case.

Moreover, issues with slow clients often can be solved by raising the TCP send buffer size. As long as the response size is less than the send buffer size, it really doesn't matter how slow the client is: write() will return immediately, leaving the webserver free to serve the next request. Getting the data to the client then becomes the kernel's responsibility.

Re:How to handle 1000s of concurrent users on a 360MB VPS by SaltwaterC on Friday June 03, 2011 @09:31AM (#2616244)
That would work, unless you're using a container-based VPS. OpenVZ is notorious for standing in the way of system tuning. Using nginx makes a lot of sense in this case, especially with the ey-balancer patch.
Re:How to handle 1000s of concurrent users on a 360MB VPS by otterley on Saturday June 04, 2011 @12:45PM (#2619794)
The TCP send buffer size can be controlled at the application level (see SO_SNDBUF in tcp(7)). There's no need to adjust kernel sysctl settings.
Re:How to handle 1000s of concurrent users on a 360MB VPS by SaltwaterC on Sunday June 05, 2011 @08:00AM (#2621850)
By the manual page you mentioned: http://linux.die.net/man/7/socket

> SO_SNDBUF: [...] The default value is set by the wmem_default sysctl and the maximum allowed value is set by the wmem_max sysctl.

You can't use sysctl under OpenVZ. QED.

Re:How to handle 1000s of concurrent users on a 360MB VPS by otterley on Sunday June 05, 2011 @01:08PM (#2622369)
Fair enough - then you'll have to switch to a different VPS if you're sending > 128KB responses. Use the right tool for the job.