Unix Technical Forum

Worsening performance with 7.4 on flash-based system

This is a discussion on Worsening performance with 7.4 on flash-based system within the Pgsql Performance forums, part of the PostgreSQL category; --> We are experiencing gradually worsening performance in PostgreSQL 7.4.7, on a system with the following specs: Linux OS (Fedora ...


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, 07:37 AM
Greg Stumph
 
Posts: n/a
Default Worsening performance with 7.4 on flash-based system

We are experiencing gradually worsening performance in PostgreSQL 7.4.7, on
a system with the following specs:
Linux OS (Fedora Core 1, 2.4 kernal)
Flash file system (2 Gig, about 80% full)
256 Meg RAM
566 MHz Celeron CPU

We use Orbit 2.9.8 to access PostGres. The database contains 62 tables.

When the system is running with a fresh copy of the database, performance is
fine. At its worst, we are seeing fairly simple SELECT queries taking up to
1 second to execute. When these queries are run in a loop, the loop can take
up to 30 seconds to execute, instead of the 2 seconds or so that we would
expect.

VACUUM FULL ANALYZE helps, but doesn't seem to eliminate the problem.

The following table show average execution time in "bad" performance mode in
the first column, execution time after VACUUM ANALYZE in the second column,
and % improvement (or degradation?) in the third. The fourth column show the
query that was executed.

741.831|582.038|-21.5| ^IDECLARE table_cursor
170.065|73.032|-57.1| FETCH ALL in table_cursor
41.953|45.513|8.5| CLOSE table_cursor
61.504|47.374|-23.0| SELECT last_value FROM pm_id_seq
39.651|46.454|17.2| select id from la_looprunner
1202.170|265.316|-77.9| select id from rt_tran
700.669|660.746|-5.7| ^IDECLARE my_tran_load_cursor
1192.182|47.258|-96.0| FETCH ALL in my_tran_load_cursor
181.934|89.752|-50.7| CLOSE my_tran_load_cursor
487.285|873.474|79.3| ^IDECLARE my_get_router_cursor
51.543|69.950|35.7| FETCH ALL in my_get_router_cursor
48.312|74.061|53.3| CLOSE my_get_router_cursor
814.051|1016.219|24.8| SELECT $1 = 'INSERT'
57.452|78.863|37.3| select id from op_sched
48.010|117.409|144.6| select short_name, long_name from la_loopapp
54.425|58.352|7.2| select id from cd_range
45.289|52.330|15.5| SELECT last_value FROM rt_tran_id_seq
39.658|82.949|109.2| SELECT last_value FROM op_sched_id_seq
42.158|68.189|61.7| select card_id,router_id from rt_valid


Has anyone else seen gradual performance degradation like this? Would
upgrading to Postgres 8 help? Any other thoughts on directions for
troubleshooting this?

Thanks...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 07:41 AM
Greg Stumph
 
Posts: n/a
Default Re: Worsening performance with 7.4 on flash-based system

Well, since I got no response at all to this message, I can only assume that
I've asked the question in an insufficient way, or else that no one has
anything to offer on our problem.

This was my first post to the list, so if there's a better way I should be
asking this, or different data I should provide, hopefully someone will let
me know...

Thanks,
Greg

"Greg Stumph" <gregstumph@comcast.net> wrote in message
news:e2b80f$245o$1@news.hub.org...
> We are experiencing gradually worsening performance in PostgreSQL 7.4.7,
> on a system with the following specs:
> Linux OS (Fedora Core 1, 2.4 kernal)
> Flash file system (2 Gig, about 80% full)
> 256 Meg RAM
> 566 MHz Celeron CPU
>
> We use Orbit 2.9.8 to access PostGres. The database contains 62 tables.
>
> When the system is running with a fresh copy of the database, performance
> is fine. At its worst, we are seeing fairly simple SELECT queries taking
> up to 1 second to execute. When these queries are run in a loop, the loop
> can take up to 30 seconds to execute, instead of the 2 seconds or so that
> we would expect.
>
> VACUUM FULL ANALYZE helps, but doesn't seem to eliminate the problem.
>
> The following table show average execution time in "bad" performance mode
> in the first column, execution time after VACUUM ANALYZE in the second
> column, and % improvement (or degradation?) in the third. The fourth
> column show the query that was executed.
>
> 741.831|582.038|-21.5| ^IDECLARE table_cursor
> 170.065|73.032|-57.1| FETCH ALL in table_cursor
> 41.953|45.513|8.5| CLOSE table_cursor
> 61.504|47.374|-23.0| SELECT last_value FROM pm_id_seq
> 39.651|46.454|17.2| select id from la_looprunner
> 1202.170|265.316|-77.9| select id from rt_tran
> 700.669|660.746|-5.7| ^IDECLARE my_tran_load_cursor
> 1192.182|47.258|-96.0| FETCH ALL in my_tran_load_cursor
> 181.934|89.752|-50.7| CLOSE my_tran_load_cursor
> 487.285|873.474|79.3| ^IDECLARE my_get_router_cursor
> 51.543|69.950|35.7| FETCH ALL in my_get_router_cursor
> 48.312|74.061|53.3| CLOSE my_get_router_cursor
> 814.051|1016.219|24.8| SELECT $1 = 'INSERT'
> 57.452|78.863|37.3| select id from op_sched
> 48.010|117.409|144.6| select short_name, long_name from la_loopapp
> 54.425|58.352|7.2| select id from cd_range
> 45.289|52.330|15.5| SELECT last_value FROM rt_tran_id_seq
> 39.658|82.949|109.2| SELECT last_value FROM op_sched_id_seq
> 42.158|68.189|61.7| select card_id,router_id from rt_valid
>
>
> Has anyone else seen gradual performance degradation like this? Would
> upgrading to Postgres 8 help? Any other thoughts on directions for
> troubleshooting this?
>
> Thanks...
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 07:41 AM
William Yu
 
Posts: n/a
Default Re: Worsening performance with 7.4 on flash-based system

Usually when simple queries take a long time to run, it's the system
tables (pg_*) that have become bloated and need vacuuming. But that's
just random guess on my part w/o my detailed info.


Greg Stumph wrote:
> Well, since I got no response at all to this message, I can only assume that
> I've asked the question in an insufficient way, or else that no one has
> anything to offer on our problem.
>
> This was my first post to the list, so if there's a better way I should be
> asking this, or different data I should provide, hopefully someone will let
> me know...
>
> Thanks,
> Greg
>
> "Greg Stumph" <gregstumph@comcast.net> wrote in message
> news:e2b80f$245o$1@news.hub.org...
>> We are experiencing gradually worsening performance in PostgreSQL 7.4.7,
>> on a system with the following specs:
>> Linux OS (Fedora Core 1, 2.4 kernal)
>> Flash file system (2 Gig, about 80% full)
>> 256 Meg RAM
>> 566 MHz Celeron CPU
>>
>> We use Orbit 2.9.8 to access PostGres. The database contains 62 tables.
>>
>> When the system is running with a fresh copy of the database, performance
>> is fine. At its worst, we are seeing fairly simple SELECT queries taking
>> up to 1 second to execute. When these queries are run in a loop, the loop
>> can take up to 30 seconds to execute, instead of the 2 seconds or so that
>> we would expect.
>>
>> VACUUM FULL ANALYZE helps, but doesn't seem to eliminate the problem.
>>
>> The following table show average execution time in "bad" performance mode
>> in the first column, execution time after VACUUM ANALYZE in the second
>> column, and % improvement (or degradation?) in the third. The fourth
>> column show the query that was executed.
>>
>> 741.831|582.038|-21.5| ^IDECLARE table_cursor
>> 170.065|73.032|-57.1| FETCH ALL in table_cursor
>> 41.953|45.513|8.5| CLOSE table_cursor
>> 61.504|47.374|-23.0| SELECT last_value FROM pm_id_seq
>> 39.651|46.454|17.2| select id from la_looprunner
>> 1202.170|265.316|-77.9| select id from rt_tran
>> 700.669|660.746|-5.7| ^IDECLARE my_tran_load_cursor
>> 1192.182|47.258|-96.0| FETCH ALL in my_tran_load_cursor
>> 181.934|89.752|-50.7| CLOSE my_tran_load_cursor
>> 487.285|873.474|79.3| ^IDECLARE my_get_router_cursor
>> 51.543|69.950|35.7| FETCH ALL in my_get_router_cursor
>> 48.312|74.061|53.3| CLOSE my_get_router_cursor
>> 814.051|1016.219|24.8| SELECT $1 = 'INSERT'
>> 57.452|78.863|37.3| select id from op_sched
>> 48.010|117.409|144.6| select short_name, long_name from la_loopapp
>> 54.425|58.352|7.2| select id from cd_range
>> 45.289|52.330|15.5| SELECT last_value FROM rt_tran_id_seq
>> 39.658|82.949|109.2| SELECT last_value FROM op_sched_id_seq
>> 42.158|68.189|61.7| select card_id,router_id from rt_valid
>>
>>
>> Has anyone else seen gradual performance degradation like this? Would
>> upgrading to Postgres 8 help? Any other thoughts on directions for
>> troubleshooting this?
>>
>> Thanks...
>>

>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 07:41 AM
chris smith
 
Posts: n/a
Default Re: Worsening performance with 7.4 on flash-based system

On 4/29/06, Greg Stumph <gregstumph@comcast.net> wrote:
> Well, since I got no response at all to this message, I can only assume that
> I've asked the question in an insufficient way, or else that no one has
> anything to offer on our problem.
>
> This was my first post to the list, so if there's a better way I should be
> asking this, or different data I should provide, hopefully someone will let
> me know...
>
> Thanks,
> Greg
>
> "Greg Stumph" <gregstumph@comcast.net> wrote in message
> news:e2b80f$245o$1@news.hub.org...
> > We are experiencing gradually worsening performance in PostgreSQL 7.4.7,
> > on a system with the following specs:
> > Linux OS (Fedora Core 1, 2.4 kernal)
> > Flash file system (2 Gig, about 80% full)
> > 256 Meg RAM
> > 566 MHz Celeron CPU
> >
> > We use Orbit 2.9.8 to access PostGres. The database contains 62 tables.
> >
> > When the system is running with a fresh copy of the database, performance
> > is fine. At its worst, we are seeing fairly simple SELECT queries taking
> > up to 1 second to execute. When these queries are run in a loop, the loop
> > can take up to 30 seconds to execute, instead of the 2 seconds or so that
> > we would expect.


If you're inserting/updating/deleting a table or tables heavily, then
you'll need to vacuum it a lot more often than a reasonably static
table. Are you running contrib/autovacuum at all? PG 8.0 and above
have autovacuum built in but 7.4.x needs to run the contrib version.

PS - the latest 7.4 version is .12 - see
http://www.postgresql.org/docs/7.4/i...e/release.html for what
has changed (won't be much in performance terms but may fix data-loss
bugs).

--
Postgresql & php tutorials
http://www.designmagick.com/

---------------------------(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
  #5 (permalink)  
Old 04-19-2008, 07:42 AM
Scott Marlowe
 
Posts: n/a
Default Re: Worsening performance with 7.4 on flash-based system

On Fri, 2006-04-28 at 13:36, Greg Stumph wrote:
> Well, since I got no response at all to this message, I can only assume that
> I've asked the question in an insufficient way, or else that no one has
> anything to offer on our problem.
>
> This was my first post to the list, so if there's a better way I should be
> asking this, or different data I should provide, hopefully someone will let
> me know...


I'd pick one particular case and do explain analyze on it both right
after a reload, after running for a while, and after a vacuum analyze.

Also, do a vacuum verbose on the database and post the output of that
when the system's slowed down.

Do you make a lot of temp tables? Run a lot of DDL? I don't think we
have enough information to make a real informed decision, but I'm not
sure what questions to ask to find out where the bottleneck is...

Also, this could be the flash controller / card combo causing problems.
Do you start with a freshly formatted card at the beginning? I know
that flash controllers randomize the part of the card that gets written
to so that you don't kill one part of it early due to writing on just on
part. Could be that as the controller maps the card behind the scenes,
the access gets slower on the lower level, and there's nothing
PostgreSQL can do about it.

Can you tell us what your usage patterns are in a bit more detail?

---------------------------(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
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 03:22 PM.


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