Re: Sudden Query slowdown on our Postgresql Server

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Sebastian Melchior <webmaster(at)mailz(dot)de>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Sudden Query slowdown on our Postgresql Server
Date: 2012-05-08 16:17:55
Message-ID: CA+TgmoY32Oc38_z7fAnQOoYdyj2Ek4Fpfw5R=nEmM=muHkeOrA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Mar 23, 2012 at 3:52 AM, Sebastian Melchior <webmaster(at)mailz(dot)de> wrote:
> unfortunately we cannot directly control the TRIM (i am not sure it even occurs) because the SSDs are behind an LSI MegaSAS 9260 Controller which does not allow access via smart. Even if some kind of TRIM command is the problem, shouldn't the iowait go up in this case?

Based on my recent benchmarking experiences, maybe not. Suppose
backend A takes a lock and then blocks on an I/O. Then, all the other
backends block waiting on the lock. So maybe one backend is stuck in
I/O-wait, but on a multi-processor system the percentages are averaged
across all CPUs, so it doesn't really look like there's much I/O-wait.
If you have 'perf' available, I've found the following quite helpful:

perf record -e cs -g -a sleep 30
perf report -g

Then you can look at the report and find out what's causing PostgreSQL
to context-switch out - i.e. block - and therefore find out what lock
and call path is contended. LWLocks don't show up in pg_locks, so you
can't troubleshoot this sort of contention that way.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Klemme 2012-05-09 07:11:42 Re: scale up (postgresql vs mssql)
Previous Message Robert Klemme 2012-05-08 09:54:59 Re: Result Set over Network Question