Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1wgE-0006XW-Np for pgsql-performance@arkaria.postgresql.org; Wed, 02 Nov 2016 14:38:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c1wgE-0000xy-Ae for pgsql-performance@arkaria.postgresql.org; Wed, 02 Nov 2016 14:38:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1weY-0007ZP-KR for pgsql-performance@postgresql.org; Wed, 02 Nov 2016 14:36:34 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1c1weV-0005ed-Fz for pgsql-performance@postgresql.org; Wed, 02 Nov 2016 14:36:33 +0000 Received: by mail-wm0-x236.google.com with SMTP id p190so272853325wmp.1 for ; Wed, 02 Nov 2016 07:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=edDkkhS+yTEO3alZU7pQ93oaRbvY/2Qjlo2GQDEVNTk=; b=P6AZ9tPL7Ml2Av9+nFqTtXpFMenaqSFz6GxbGPafc5UQdCiRS1xn0/iblLOU+537dZ mLh/jF5WzijbTbgSPXiBvmU2eQCfhZ9EWP9xZBdat9MAHvv9tyoKctYa8odKYP1kCrgG DJk4VytNMwFt3bEpuHc5G9InzCrCTJ7+a2VXzylNZ4lfVt9AOnQa2Lf0AvOlZFVejndP Bas3cNW3qCRPQZ5PUR1jBLBYFRoCttgmO5xR0jF9lRX88skY9wN4tbaLUvppY0wRP2am reuPQYRl9ZVzj2lSOtRGoRU9Vx1d3jHIvNldEkFpqSjYYzIlqRvHVjc2hSz5WYAX+K0s 6ZeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=edDkkhS+yTEO3alZU7pQ93oaRbvY/2Qjlo2GQDEVNTk=; b=EtpjYysOYI346aGOgA3Xjv2Rr870nU0nBDPdyyShVJqJcH3/MTtUkeP/j5Pmu+cg8h XR0E9TatafuvDhXOPYpXc+J2d1PQwZrVa0KrH1C7qpzfijSvh9BpNdrw/Cuq+nBWbGWW 9Tg3AYorG6ZYx3IvpWkIFvBH+bLTLnDn3L1fP5a39WPhnTnimK/tRLoS4WRxq1VGQP9N WumeNxVtrbuBcqijBB/Q8jTz/0MS+H5PgzWEIDJPcnEUBARxyCs7lGy8ssmxKLdScDA6 6CbLuxFf3coLLQi9qumnEzqZ5l8vl05WhbzpOhWW5XGi443peMLdy5REmHItNRd9L4Z2 R/8w== X-Gm-Message-State: ABUngveKUjTWJroj8Kdxvno/A/D9XJYJfal+obPtOLpDSoNP7Mhqyg5YEIHgBt8dsw8SQCCtfQyq6Qq530L0OIRX4FqqJwmi33d/GcNFToSx2Eq5iUIM+vOVxnbzJUujwq89LI3CX+KKZzaJBvkS9R2eh17/HRie0ZCsU+JgABYuc7M/glAdoA4Lpf9NeNZjTPnxtIITSk8BLff9Fw== X-Received: by 10.28.8.202 with SMTP id 193mr3129066wmi.101.1478097389217; Wed, 02 Nov 2016 07:36:29 -0700 (PDT) Received: from [10.137.2.17] (ip-89-177-44-58.net.upcbroadband.cz. [89.177.44.58]) by smtp.gmail.com with ESMTPSA id w203sm36635544wmw.16.2016.11.02.07.36.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 07:36:28 -0700 (PDT) Subject: Re: Perf decreased although server is better To: pgsql-performance@postgresql.org References: From: Tomas Vondra Message-ID: Date: Wed, 2 Nov 2016 15:36:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Thunderbird/46.0a2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance