Re: Multiple buffer cache?

From: Alexei Vladishev <alexei(dot)vladishev(at)zabbix(dot)com>
To: "Bret S(dot) Lambert" <bret(dot)lambert(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple buffer cache?
Date: 2010-02-09 19:06:48
Message-ID: 4B71B248.9040301@zabbix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bret,

>>> And then, even if the support is there, you'd need to outline exactly
>>> how you're planning on pushing this button.
>>>
>>> Specifically, what's your usage pattern that would make this a
>>> win for you?
>>>
>> Let me explain. I have a very busy application generating thousands
>> of SQLs per second.
>> There is an application level cache built into the application already.
>>
>> The important part is that once per hour the application writes
>> collected data to huge historical
>> tables (100M up-to billions of records, partitioned). Since it
>> happens every hour database buffer
>> cache is already overwritten by data and indexes of other tables, so
>> the write operation is very
>> slow and requires huge amount of disk seeks causing 50-100x drop of
>> performance.
>>
>
> The disk seeks will happen regardless of what Postgres does, as the
> OS pulls in new disk blocks to perform the write. If your OS' buffer
> cache is large enough to hold all the data you need, then your
> best bet is likely partitioning data across multiple disks, so that
> queuing the archive reads doesn't get in the way of production reads.
>
> As I'm a unix admin mostly, I'm not qualified to give advice on whether
> or not that's possible, or how to do it if it is ;)
>
I was talking about read seeks obviously caused by index-related
searches. Write operations
do not cause latency issues as they are handled quite well by OS,
controller, HDD, whatever
write cache.

>> So, my idea is to assign a separate buffer cache for the historical
>> tables. It would guarantee that
>> index data is always cached, so the write operation will be very fast.
>>
>> Is it possible? Is there any other techniques available?
>>
>
> If it were at all possible, I'd actually set up a secondary archiving
> server (unless you need the historical data on tap for the production
> system as well), either on another port on the same machine, or on
> another machine which won't impact your production system if it has to
> suddenly do a bunch of disk I/O, and log the history to that.
>
I agree. Two separate servers would be a nice solution as usage patterns
are absolutely different,
so the servers can be tuned differently. Lack of transactional integrity
is an obvious drawback of
such approach.

Kind regards,
Alexei

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2010-02-09 19:18:16 Re: SSL connection lost after long-lasting copy command
Previous Message Davor J. 2010-02-09 19:01:38 Re: R: One column to multiple columns based on constraints?