Re: session servers in ram

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Alan Hodgson <ahodgson(at)simkin(dot)ca>, pgsql-performance(at)postgresql(dot)org
Subject: Re: session servers in ram
Date: 2009-09-22 18:22:00
Message-ID: dcc563d10909221122s6ae9f88bvf4ba9fd6472766c2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Sep 22, 2009 at 12:01 PM, Ron Mayer
<rm_pg(at)cheapcomplexdevices(dot)com> wrote:
> Alan Hodgson wrote:
>> On Monday 21 September 2009, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
>>> I'm looking at running session servers in ram.
>>
>> Use memcached for session data.
>
> IMHO postgres is more appropriate for some types of session data.
>
> One of the apps I work on involves session data that consists of
> geospatial data which we store and index in postgres/postgis.
>
> Scott Marlowe wrote:
>> I'm looking at running session servers in ram.
>>  We're currently IO write bound with
>> fsync=off using a 15k5 seagate SAS drive, so I'm hoping that moving
>> the db into /dev/shm will help quite a bit here.
>
> "a 15k5 seagate SAS drive"
>
> Is this implying that you have "a" == one session server?  I
> bet that it'd be cheaper to throw a bunch of cheap boxes
> in there and make a pool of session servers rather than one
> fast one.   When a new session is created, your application
> code can then pick the least loaded session server and put
> the session-server-number in a cookie.

We already have two using modulus load balancing, and each is handling
up to 100,000 sessons each, and an average session object of 10k to
20k. I'm just looking at how to keep from throwing more cheap boxes
at it, or having to put more drives in them. We're mostly IO bound on
these machines, even with 100 checkpoint segments and a 30 minute
checkpoint timeout and a low completion target to reduce checkpointing
even more.

Even with a move to a ramdisk, I'm guessing with our increasing load
we're gonna need to double our session servers eventually.

As for memcached (mentioned in another post), I'm not sure if it's the
right fit for this or not. We already use it to cache app data and it
works well enough, so it's worth testing for this as well I guess.

Thanks for all the input from everybody, I'll let you know how it works out.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2009-09-22 23:52:17 Re: Hunting Unused Indexes .. is it this simple ?
Previous Message Ron Mayer 2009-09-22 18:01:43 Re: session servers in ram