Unix Technical Forum

strange performance regression between 7.4 and 8.1

This is a discussion on strange performance regression between 7.4 and 8.1 within the Pgsql Performance forums, part of the PostgreSQL category; --> Hello, I have noticed a strange performance regression and I'm at a loss as to what's happening. We have ...


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:20 AM
Alex Deucher
 
Posts: n/a
Default strange performance regression between 7.4 and 8.1

Hello,

I have noticed a strange performance regression and I'm at a loss as
to what's happening. We have a fairly large database (~16 GB). The
original postgres 7.4 was running on a sun v880 with 4 CPUs and 8 GB
of ram running Solaris on local scsi discs. The new server is a sun
Opteron box with 4 cores, 8 GB of ram running postgres 8.1.4 on Linux
(AMD64) on a 4 Gbps FC SAN volume. When we created the new database
it was created from scratch rather than copying over the old one,
however the table structure is almost identical (UTF8 on the new one
vs. C on the old). The problem is queries are ~10x slower on the new
hardware. I read several places that the SAN might be to blame, but
testing with bonnie and dd indicates that the SAN is actually almost
twice as fast as the scsi discs in the old sun server. I've tried
adjusting just about every option in the postgres config file, but
performance remains the same. Any ideas?

Thanks,

Alex

---------------------------(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
  #2 (permalink)  
Old 04-19-2008, 09:20 AM
Guido Neitzer
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

On 01.03.2007, at 13:40, Alex Deucher wrote:

> I read several places that the SAN might be to blame, but
> testing with bonnie and dd indicates that the SAN is actually almost
> twice as fast as the scsi discs in the old sun server. I've tried
> adjusting just about every option in the postgres config file, but
> performance remains the same. Any ideas?


As mentioned last week:

Did you actually try to use the local drives for speed testing? It
might be that the SAN introduces latency especially for random access
you don't see on local drives.

cug

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 09:20 AM
Alex Deucher
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

On 3/5/07, Guido Neitzer <lists@event-s.net> wrote:
> On 01.03.2007, at 13:40, Alex Deucher wrote:
>
> > I read several places that the SAN might be to blame, but
> > testing with bonnie and dd indicates that the SAN is actually almost
> > twice as fast as the scsi discs in the old sun server. I've tried
> > adjusting just about every option in the postgres config file, but
> > performance remains the same. Any ideas?

>
> As mentioned last week:
>
> Did you actually try to use the local drives for speed testing? It
> might be that the SAN introduces latency especially for random access
> you don't see on local drives.


Yes, I started setting that up this afternoon. I'm going to test that
tomorrow and post the results.

Alex

>
> cug
>


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 09:20 AM
Guido Neitzer
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

On 05.03.2007, at 19:56, Alex Deucher wrote:

> Yes, I started setting that up this afternoon. I'm going to test that
> tomorrow and post the results.


Good - that may or may not give some insight in the actual
bottleneck. You never know but it seems to be one of the easiest to
find out ...

cug

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 09:21 AM
Alex Deucher
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

On 3/5/07, Guido Neitzer <lists@event-s.net> wrote:
> On 05.03.2007, at 19:56, Alex Deucher wrote:
>
> > Yes, I started setting that up this afternoon. I'm going to test that
> > tomorrow and post the results.

>
> Good - that may or may not give some insight in the actual
> bottleneck. You never know but it seems to be one of the easiest to
> find out ...
>


Well, the SAN appears to be the limiting factor. I set up the DB on
the local scsi discs (software RAID 1) and performance is excellent
(better than the old server). Thanks for everyone's help.

Alex

---------------------------(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
  #6 (permalink)  
Old 04-19-2008, 09:21 AM
Ron
 
Posts: n/a
Default Re: strange performance regression between 7.4 and8.1

At 10:25 AM 3/6/2007, Alex Deucher wrote:
>On 3/5/07, Guido Neitzer <lists@event-s.net> wrote:
>>On 05.03.2007, at 19:56, Alex Deucher wrote:
>>
>> > Yes, I started setting that up this afternoon. I'm going to test that
>> > tomorrow and post the results.

>>
>>Good - that may or may not give some insight in the actual
>>bottleneck. You never know but it seems to be one of the easiest to
>>find out ...

>
>Well, the SAN appears to be the limiting factor. I set up the DB on
>the local scsi discs (software RAID 1) and performance is excellent
>(better than the old server). Thanks for everyone's help.
>
>Alex


What kind of SAN is it and how many + what kind of HDs are in it?
Assuming the answers are reasonable...

Profile the table IO pattern your workload generates and start
allocating RAID sets to tables or groups of tables based on IO pattern.

For any table or group of tables that has a significant level of
write IO, say >= ~25% of the IO mix, try RAID 5 or 6 first, but be
prepared to go RAID 10 if performance is not acceptable.

Don't believe any of the standard "lore" regarding what tables to put
where or what tables to give dedicated spindles to.
Profile, benchmark, and only then start allocating dedicated resources.
For instance, I've seen situations where putting pg_xlog on its own
spindles was !not! the right thing to do.

Best Wishes,
Ron Peacetree


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-19-2008, 09:21 AM
Alex Deucher
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

On 3/6/07, Ron <rjpeace@earthlink.net> wrote:
> At 10:25 AM 3/6/2007, Alex Deucher wrote:
> >On 3/5/07, Guido Neitzer <lists@event-s.net> wrote:
> >>On 05.03.2007, at 19:56, Alex Deucher wrote:
> >>
> >> > Yes, I started setting that up this afternoon. I'm going to test that
> >> > tomorrow and post the results.
> >>
> >>Good - that may or may not give some insight in the actual
> >>bottleneck. You never know but it seems to be one of the easiest to
> >>find out ...

> >
> >Well, the SAN appears to be the limiting factor. I set up the DB on
> >the local scsi discs (software RAID 1) and performance is excellent
> >(better than the old server). Thanks for everyone's help.
> >
> >Alex

>
> What kind of SAN is it and how many + what kind of HDs are in it?
> Assuming the answers are reasonable...
>


It's a Hitachi WMS/Tagmastore. 105 hitachi SATA drives; 4 Gbps FC.

> Profile the table IO pattern your workload generates and start
> allocating RAID sets to tables or groups of tables based on IO pattern.
>
> For any table or group of tables that has a significant level of
> write IO, say >= ~25% of the IO mix, try RAID 5 or 6 first, but be
> prepared to go RAID 10 if performance is not acceptable.
>


Right now it's designed for max capacity: big RAID 5 groups. I expect
I'll probably need RAID 10 for decent performance.

> Don't believe any of the standard "lore" regarding what tables to put
> where or what tables to give dedicated spindles to.
> Profile, benchmark, and only then start allocating dedicated resources.
> For instance, I've seen situations where putting pg_xlog on its own
> spindles was !not! the right thing to do.
>


Right. Thanks for the advice. I'll post my results when I get around
to testing some new SAN configurations.

Alex

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-19-2008, 09:21 AM
Rodrigo Madera
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

I would just like to note here that this is an example of inefficient
strategy.

We could all agree (up to a certain economical point) that Alex saved the
most expensive one thousand dollars of his life.

I don't know the financial status nor the size of your organization, but I'm
sure that you have selected the path that has cost you more.

In the future, an investment on memory for a (let's say) rather small
database should be your first attempt.

Yours,
Rodrigo Madera

On 3/6/07, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On 3/6/07, Ron <rjpeace@earthlink.net> wrote:
> > At 10:25 AM 3/6/2007, Alex Deucher wrote:
> > >On 3/5/07, Guido Neitzer <lists@event-s.net> wrote:
> > >>On 05.03.2007, at 19:56, Alex Deucher wrote:
> > >>
> > >> > Yes, I started setting that up this afternoon. I'm going to test

> that
> > >> > tomorrow and post the results.
> > >>
> > >>Good - that may or may not give some insight in the actual
> > >>bottleneck. You never know but it seems to be one of the easiest to
> > >>find out ...
> > >
> > >Well, the SAN appears to be the limiting factor. I set up the DB on
> > >the local scsi discs (software RAID 1) and performance is excellent
> > >(better than the old server). Thanks for everyone's help.
> > >
> > >Alex

> >
> > What kind of SAN is it and how many + what kind of HDs are in it?
> > Assuming the answers are reasonable...
> >

>
> It's a Hitachi WMS/Tagmastore. 105 hitachi SATA drives; 4 Gbps FC.
>
> > Profile the table IO pattern your workload generates and start
> > allocating RAID sets to tables or groups of tables based on IO pattern.
> >
> > For any table or group of tables that has a significant level of
> > write IO, say >= ~25% of the IO mix, try RAID 5 or 6 first, but be
> > prepared to go RAID 10 if performance is not acceptable.
> >

>
> Right now it's designed for max capacity: big RAID 5 groups. I expect
> I'll probably need RAID 10 for decent performance.
>
> > Don't believe any of the standard "lore" regarding what tables to put
> > where or what tables to give dedicated spindles to.
> > Profile, benchmark, and only then start allocating dedicated resources.
> > For instance, I've seen situations where putting pg_xlog on its own
> > spindles was !not! the right thing to do.
> >

>
> Right. Thanks for the advice. I'll post my results when I get around
> to testing some new SAN configurations.
>
> Alex
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-19-2008, 09:21 AM
Craig A. James
 
Posts: n/a
Default Re: strange performance regression between 7.4 and 8.1

Rodrigo Madera wrote:
> I would just like to note here that this is an example of inefficient
> strategy.
>
> We could all agree (up to a certain economical point) that Alex saved
> the most expensive one thousand dollars of his life.
>
> I don't know the financial status nor the size of your organization, but
> I'm sure that you have selected the path that has cost you more.
>
> In the future, an investment on memory for a (let's say) rather small
> database should be your first attempt.


Alex may have made the correct, rational choice, given the state of accounting at most corporations. Corporate accounting practices and the budgetary process give different weights to cash and labor. Labor is fixed, and can be grossly wasted without (apparently) affecting the quarterly bottom line. Cash expenditures come directly off profits.

It's shortsighted and irrational, but nearly 100% of corporations operate this way. You can waste a week of your time and nobody complains, but spend a thousand dollars, and the company president is breathing down your neck.

When we answer a question on this forum, we need to understand that the person who needs help may be under irrational, but real, constraints, and offer appropriate advice. Sure, it's good to fight corporate stupidity, but sometimes you just want to get the system back online.

Craig

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-19-2008, 09:22 AM
Ron
 
Posts: n/a
Default Re: strange performance regression between 7.4 and8.1

At 01:34 PM 3/8/2007, Craig A. James wrote:
>Rodrigo Madera wrote:
>>I would just like to note here that this is an example of
>>inefficient strategy.
>>We could all agree (up to a certain economical point) that Alex
>>saved the most expensive one thousand dollars of his life.
>>I don't know the financial status nor the size of your
>>organization, but I'm sure that you have selected the path that has
>>cost you more.
>>In the future, an investment on memory for a (let's say) rather
>>small database should be your first attempt.

>
>Alex may have made the correct, rational choice, given the state of
>accounting at most corporations. Corporate accounting practices and
>the budgetary process give different weights to cash and
>labor. Labor is fixed, and can be grossly wasted without
>(apparently) affecting the quarterly bottom line. Cash expenditures
>come directly off profits.
>
>It's shortsighted and irrational, but nearly 100% of corporations
>operate this way. You can waste a week of your time and nobody
>complains, but spend a thousand dollars, and the company president
>is breathing down your neck.
>
>When we answer a question on this forum, we need to understand that
>the person who needs help may be under irrational, but real,
>constraints, and offer appropriate advice. Sure, it's good to fight
>corporate stupidity, but sometimes you just want to get the system back online.
>
>Craig

All good points.

However, when we allow or help (even tacitly by "looking the other
way") our organizations to waste IT dollars we increase the risk that
we are going to be paid less because there's less money. Or even
that we will be unemployed because there's less money (as in "we
wasted enough money we went out of business").

The correct strategy is to Speak Their Language (tm) to the
accounting and management folks and give them the information needed
to Do The Right Thing (tm) (or at least authorize you doing it ;-)
). They may still not be / act sane, but at that point your hands are clean.
(...and if your organization has a habit of Not Listening to Reason
(tm), strongly consider finding a new job before you are forced to by
their fiscal or managerial irresponsibility.)

Cap Ex may not be the same as Discretionary Expenses, but at the end
of the day dollars are dollars.
Any we spend in one place can't be spent in any other place; and
there's a finite pile of them.

Spending 10x as much in labor and opportunity costs (you can only do
one thing at a time...) as you would on CapEx to address a problem is
simply not smart money management nor good business. Even spending
2x as much in that fashion is probably not.

Cheers,
Ron Peacetree






---------------------------(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 09:27 PM.


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