How to speed up commits?

From: Lincoln Yeoh <lylyeoh(at)mecomb(dot)com>
To: <pgsql-general(at)HUB(dot)ORG>
Subject: How to speed up commits?
Date: 2000-04-03 06:51:39
Message-ID: 3.0.5.32.20000403145139.007adce0@pop.mecomb.po.my
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I was doing a few tests to optimize my perl web app, and this is what I got.

without database: 140 hits/sec
with a rollback/begin and a select: 90 hits/sec
with a rollback/begin, select and an update (but no commit): 70 hits/sec
with a rollback/begin, select + update + commit: 13 hits/sec

Any idea how to speed things up? Turning off sync would be dangerous right?

The minimum my web app does is:
1) rollback/begin
2) select session information
3) update session information (new session time out)
4) commit update

I written a simple script which does the same thing and the figures are the
same.

Any idea how to speed things up without switching to another database
engine or session control method? Or do I have to live with 13 hits/sec max?

)-;

Does MySQL turn off sync? I don't think it does, but it seems to be able to
do updates (and thus syncs) a lot faster. I know postgresql has got
transactions and all that, but from the "time" statistics, the CPU isn't
really being pushed, so if it's not sync what's it waiting for?

(benchmark does 100 sets of the four steps).

time ./benchmark
0.26user 0.02system 0:07.65elapsed 3%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (295major+221minor)pagefaults 0swaps

Whereas if I remove the commit:

time ./benchmark
0.21user 0.02system 0:01.57elapsed 14%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (294major+223minor)pagefaults 0swaps

Any suggestions welcome!

Cheerio,
Link.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Richards 2000-04-03 07:52:53 Re: How to speed up commits?
Previous Message Jeff MacDonald 2000-04-03 03:17:51 sql92