Search Postgresql Archives

Re: Shared Buffer Size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/27/2011 05:33 PM, preetika tyagi wrote:
Hows does the shared buffer in Postgres rely on the Operating System cache? Suppose my RAM is 8 GB and shared_buffer is 24 MB in postgres. And there are some dirty pages in shared_buffer and I need to write a dirty page back to the disk to bring in a new page. What happens in this case? The dirty page will be written to the disk considering the shared_buffer size as 24 MB? or it will not be written and will stay in RAM which is 8 GB?


In this case, the dirty page will be written to the operating system, which will initially store it in its own write cache. Eventually the operating system will write that page out to disk from that cache. The delay before that happens can easily be 30 seconds or more on operating systems like Linux. If PostgreSQL needs to read that data again, it may find it still in the OS cache, in which case the read will happen very quickly. Eventually, the dirty data will be written to disk, and if it's not used for long enough the OS cache memory will be re-used for something else.

When you read a page into the database, and you don't dirty it, it might be evicted from the database cache without a write. If the database needs that page again, it will ask the OS for it. If the OS still has it in its own read cache, it may just read it from the cache again, without a real disk read happening.

--
Greg Smith   2ndQuadrant US    greg@xxxxxxxxxxxxxxx   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux