Connections dropped under load
Kristian Lyngstol
kristian at varnish-software.com
Tue Jan 11 10:51:12 CET 2011
If that is inconvenient, I suggest not top-posting.
PS: This mail is optimized for bottom-to-top reading.
Kristian
Regards,
performance.
expect to use a piece of software written for and optimized for high-end
than enough threads. If you can't use a half-decent machine, then you can't
we'll try to solve. Any half-decent virtual machine will let you use more
don't really have any actual limits relevant to Varnish, is not a problem
That some systems operate with artificially set limits on resources that
operating environments, and we don't really care about number of threads.
Varnish is written for modern computers, modern systems and modern
Hi George,
On Tue, Jan 11, 2011 at 10:09:00AM +0100, George Georgovassilis wrote:
> Hello Kristian,
>
> Thank you for summarizing - the relation between threads, session
> linger and connection handling has been explored indeed sufficiently
> in this thread. The advice of increasing the thread pool size is one
> that is not always easy to follow though. I'm running my app on a
> virtual machine (think Open VMS or EC2) and there is a low thread
> limit, so naturally I'm exploring ways of keeping that low
> especially since the application server behind varnish is also
> competing for them. nginx can as far as I know serve thousand of
> connections with just two worker threads, I erroneously assumed when
> first evaluating varnish that it was using a similar technique.
>
> Regs,
> G.
>
>
> On 11.01.2011 08:48, Kristian Lyngstol wrote:
> >thanks.
> >posting,
> >top
> >stop
> >Please
> >
> >On Tue, Jan 11, 2011 at 12:59:58AM +0100, George Georgovassilis wrote:
> >>Thank you for the hint. Here are the values:
> >>
> >>thread_pools = 2
> >>thread_pool_min = 2
> >>thread_pool_max = 200 (was 2 at the time of my initial tests)
> >>thread_pool_add_delay = 2
> >As have already been pointed out, this is a low value. This also explains
> >why session_linger is an issue to you. Unless you are on 32-bit (which you
> >shouldn't ever ever ever be), there's no reason to not always have a
> >thousand threads laying around. Your settings also means that you have FOUR
> >threads available when you start your tests. Not exactly a lot of room for
> >bursts of traffic.
> >
> >Your other mail actually had a thread_pool_max of 16. That will give you a
> >maximum of 16 concurrent requests that can be handled, with an other 32
> >that can be queued. With session_linger, these threads will remain
> >allocated to the connection for a longer duration, thus it's obvious that
> >in this case, your thread starvation was the real issue and you just
> >triggered it faster with a higher session_linger. It's a perfectly obvious
> >and mystery-free explanation. Session lingering is a mechanism to avoid
> >trashing your system during high load by constantly moving data around
> >between threads, but it depends on reasonable thread-settings - or rather:
> >an abundance of threads.
> >
> >http://kristianlyng.wordpress.com/2010/01/26/varnish-best-practices/ sounds
> >like a good place to start reading. Specially about threads.
> >
> >- Kristian
>
More information about the varnish-misc
mailing list