Re: Perf decreased although server is better

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Perf decreased although server is better
Date: 2016-11-02 14:36:25
Message-ID: c5f9b7ad-2773-7334-b37f-b40d23d24998@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 11/02/2016 02:26 PM, Benjamin Toueg wrote:
> Hi everyone,
>
> I'm facing a peformance decrease after switching to a more performant
> VPS :
> http://serverfault.com/questions/812702/posgres-perf-decreased-although-server-is-better
>

Well, changing so many things at once (CPU, RAM, storage, Ubuntu
version, probably kernel version, PostgreSQL version) is a bad idea,
exactly because it makes investigating regressions more complicated.

> My questions are:
>
> 1. What benchmark should I perform before switching to a new server?

Three types of benchmarks, in this order:

1) system-level benchmarks to test various resources (fio to test disks,
etc.)

2) general-purpose PostgreSQL benchmarks (regular pgbench, ...)

3) application-specific benchmarks, or at least pgbench with templates
that match your workload somewhat better than the default one

Start with (1), compare results between machines, if it's OK start with
(2) and so on.

> 2. What's your rule of thumb regarding my specific issue? What should
> be investigated first?
>

There's a bottleneck somewhere. You need to identify which resource is
it and why, until then it's just wild guessing. Try measuring how long
the requests take at different points - at the app server, at the
database, etc. That will tell you whether it's a database issue, a
network issue etc. If the queries take longer on the database, use
something like perf to profile the system.

ISTM it's not a disk issue (at least the chart shows minimum usage). But
you're doing ~400tps, returning ~5M rows per second.

Also, if it turns out to be a database issue, more info about config and
data set would be useful.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2016-11-02 14:38:44 Re: Perf decreased although server is better
Previous Message Benjamin Toueg 2016-11-02 13:26:43 Perf decreased although server is better