Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B29C7632EA0 for ; Mon, 11 Jan 2010 14:57:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 64098-08 for ; Mon, 11 Jan 2010 18:57:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mail.postgresql.org (Postfix) with ESMTP id 6AE57632483 for ; Mon, 11 Jan 2010 14:57:34 -0400 (AST) Received: by fg-out-1718.google.com with SMTP id 22so858534fge.1 for ; Mon, 11 Jan 2010 10:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=ntWchsy5PaSlf4YLIgAYnsKcXpwQZlrOPuWQdzkA1bU=; b=RM/PEpzQUksPCem1P758hrQvNuWNSNJRX7T8XvPcNFBKaU4/6Fv44I8zFIUmrjaIpM rE1JQ4ZV6DRxEHwgfl4A0fYwREBGgKpwGavmWFMLB6+zr8j84ePdCyEtvS4qewONBNAG fFIG1aAzGqhoQ4Yv5z86u/aabfBW/IkzIiDDY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=R2gLVhqYTyG8M9/7jzfOrbkR3PRqrw6bB2Ymzzwnhw4Z162Yredbqu+BV+++41sP2y +aMy+eNtEeRqK+po4Si+1xsrf8Xwojot1EKrZnw9S5DQ+oLGvkg7abuKYTONh2SHHyAE nDgbh23tyNa3FSbd8AxQHbfWnYpkCYU81MiJs= MIME-Version: 1.0 Received: by 10.216.88.71 with SMTP id z49mr3261071wee.90.1263236252188; Mon, 11 Jan 2010 10:57:32 -0800 (PST) In-Reply-To: References: <61039b861001110544o2c352763q13dcf9d78a156714@mail.gmail.com> <61039b861001110842g15bb1f26jc50b6e6762e01427@mail.gmail.com> Date: Mon, 11 Jan 2010 13:57:31 -0500 Message-ID: <61039b861001111057t6443b526pdc312ff2717d6227@mail.gmail.com> Subject: Re: performance config help From: Bob Dusek To: Ivan Voras Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=0016e6dab0ec1448a2047ce81cec X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/204 X-Sequence-Number: 37084 --0016e6dab0ec1448a2047ce81cec Content-Type: text/plain; charset=ISO-8859-1 > >> RAID-0 >> > > And how many drives? > > Just two. We have an application server that is processing requests. Each request >> consists of a combination of selects, inserts, and deletes. We actually see >> degredation when we get more than 40 concurrent requests. The exact number >> of queries executed by each request isn't known. It varies per request. >> But, an example request would be about 16 inserts and 113 selects. Any >> given request can't execute more than a single query at a time. >> > > So, you are concurrently trying to achieve more than around 640 writes and > 4520 reads (worst case figures...). This should be interesting. For 40 > concurrent requests you will probably need at least 4 drives in RAID-0 to > sustain the write rates (and I'll guess 5-6 to be sure to cover read > requests also, together with plenty of RAM). > > avg-cpu: %user %nice %system %iowait %steal %idle >> 34.29 0.00 7.09 0.03 0.00 58.58 >> >> Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz >> avgqu-sz await svctm %util >> sda 0.00 112.20 0.00 133.40 0.00 1964.80 14.73 >> 0.42 3.17 0.04 0.48 >> >> The iowait seems pretty low, doesn't it? >> > > Yes, but you are issuing 133 write operations per seconds per drive(s) - > this is nearly the limit of what you can get with 15k RPM drives (actually, > the limit should be somewhere around 200..250 IOPS but 133 isn't that far). > > As you mentioned in a separate response, we have fsync shut off. Regardless, we shut off a lot of logging in our app and reduced that number to approx 20 per second. So, a lot of those writes were coming from outside the db. We do a lot of logging. We should consider turning some off, it seems. top - 10:11:43 up 12 days, 20:48, 6 users, load average: 10.48, 4.16, >> 2.83 >> Tasks: 798 total, 8 running, 790 sleeping, 0 stopped, 0 zombie >> Cpu0 : 33.3%us, 7.6%sy, 0.0%ni, 59.1%id, 0.0%wa, 0.0%hi, 0.0%si, >> 0.0%st >> > > There is one other possibility - since the CPUs are not very loaded, are > you sure the client application with which you are testing is fast enough to > issue enough request to saturate the database? > Each of the 256 requests was being processed by a php process. So, it could certainly be faster. But, the fact that we're seeing the db performance degrade would seem to indicate that our application is fast enough to punish the db. Isn't that true? > > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > --0016e6dab0ec1448a2047ce81cec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

RAID-0

And how many drives?

Just two.=

We have an applic= ation server that is processing requests. =A0Each request consists of a com= bination of selects, inserts, and deletes. =A0We actually see degredation w= hen we get more than 40 concurrent requests. =A0The exact number of queries= executed by each request isn't known. =A0It varies per request. =A0But= , an example request would be about 16 inserts and 113 selects. =A0Any give= n request can't execute more than a single query at a time. =A0

So, you are concurrently trying to achieve more than around 640 writes and = 4520 reads (worst case figures...). This should be interesting. For 40 conc= urrent requests you will probably need at least 4 drives in RAID-0 to susta= in the write rates (and I'll guess 5-6 to be sure to cover read request= s also, together with plenty of RAM).

=A0avg-cpu: =A0%user =A0 %nice %system %iowait =A0%steal =A0 %idle
=A0 =A0 =A0 =A0 =A034.29 =A0 =A00.00 =A0 =A07.09 =A0 =A00.03 =A0 =A00.00 = =A0 58.58

Device: =A0 =A0 =A0 =A0 rrqm/s =A0 wrqm/s =A0 r/s =A0 w/s =A0 rsec/s =A0 ws= ec/s avgrq-sz avgqu-sz =A0 await =A0svctm =A0%util
sda =A0 =A0 =A0 =A0 =A0 =A0 =A0 0.00 =A0 112.20 =A00.00 133.40 =A0 =A0 0.00= =A01964.80 =A0 =A014.73 =A0 =A0 0.42 =A0 =A03.17 =A0 0.04 =A0 0.48

The iowait seems pretty low, doesn't it?

Yes, but you are issuing 133 write operations per seconds per drive(s) - th= is is nearly the limit of what you can get with 15k RPM drives (actually, t= he limit should be somewhere around 200..250 IOPS but 133 isn't that fa= r).

=A0
As you mentioned in a separate re= sponse, we have fsync shut off.=A0 Regardless, we shut off a lot of logging= in our app and reduced that number to approx 20 per second.=A0 So, a lot o= f those writes were coming from outside the db.=A0 We do a lot of logging.= =A0 We should consider turning some off, it seems.


top - 10:11:43 up 12 days, 20:48, =A06 users, =A0load average: 10.48, 4.16,= 2.83
Tasks: 798 total, =A0 8 running, 790 sleeping, =A0 0 stopped, =A0 0 zombie<= br> Cpu0 =A0: 33.3%us, =A07.6%sy, =A00.0%ni, 59.1%id, =A00.0%wa, =A00.0%hi, =A0= 0.0%si, =A00.0%st

There is one other possibility - since the CPUs are not very loaded, are yo= u sure the client application with which you are testing is fast enough to = issue enough request to saturate the database?

Each of the 256 requests was being processed by a php process.=A0 So, it co= uld certainly be faster.=A0 But, the fact that we're seeing the db perf= ormance degrade would seem to indicate that our application is fast enough = to punish the db.=A0 Isn't that true?=A0

=A0


--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

--0016e6dab0ec1448a2047ce81cec--