Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 33C541442BD2 for ; Sat, 14 Jul 2012 02:06:16 -0300 (ADT) Received: from mail-yx0-f174.google.com ([209.85.213.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SpuYX-0000E9-E4 for pgsql-performance@postgresql.org; Sat, 14 Jul 2012 05:06:15 +0000 Received: by yenl2 with SMTP id l2so4190736yen.19 for ; Fri, 13 Jul 2012 22:06:00 -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=Rz4A+HbUZ3mcKW9+eiIZmRyEbWlOCM0zYdMln+n3bTo=; b=J1RWWEhvAU97dsU1/oINIVb/4bXLPq0wMPaF0nBFSeBazr9pJ6vCjbnmVxO3RzQojg hYr6XBva3PS/958fZD6HOKihVXuq4OuOaL5LQwP2PwKN2LVOMV6NRPhK+FDXsqTPkcvv UsW/ZpEIyTaQfotXgVcbPNfXyvnV5BZaKkeBEnYwjtrcYxdt6hR3F4v63GjraFqKL2KN bQN2M1FLKTAtjNBljU9FkUBgNwDLdaDZ2xHbEtwSlbeRUs/NWGe1nLTb75Y5IDYhkfnE 9M/kQzWQMmbKERIoHCzceOQvEkRgwftEh+Y+OHcJozHS8oez+bqZqbTbRzggdhQlPVeJ XIrQ== Received: by 10.66.77.40 with SMTP id p8mr5419644paw.78.1342242360309; Fri, 13 Jul 2012 22:06:00 -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 ru4sm7362490pbc.66.2012.07.13.22.05.57 (version=SSLv3 cipher=OTHER); Fri, 13 Jul 2012 22:05:59 -0700 (PDT) Message-ID: <5000FE32.2000909@ringerc.id.au> Date: Sat, 14 Jul 2012 13:05:54 +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: Sergey Konoplev , 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="------------060402060502080403060205" X-Gm-Message-State: ALoCoQkQyMp5EW2WbKbfjPP9cJLdTZgjUfC1IaSbLJSQqm1U4ZMaGQkihTmt53TD91vpdRuFy2qq X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/183 X-Sequence-Number: 47364 This is a multi-part message in MIME format. --------------060402060502080403060205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/14/2012 09:21 AM, B Sreejith wrote: > > Dear Sergev, > > We have around 15 to 18 separate products.What we are told to do is to > check the scalability of the underlying DB of each product (application). > That's the requirement.Nothing more was explained to us.That's why I > said earlier that I am confused on how to approach this. > Sounds like your client / boss has a case of buzz-word-itis. "Scalability" means lots of different things: - How well it copes with growth of data sizes - How well it copes with growth of query rates / activity - How well it copes with larger user counts (may not be the same as prior) - Whether it's easily sharded onto multiple systems - Whether it has any locking choke-points that serialize common operations - .... Perhaps most importantly, your database is only as scalable as your application's use of it. Two apps can use exactly the same database structure, but one of them can struggle massively under load another one barely notices. For example, if one app does this (pseudocode): SELECT id FROM customer WHERE .... FOR attribute IN customer SELECT :attribute.name FROM customer WHERE id = :customer.id IF attribute.is_changed THEN UPDATE customer SET :attribute.name = :attribute.new_value WHERE id = :customer.id END IF and another just does: UPDATE customer SET attribute1 = value1, attribute2 = value2, attribute3 = value3 WHERE .... The first will totally melt down under load that isn't significantly different from idle as far as the second one is concerned. That's a ridiculously bad example for the first app, but real examples that aren't much better arise from badly tuned or badly written object relational management systems. The classic "N+1 selects" problem and massive inefficient multiple left outer joins are classics. Thus, you can't really evaluate the scalability of the database under load separately from the application that's using it and the workload. -- Craig Ringer --------------060402060502080403060205 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 07/14/2012 09:21 AM, B Sreejith wrote:

Dear Sergev,

We have around 15 to 18 separate products.What we are told to do is to check the scalability of the underlying DB of each product (application).
That's the requirement.Nothing more was explained to us.That's why I said earlier that I am confused on how to approach this.


Sounds like your client / boss has a case of buzz-word-itis. "Scalability" means lots of different things:

- How well it copes with growth of data sizes
- How well it copes with growth of query rates / activity
- How well it copes with larger user counts (may not be the same as prior)
- Whether it's easily sharded onto multiple systems
- Whether it has any locking choke-points that serialize common operations
- ....

Perhaps most importantly, your database is only as scalable as your application's use of it. Two apps can use exactly the same database structure, but one of them can struggle massively under load another one barely notices. For example, if one app does this (pseudocode):

SELECT id FROM customer WHERE ....
FOR attribute IN customer
   SELECT :attribute.name FROM customer WHERE id = :customer.id
   IF attribute.is_changed THEN
       UPDATE customer SET :attribute.name = :attribute.new_value WHERE id = :customer.id
   END IF

and another just does:

UPDATE customer
SET attribute1 = value1, attribute2 = value2, attribute3 = value3
WHERE ....


The first will totally melt down under load that isn't significantly different from idle as far as the second one is concerned.

That's a ridiculously bad example for the first app, but real examples that aren't much better arise from badly tuned or badly written object relational management systems. The classic "N+1 selects" problem and massive inefficient multiple left outer joins are classics.

Thus, you can't really evaluate the scalability of the database under load separately from the application that's using it and the workload.

--
Craig Ringer
--------------060402060502080403060205--