Re: How to keep queries low latency as concurrency increases

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Catalin Iacob <iacobcatalin(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Marko Kreen <markokr(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How to keep queries low latency as concurrency increases
Date: 2012-11-27 23:17:55
Message-ID: CAOR=d=1tp1gYLEVo11+3xjzQb+nRHaSDPdxaxiTSoys-rfB2+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Nov 26, 2012 at 12:46 AM, Heikki Linnakangas
<hlinnakangas(at)vmware(dot)com> wrote:
> On 25.11.2012 18:30, Catalin Iacob wrote:
>>
>> So it seems we're just doing too many connections and too many
>> queries. Each page view from a user translates to multiple requests to
>> the application server and each of those translates to a connection
>> and at least a few queries (which are done in middleware and therefore
>> happen for each and every query). One pgbouncer can handle lots of
>> concurrent idle connections and lots of queries/second but our 9000
>> queries/second to seem push it too much. The longer term solution for
>> us would probably be to do less connections (by doing less Django
>> requests for a page) and less queries, before our deadline we were
>> just searching for a short term solution to handle an expected traffic
>> spike.
>
>
> The typical solution to that is caching, see
> https://docs.djangoproject.com/en/1.4/topics/cache/.

The first caching solution they recommend is memcached, which I too
highly recommend. Put a single instance on each server in your farm
give it 1G in each place and go to town. You can get MASSIVE
performance boosts from memcache.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Steve Atkins 2012-11-27 23:26:26 Re: Savepoints in transactions for speed?
Previous Message Richard Huxton 2012-11-27 22:52:20 Re: Savepoints in transactions for speed?