Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 279A6185C946 for ; Sat, 14 Jul 2012 05:49:21 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Spy2Q-0008HE-6Z for pgsql-performance@postgresql.org; Sat, 14 Jul 2012 08:49:20 +0000 Received: by pbbrp8 with SMTP id rp8so6857809pbb.19 for ; Sat, 14 Jul 2012 01:49:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=t2xOsFnR7UNq1+pKgJ9nd8rMB8NUXTLOA0L9vhXKwwA=; b=Vhnov5LRuFn5DaaKOxT++8w9cBqMNEKhmZUGXg6zWTOOu9j6IAB0Sq0NXmloyKM52l uGaiZt5q7S163Zmq95A8c5yZKkbQrPs86ZhG+kIjY8QznyUWsyJYa5bGsGiklZCsFHlk ubiXjdGPquRZHik14yjXMuajnAz7knbHBeS6UJOPOjADdsD8NzzBrrKDvcrL4WKNkOXc QBoCsIpCeVks3f2/pPi2Gzud0SxbS7oHHEDpAMR9C+PV02510Bt6VPY9V6Lr0OWxGxND pj9WHeFy9F2rMnIr6u9R9VfId1IC6/VesDV5TLY6Nv7UUfow1MRpEWyMde8uQVh6KNuz lxyw== Received: by 10.66.83.33 with SMTP id n1mr7985889pay.7.1342255742988; Sat, 14 Jul 2012 01:49:02 -0700 (PDT) Received: from ayaki.localdomain (58-7-231-93.dyn.iinet.net.au. [58.7.231.93]) by mx.google.com with ESMTPS id tj4sm7698770pbc.33.2012.07.14.01.48.59 (version=SSLv3 cipher=OTHER); Sat, 14 Jul 2012 01:49:02 -0700 (PDT) Message-ID: <50013279.4090407@ringerc.id.au> Date: Sat, 14 Jul 2012 16:48:57 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: B Sreejith CC: Robert Klemme , pgsql-performance@postgresql.org, "sreejith. balakrishnan" Subject: Re: Any tool/script available which can be used to measure scalability of an application's database. References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------050700070405040603070904" X-Gm-Message-State: ALoCoQnK7T6+zyFfr6zVKboUxwOf3oQB0oG7Ka1iSGVF14ElZ7MkmrJGrj5Eg2OgqD2Lss8zbUYe X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/184 X-Sequence-Number: 47365 This is a multi-part message in MIME format. --------------050700070405040603070904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/14/2012 09:26 AM, B Sreejith wrote: > > Dear Robert, > > We need to scale up both size and load. > Could you please provide steps I need to follow. > For load, first you need to build a representative sample of your application's querying patterns by logging queries and analysing the logs. Produce a load generator based on that data, set up a test copy of your database, and start pushing the query rate up to see what happens. For simpler loads you can write a transaction script for pgbench based on your queries. For size: Copy your data set, then start duplicating it with munged copies. Repeat, then use the load generator you wrote for the first part to see how scaling the data up affects your queries. See if anything is unacceptably slow (the "auto_explain" module is useful here) and examine it. The truth is that predicting how complex database driven apps will scale is insanely hard, because access patterns change as data sizes and user counts grow. You're likely to land up tuning for a scenario that's quite different to the one that you actually face when you start hitting scaling limitations. This doesn't mean you should not investigate, it just means your trials don't prove anything and the optimisations you make based on what you learn may not gain you much. -- Craig Ringer --------------050700070405040603070904 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 07/14/2012 09:26 AM, B Sreejith wrote:

Dear Robert,

We need to scale up both size and load.
Could you please provide steps I need to follow.


For load, first you need to build a representative sample of your application's querying patterns by logging queries and analysing the logs. Produce a load generator based on that data, set up a test copy of your database, and start pushing the query rate up to see what happens.

For simpler loads you can write a transaction script for pgbench based on your queries.

For size: Copy your data set, then start duplicating it with munged copies. Repeat, then use the load generator you wrote for the first part to see how scaling the data up affects your queries. See if anything is unacceptably slow (the "auto_explain" module is useful here) and examine it.

The truth is that predicting how complex database driven apps will scale is insanely hard, because access patterns change as data sizes and user counts grow. You're likely to land up tuning for a scenario that's quite different to the one that you actually face when you start hitting scaling limitations. This doesn't mean you should not investigate, it just means your trials don't prove anything and the optimisations you make based on what you learn may not gain you much.

--
Craig Ringer
--------------050700070405040603070904--