Re: a question about Direct I/O and double buffering
От | Erik Jones |
---|---|
Тема | Re: a question about Direct I/O and double buffering |
Дата | |
Msg-id | 7B476592-606F-46F0-A643-9C4E5D85CE6E@myemma.com обсуждение исходный текст |
Ответ на | Re: a question about Direct I/O and double buffering (Mark Lewis <mark.lewis@mir3.com>) |
Ответы |
Re: a question about Direct I/O and double buffering
|
Список | pgsql-performance |
On Apr 5, 2007, at 1:27 PM, Mark Lewis wrote:
On Thu, 2007-04-05 at 13:09 -0500, Erik Jones wrote:On Apr 5, 2007, at 12:09 PM, Xiaoning Ding wrote:Hi,A page may be double buffered in PG's buffer pool and in OS's buffercache.Other DBMS like DB2 and Oracle has provided Direct I/O option toeliminatedouble buffering. I noticed there were discusses on the list. ButI can not find similar option in PG. Does PG support direct I/O now?The tuning guide of PG usually recommends a small shared buffer pool(comparedto the size of physical memory). I think it is to avoid swapping.Ifthere wereswapping, OS kernel may swap out some pages in PG's buffer pool evenPGwant to keep them in memory. i.e. PG would loose full control overbuffer pool.A large buffer pool is not good because it may1. cause more pages double buffered, and thus decrease theefficiency ofbuffercache and buffer pool.2. may cause swapping.Am I right?If PG's buffer pool is small compared with physical memory, can Isaythat thehit ratio of PG's buffer pool is not so meaningful because mostmissescan besatisfied by OS Kernel's buffer cache?Thanks!To the best of my knowledge, Postgres itself does not have a direct IOoption (although it would be a good addition). So, in order to usedirect IO with postgres you'll need to consult your filesystem docsfor how to set the forcedirectio mount option. I believe it can beset dynamically, but if you want it to be permanent you'll to add itto your fstab/vfstab file.
Not to hijack this thread, but has anybody here tested the behavior ofPG on a file system with OS-level caching disabled via forcedirectio orby using an inherently non-caching file system such as ocfs2?I've been thinking about trying this setup to avoid double-caching nowthat the 8.x series scales shared buffers better, but I figured I'd askfirst if anybody here had experience with similar configurations.-- Mark
erik jones <erik@myemma.com>
software developer
615-296-0838
emma(r)
В списке pgsql-performance по дате отправления: