| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Harshad <harshad(dot)rj(at)gmail(dot)com> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: Reason for PG being seemingly I/O bound? |
| Date: | 2009-09-13 19:15:27 |
| Message-ID: | 8970.1252869327@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
Harshad <harshad(dot)rj(at)gmail(dot)com> writes:
> I am trying to figure out why a very simple query turns out to be I/O
> bound.
It's hard to see how that case could be I/O bound, unless your machine
is seriously starved for memory. Did you watch "vmstat 1" or something
similar to confirm that a lot of I/O is really happening?
> I have put this query in simple.sql, and running it in a tight loop in the shell thusly:
> while [ true ] ; do psql -d twinkle -U postgres -f simple.sql; done > /dev/null
FWIW, the overhead of the above is just enormous --- starting up a new
database connection takes way more time than issuing one simple query.
However I still don't see how it would be I/O bound; the kernel
certainly ought to have everything needed in disk cache after a couple
of cycles. On my machine a similar test immediately pins the CPU
with about half user, half system time.
What platform are you using, exactly?
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sean Davis | 2009-09-14 01:42:47 | Re: using SQL for multi-machine job management? |
| Previous Message | manaus | 2009-09-13 17:38:19 | qualified names |