Re: Context switch storm

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Context switch storm
Дата
Msg-id 454B3B75.6@archonet.com
обсуждение исходный текст
Ответ на Context switch storm  (creimer@brturbo.com.br)
Ответы Re: Context switch storm  (Richard Troy <rtroy@ScienceTools.com>)
Re: Context switch storm  (Cosimo Streppone <cosimo@streppone.it>)
Re: Context switch storm  (creimer@brturbo.com.br)
Список pgsql-performance
creimer@brturbo.com.br wrote:
> Hi,
>
> We've migrated one of our servers from pg 7.4 to 8.1 and from times
> to times (4 hours) the server start doing a lot of context switching
> and all transactions become very slow.
>
> The average context switching for this server as vmstat shows is 1
> but when the problem occurs it goes to 250000.
>
> CPU and memory usage are ok.
>
> What is producing this context switching storms?
 >
> It is a box with 16GB RAM and 4 XEON processors running RedHat
> Enterprise Linux AS.

It's memory bandwidth issues on the older Xeons. If you search the
archives you'll see a lot of discussion of this. I'd have thought 8.1
would be better than 7.4 though.

You'll tend to see it when you have multiple clients and most queries
can use RAM rather than disk I/O. My understanding of what happens is
that PG requests data from RAM - it's not in cache so the process gets
suspended to wait. The next process does the same, with the same result.
   You end up with lots of processes all fighting over what data is in
the cache and no-one gets much work done.

> Should I disable Hyperthreading?

I seem to remember that helps, but do check the mailing list archives
for discussion on this.

If you can keep your numbers of clients down below the critical level,
you should find the overall workload is fine. The problem is of course
that as the context-switching increases, each query takes longer which
means more clients connect, which increases the context-swtching, which
means...

HTH
--
   Richard Huxton
   Archonet Ltd

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Gregory S. Williamson"
Дата:
Сообщение: Re: Context switch storm
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Context switch storm