Re: Poor PostgreSQL scaling on Linux 2.6.25-rc5 (vs 2.6.22)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Willy Tarreau
Date: Monday, March 17, 2008 - 1:26 am

On Mon, Mar 17, 2008 at 06:19:38PM +1100, Nick Piggin wrote:

It's not about what *ssh* uses but about what *others* use. Except by
renicing SSH or marking it real-time, it has no way to say "give the
CPU to me right now, I have something very short to do". So it will
have to wait for the 100 other tasks to eat their 10ms, waiting 1 second
to consume 5ms of CPU (and I was speaking about 800 and not 100).

It is one of the situations where I prefer to shorten timeslices when
load increases because it will not slow down the service too much, but
will still provide better interactivity, which is also benefical to the
service itself since there is no reason for the cycles usage to be the
same for all processes. So by having a finer granularity, small CPU eaters
will finish sooner.


I mean there's only one important task. There is always a bit of pollution
around it, and interrupting the tasks less often slightly reduces the
context-switch overhead.


On the opposite, I think it's a fundamental requirement if you need to
maintain a reasonable interactivity, and a fair progress between all
tasks. I think it's obvious to understand that the only way to maintain
a constant latency with a growing number of tasks is to reduce the time
each task may spend on the CPU. Contrary to other domains such as network,
you don't know how much time a task will spend on the CPU if you grant an
access to it, and there is no way to know because only the work that this
task will perform will determine if it should run shorter or longer. Fair
scheduling in other areas such as network is "easier" because you know the
size of your packets so you know how much time they will take on the wire.

Here with tasks, the best you can do is estimating based on history. But
it will be very rare when you'll be able to correctly guess and guarantee
that the latency is correct.

Maybe the timeslices should shrink only past a certain load though (I don't
know how it's done today).

Regards,
willy

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Poor PostgreSQL scaling on Linux 2.6.25-rc5 (vs 2.6.22), Peter Zijlstra, (Wed Mar 12, 12:58 am)
Re: Poor PostgreSQL scaling on Linux 2.6.25-rc5 (vs 2.6.22), Willy Tarreau, (Mon Mar 17, 1:26 am)