Unix Technical Forum

Context switching

This is a discussion on Context switching within the Pgsql Performance forums, part of the PostgreSQL category; --> Hi, We've migrated one of our servers from pg 7.4 to 8.1 and from times to times (4 hours) ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 09:43 AM
Carlos H. Reimer
 
Posts: n/a
Default Context switching

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 can produce this context switching storms?

It is a box with 12GB RAM and 4 processors running RedHat Enterprise Linux
AS.

Thank you in advance!
Reimer
carlos.reimer@opendb.com.br
OpenDB Serviços e Treinamentos PostgreSQL e DB2
Fone: 47 3327-0878 Cel: 47 9602-0151
www.opendb.com.br


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 09:43 AM
Carlos H. Reimer
 
Posts: n/a
Default RES: Context switching

Hi,

Sorry, but this message was already post some days before!

Thank you!

Carlos

-----Mensagem original-----
De: pgsql-performance-owner@postgresql.org
[mailtogsql-performance-owner@postgresql.org]Em nome de Carlos H. Reimer
Enviada em: quarta-feira, 1 de novembro de 2006 03:23
Para: pgsql-performance@postgresql.org
Assunto: [PERFORM] Context switching


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 can produce this context switching storms?

It is a box with 12GB RAM and 4 processors running RedHat Enterprise Linux
AS.

Thank you in advance!
Reimer
carlos.reimer@opendb.com.br
OpenDB Serviços e Treinamentos PostgreSQL e DB2
Fone: 47 3327-0878 Cel: 47 9602-0151
www.opendb.com.br


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 09:44 AM
Josh Berkus
 
Posts: n/a
Default Re: Context switching

Carlos,

> 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.


Context Switching is a symptom rather than a cause. What's most likely
happening is that you have a combined heavy-CPU and heavy-IO workload, so you
have bursts of CPU activity stalled by iowaits.

Can you check the rate of iowaits during the "storm" periods?

Also, is this Xeon? And are you saying that you *didn't* have this issue
under 7.4?

--
Josh Berkus
PostgreSQL @ Sun
San Francisco

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 09:46 AM
Carlos H. Reimer
 
Posts: n/a
Default RES: Context switching

Hi,

I have not seen the iowaits numbers and yes, it is a xeon, four processors.

With the 7.4 version the problem did not exist but I think Tom Lane cleared why this behavior with 8.0 and 8.1 versions in http://archives.postgresql.org/pgsql...1/msg00050.php

Reimer


> -----Mensagem original-----
> De: Josh Berkus [mailto:josh@agliodbs.com]
> Enviada em: terça-feira, 7 de novembro de 2006 15:42
> Para: pgsql-performance@postgresql.org; carlos.reimer@opendb.com.br
> Assunto: Re: [PERFORM] Context switching
>
>
> Carlos,
>
> > 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.

>
> Context Switching is a symptom rather than a cause. What's most likely
> happening is that you have a combined heavy-CPU and heavy-IO
> workload, so you
> have bursts of CPU activity stalled by iowaits.
>
> Can you check the rate of iowaits during the "storm" periods?
>
> Also, is this Xeon? And are you saying that you *didn't* have
> this issue
> under 7.4?
>
> --
> Josh Berkus
> PostgreSQL @ Sun
> San Francisco
>
>



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:15 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com