Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 07E3B63352F for ; Mon, 31 May 2010 05:12:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 88115-09 for ; Mon, 31 May 2010 08:12:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 779B8633364 for ; Mon, 31 May 2010 05:12:27 -0300 (ADT) Received: by pvg11 with SMTP id 11so1241337pvg.19 for ; Mon, 31 May 2010 01:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:references:subject :date:message-id:mime-version:content-type:x-mailer:thread-index :in-reply-to:x-mimeole; bh=ExG509sUzU4iillVKwUqR0gY8KVwBJQlLX0dqTH+mgI=; b=S6azz4J0ESDmOm13F8RggMQ4u7FcYvttGGntRVQJ/fPoDNpytThQoWUDhCPaUkf+o0 YaS1HN1ESQT1VtKbJ/p4g71MYN43vJg7BDddxg7xxBdWlzYxyQJjqBbgITnTkynEiLRJ edCeFGUBg2k3aSS/YN9IhN0lJ/443NpZFhsEc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:references:subject:date:message-id:mime-version :content-type:x-mailer:thread-index:in-reply-to:x-mimeole; b=yGtcU2jvRvy7M+DoNY5LAk/EBIUI4NM0twW/ns3w3wsIDsH+1qpT5ZB9EWEswE9y3w by1FX6uSYN2O+xztEsmzQI8beGKkPo+2L4NNSQFDcIEBUNkc43+vBbbo6K22HZHJi/sC aUsZqt2HckGrDXGYPvM2oqpt1ZW6Y9wtz7YuE= Received: by 10.142.195.20 with SMTP id s20mr2627895wff.248.1275293545991; Mon, 31 May 2010 01:12:25 -0700 (PDT) Received: from NECSLGZ0061411 (mx.gtmc.com.cn [58.62.17.14]) by mx.google.com with ESMTPS id v41sm1577267wfh.9.2010.05.31.01.12.23 (version=SSLv3 cipher=RC4-MD5); Mon, 31 May 2010 01:12:24 -0700 (PDT) From: =?UTF-8?B?6buE5rC45Y2r?= To: =?UTF-8?Q?'I=C3=B1igo_Martinez_Lasala'?= Cc: "'pgsql-admin'" References: <62F94C41871A4EF1BECEF463739B7A47@NECSLGZ0061411> <1275032584.19383.71.camel@deimos> <0B6FD27EE04F46298DD48C670E44F559@NECSLGZ0061411> <1275292312.8125.14.camel@deimos> Subject: =?UTF-8?Q?=E7=AD=94=E5=A4=8D:_=E7=AD=94=E5=A4=8D:_About_=22Context-switc?= =?UTF-8?Q?h_storm=22_problem?= Date: Mon, 31 May 2010 16:12:26 +0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0075_01CB00DC.1111B790" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcsAlig3Xom6KGOcSau+yDbsnRAkuAAAp1Og In-Reply-To: <1275292312.8125.14.camel@deimos> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.782 tagged_above=-10 required=5 tests=BAYES_50=0.8, HTML_FONT_FACE_BAD=0.981, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: * X-Archive-Number: 201005/297 X-Sequence-Number: 34770 This is a multi-part message in MIME format. ------=_NextPart_000_0075_01CB00DC.1111B790 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear I=C3=B1igo Martinez Lasala=EF=BC=8C =20 =20 Thank you for you information ! =20 =20 _____ =20 =E5=8F=91=E4=BB=B6=E4=BA=BA: I=C3=B1igo Martinez Lasala = [mailto:imartinez@vectorsf.com]=20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2010=E5=B9=B45=E6=9C=8831=E6=97=A5 = 15:52 =E6=94=B6=E4=BB=B6=E4=BA=BA: =E9=BB=84=E6=B0=B8=E5=8D=AB =E6=8A=84=E9=80=81: 'pgsql-admin' =E4=B8=BB=E9=A2=98: Re: =E7=AD=94=E5=A4=8D: About "Context-switch storm" = problem =20 1- Of course, we could. Problem appeared in both 8.1.8 and 8.1.15 after = an initial upgrade. Today database is not online due to a migration to another technology. = It's not our database (a customer one) so we have no access to it at = this moment.=20 2- One of the major on-line shops of Spain. This only happened under = heavy load condition (that's under Christmas campaign), with a lot = queries per minutes, some of then heavy search on database using tsearch = modules. Under low load, there was no problem. After upgrading to 8.2 and splitting our database in two (one database = only for catalog searches, another database for standard operation) = problem disappeared. Our context switches where about 5000-10000 per second or less under low = load scaling up to 300.000 per second under heavy load. Most of CPU time = was spent on context switches and not on operating DB. The database was 20 gigabytes size over a Quad Intel Xeon-DP (HT = enabled) at 2.6Ghz with 16GB RAM memory running on a Red Hat 3.X with = kernel 2.4. First we upgraded to Red Hat 5 in order to get a kernel 2.6, then we = installed postgres 8.2 and finally we splitted database. Typical load decreased from 80-100% on high load periods to 5% or less = per server with these changes. Context switches drop to 5000 or less per = second. I'm think that splitting database wouldn't have been needed, but anyway = the changes were made to deal with higher loads in future... although = six months later the shop was migrated to SQL Server + ASP.NET = technology (decision was taken one year before and was not due to these = problems :-) ). The problem was due to several factors: kernel 2.4 + postgresql 8.2 + = Intel Xeon DP =20 -----Original Message----- From: =E9=BB=84=E6=B0=B8=E5=8D=AB > To: 'I=C3=B1igo Martinez Lasala' > Cc: 'pgsql-admin' > Subject: =E7=AD=94=E5=A4=8D: About "Context-switch storm" problem Date: Mon, 31 May 2010 10:43:55 +0800 Dear I=C3=B1igo Martinez Lasala=EF=BC=8C Thank you for your replay and advice.=20 My company is a software application vendor, and our customer is useing = PostgreSQL 8.1.3. When our application is runing , the DB sluggish suddenly and = application stop. To prove that it is not the problem of the application = ,We need some evidence to certified this version have problem and show = to our customer. And Can I ask you several questions? =20 1=E3=80=81 Can you recreate the "Context-switch storm" in the your = old version PostgreSQL 8.1.15 ? 2=E3=80=81 If you can ,could you please tell me your test case = =EF=BC=9F =20 Thank you so much=EF=BC=81 =20 Best regards, Ray Huang =20 _____ =20 =E5=8F=91=E4=BB=B6=E4=BA=BA: I=C3=B1igo Martinez Lasala = [mailto:imartinez@vectorsf.com]=20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2010=E5=B9=B45=E6=9C=8828=E6=97=A5 = 15:43 =E6=94=B6=E4=BB=B6=E4=BA=BA: =E9=BB=84=E6=B0=B8=E5=8D=AB =E6=8A=84=E9=80=81: pgsql-admin =E4=B8=BB=E9=A2=98: Re: About "Context-switch storm" problem =20 Hi, Yongwei We finally upgraded our database server to last PostgreSQL 8.2 = available. Since 8.2 does not include any major change (8.3 does indeed a lot of = them) we had no problem with this upgrade. And believe, our database was = really complex. About 600 tables with 300 stored procedures, wide use of = embedded functions from different packages (including tsearch2) and lot = of triggers and views. Not problems at all.=20 Migrating to 8.3 or 8.4 is another history. So, my recommendation is to = migrate to 8.2.17 -----Original Message----- From: =E9=BB=84=E6=B0=B8=E5=8D=AB > To: imartinez@vectorsf.com Subject: About "Context-switch storm" problem Date: Fri, 28 May 2010 13:31:54 +0800 Hello=EF=BC=8CI=C3=B1igo Martinez Lasala ! =20 I read your mail about =E2=80=9CContext-switch storm in 8.1.15=E2=80=9D = from postgres website. I think I meet the same problem as you now . Recently my company=E2=80=99s postgres DB server sluggish suddenly with = a hight Context-switching value as below: =20 2010-04-07 04:03:15 procs memory swap = io system cpu 2010-04-07 04:03:15 r b swpd free buff cache si so bi = bo in cs us sy id wa 2010-04-07 14:04:27 3 0 0 2361272 272684 3096148 0 0 3 = 1445 973 14230 7 8 84 0 2010-04-07 14:05:27 2 0 0 2361092 272684 3096220 0 0 3 = 1804 1029 31852 8 10 81 1 2010-04-07 14:06:27 1 0 0 2362236 272684 3096564 0 0 3 = 1865 1135 19689 9 9 81 0 2010-04-07 14:07:27 1 0 0 2348400 272720 3101836 0 0 3 = 1582 1182 149461 15 17 67 0 2010-04-07 14:08:27 3 0 0 2392028 272840 3107600 0 0 3 = 3093 1275 203196 24 23 53 1 2010-04-07 14:09:27 3 1 0 2386224 272916 3107960 0 0 3 = 2486 1331 193299 26 22 52 0 2010-04-07 14:10:27 34 0 0 2332320 272980 3107944 0 0 3 = 1692 1082 214309 24 22 54 0 2010-04-07 14:11:27 1 0 0 2407432 273028 3108092 0 0 6 = 2770 1540 76643 29 13 57 1 2010-04-07 14:12:27 9 0 0 2358968 273104 3108388 0 0 7 = 2639 1466 10603 22 6 72 1 =20 =20 I May I know your solution after that ? =20 =20 =20 Thank you ! Best wishes, Ray Huang ------=_NextPart_000_0075_01CB00DC.1111B790 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Dear I=C3=B1igo Martinez = Lasala=EF=BC=8C=C2=A0=C2=A0=C2=A0 =

 

Thank you for you = information !

=C2=A0=C2=A0=C2=A0 =

 

=

=E5=8F=91=E4=BB=B6=E4=BA=BA: I=C3=B1igo Martinez Lasala [mailto:imartinez@vectorsf.com]
=E5=8F=91=E9=80=81=E6=97=B6=E9= =97=B4: 2010=E5=B9=B45=E6=9C=8831=E6=97=A5 15:52
=E6=94=B6=E4=BB=B6=E4=BA=BA: =E9=BB=84=E6=B0=B8=E5=8D=AB
=E6=8A=84=E9=80=81: 'pgsql-admin'
=E4=B8=BB=E9=A2=98: Re: =E7=AD=94=E5=A4=8D: About = "Context-switch storm" problem

 

1- Of course, we could. Problem = appeared in both 8.1.8 and 8.1.15 after an = initial upgrade.
Today database is not online due to a migration to another technology. = It's not our database (a customer one) so we have no access to it at this moment. =

2- One of the major on-line shops of Spain. This only happened = under heavy load condition (that's under Christmas campaign), with a lot = queries per minutes, some of then heavy search on database using tsearch modules. = Under low load, there was no problem.

After upgrading to 8.2 and splitting our database in two (one database = only for catalog searches, another database for standard operation) problem = disappeared.

Our context switches where about 5000-10000 per second or less under low = load scaling up to 300.000 per second under heavy load. Most of CPU time was = spent on context switches and not on operating DB.
The database was 20 gigabytes size over a Quad Intel Xeon-DP (HT = enabled) at 2.6Ghz with 16GB RAM memory running on a Red Hat 3.X with kernel = 2.4.

First we upgraded to Red Hat 5 in order to get a kernel 2.6, then we installed postgres 8.2 and finally we splitted database.
Typical load decreased from 80-100% on high load periods to 5% or less = per server with these changes. Context switches drop to 5000 or less per = second.

I'm think that splitting database wouldn't have been needed, but anyway = the changes were made to deal with higher loads in future... although six = months later the shop was migrated to SQL Server + ASP.NET technology (decision = was taken one year before and was not due to these problems :-) ).

The problem was due to several factors: kernel 2.4 + postgresql 8.2 + = Intel Xeon DP 

-----Original Message-----
From: =
=E9=BB=84=E6=B0=B8=E5=8D=AB <yongwei.huang@gmail.com&= gt;
To: 'I=C3=B1igo Martinez = Lasala' <imartinez@vectorsf.com>
= Cc: 'pgsql-admin' <pgsql-ad= min@postgresql.org>
Subject: =
=E7=AD=94=E5=A4=8D: About "Context-switch storm" problem
Date: Mon, 31 May 2010 = 10:43:55 +0800

Dear I=C3=B1igo Martinez = Lasala
=EF=BC=8C

    Thank = you for your replay and advice.

My company is a software application vendor, and our customer  is useing PostgreSQL = 8.1.3.

When our application is = runing , the DB sluggish suddenly and application stop.

To prove that it is not the problem of the application ,We need some evidence to = certified this version have problem and show to our customer.

    And = Can  I ask you  several  = questions?

 

1=E3=80=81  Can you recreate the =  "Context-switch storm" in the  your old version PostgreSQL 8.1.15 = ?

2=E3=80=81  If you can ,could you please tell me = your test case =EF=BC=9F

 

Thank you so = much
=EF=BC=81

 

Best = regards,

Ray = Huang

 


=E5=8F=91=E4=BB=B6=E4=BA=BA: I=C3=B1igo = Martinez Lasala [mailto:imartinez@vectorsf.com]
=E5=8F=91=E9=80=81=E6=97=B6=E9= =97=B4: 2010=E5=B9=B45=E6=9C=8828=E6=97=A5 = 15:43
=E6=94=B6=E4=BB=B6=E4=BA=BA: =E9=BB=84=E6=B0=B8=E5=8D=AB
=E6=8A=84=E9=80=81: pgsql-admin
=E4=B8=BB=E9=A2=98: Re: About "Context-switch storm" = problem


 

Hi, Yongwei

We finally upgraded our database server to last PostgreSQL 8.2 = available.

Since 8.2 does not include any major change (8.3 does indeed a lot of = them) we had no problem with this upgrade. And believe, our database was really = complex. About 600 tables with 300 stored procedures, wide use of embedded = functions from different packages (including tsearch2) and lot of triggers and = views. Not problems at all.

Migrating to 8.3 or 8.4 is another history. So, my recommendation is to = migrate to 8.2.17

-----Original Message-----
From: =
=E9=BB=84=E6=B0=B8=E5=8D=AB<yongwei.huang@gmail.com&= gt;
To: imartinez@vectorsf.com
Subject: About "Context-switch storm" problem
Date: Fri, 28 May 2010 = 13:31:54 +0800

Hello=EF=BC=8CI=C3=B1igo Martinez Lasala !

   

I read your mail about =E2=80=9CContext-switch storm in = 8.1.15=E2=80=9D from = postgres website.

I think I meet the same problem as you now = .

Recently my = company=E2=80=99s  postgres DB server sluggish suddenly with a hight Context-switching value as = below:

 

2010-04-07 04:03:15 procs           &n= bsp;          memory      swap          io =     system       &= nbsp; cpu

2010-04-07 04:03:15  = r  b   swpd   free   buff  = cache   si   so    bi    bo   in    cs us sy id wa

2010-04-07 14:04:27  = 3  0      0 2361272 272684 = 3096148    0    0     3  1445  973 14230  7  8 84  0

2010-04-07 14:05:27  = 2  0      0 2361092 272684 = 3096220    0    0     3  1804 1029 = 31852  8 10 81  1

2010-04-07 14:06:27  = 1  0      0 2362236 272684 = 3096564    0    0     3  1865 1135 = 19689  9  9 81  0

2010-04-07 14:07:27  = 1  0      0 2348400 272720 = 3101836    0    0     3  1582 1182 149461 = 15 17 67  0

2010-04-07 14:08:27  = 3  0      0 2392028 272840 = 3107600    0    0     3  3093 1275 203196 = 24 23 53  1

2010-04-07 14:09:27  = 3  1      0 2386224 272916 = 3107960    0    0     3  2486 1331 193299 = 26 22 52  0

2010-04-07 14:10:27 = 34  0      0 2332320 272980 = 3107944    0    0     3  1692 1082 214309 = 24 22 54  0

2010-04-07 14:11:27  = 1  0      0 2407432 273028 = 3108092    0    0     6  2770 1540 76643 29 = 13 57  1

2010-04-07 14:12:27  = 9  0      0 2358968 273104 = 3108388    0    0     7  2639 1466 10603 = 22  6 72  1

 

 

I

May I know your solution after  that = ?

 

 

 

Thank you !

Best wishes,

Ray Huang





------=_NextPart_000_0075_01CB00DC.1111B790--