![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can I somehow force PogSQL to do direct I/O on Ext3 file system? All those FS buffers are messing up free memory and swap partitions. |
#3
| |||
| |||
|
|
Can I somehow force PogSQL to do direct I/O on Ext3 file system? All those FS buffers are messing up free memory and swap partitions. |
#4
| |||||
| |||||
|
|
Mladen Gogala wrote: Can I somehow force PogSQL to do direct I/O on Ext3 file system? All those FS buffers are messing up free memory and swap partitions. Sure, all you have to do is mount the file system with the "sync" option, like: mount -t ext3 -o sync /dev/whatever /mountpoint The man page for "mount" describes "sync" as follows: |
|
sync All I/O to the file system should be done synchronously. Some notes on your original problem: File system buffering should not cause problems. Only memory that is not required elsewhere should be used. Any problem you experience here should be a problem of the Linux kernel. |
|
Is it a problem for you if free memory is used by the file system buffer? I ask because there are two approaches to buffering PostgreSQL databases in RAM: a) make shared_buffers as large as possible and let PostgreSQL do the buffering (this is probably what you are doing). |
|
b) keep shared_buffers comparatively small and let the file system buffer do the work. Contrary to what I had expected, many knowledgable PostgreSQL developers advocate version b) and say that they experience better performance that way. |
|
I guess that nobody would advocate b) if there were known problems with file system buffering. Yours, Laurenz Albe |
#5
| |||
| |||
|
|
Mladen Gogala wrote: Can I somehow force PogSQL to do direct I/O on Ext3 file system? All those FS buffers are messing up free memory and swap partitions. Sure, all you have to do is mount the file system with the "sync" option, like: mount -t ext3 -o sync /dev/whatever /mountpoint The man page for "mount" describes "sync" as follows: sync All I/O to the file system should be done synchronously. Some notes on your original problem: File system buffering should not cause problems. Only memory that is not required elsewhere should be used. Any problem you experience here should be a problem of the Linux kernel. Is it a problem for you if free memory is used by the file system buffer? I ask because there are two approaches to buffering PostgreSQL databases in RAM: a) make shared_buffers as large as possible and let PostgreSQL do the buffering (this is probably what you are doing). b) keep shared_buffers comparatively small and let the file system buffer do the work. |
|
Contrary to what I had expected, many knowledgable PostgreSQL developers advocate version b) and say that they experience better performance that way. |
|
I guess that nobody would advocate b) if there were known problems with file system buffering. Yours, Laurenz Albe |
#6
| |||
| |||
|
|
Can I somehow force PogSQL to do direct I/O on Ext3 file system? All those FS buffers are messing up free memory and swap partitions. Sure, all you have to do is mount the file system with the "sync" option, like: [...] Thanks, I will try although it doesn't look exactly like the direct I/O. Direct I/O bypasses the system buffers and uses the user buffer. Consequence is that the I/O is synchronous, but there is also no memory being wasted. This might be the case with synchronous mount, I don't know. |
|
File system buffering should not cause problems. Only memory that is not required elsewhere should be used. Any problem you experience here should be a problem of the Linux kernel. Using the free memory for FS buffers is a problem. The memory is not shown as free, which means that it isn't directly usable by the other processes. Also, swap has to be allocated. |
|
Contrary to what I had expected, many knowledgable PostgreSQL developers advocate version b) and say that they experience better performance that way. If that is so, that is a bad testimony for PostgreSQL and the efficiency of the buffer cache. I don't have default buffer cache, my cache is moderately sized, 512MB. I find it very difficult to accept that the general purpose FS buffering could be more efficient than the specialized DB buffering. If that is so, what is the purpose of the latter? |
#7
| |||
| |||
|
|
Contrary to what I had expected, many knowledgable PostgreSQL developers advocate version b) and say that they experience better performance that way. are performance better only on write or in queries too? |
#8
| |||
| |||
|
|
I ask because there are two approaches to buffering PostgreSQL databases in RAM: a) make shared_buffers as large as possible and let PostgreSQL do the buffering (this is probably what you are doing). b) keep shared_buffers comparatively small and let the file system buffer do the work. Hi, usually I keep shared_buffers high (25% of RAM) how much % of memory is it meant for comparatively small? |
|
What impact would have a low shared_buffers value on checkpoints? |
|
Contrary to what I had expected, many knowledgable PostgreSQL developers advocate version b) and say that they experience better performance that way. are performance better only on write or in queries too? |
#9
| |||
| |||
|
|
I find it very difficult to accept that the general purpose FS buffering could be more efficient than the specialized DB buffering. If that is so, what is the purpose of the latter? |
#10
| |||
| |||
|
|
On 01/27/2010 03:24 PM, Mladen Gogala wrote: I find it very difficult to accept that the general purpose FS buffering could be more efficient than the specialized DB buffering. If that is so, what is the purpose of the latter? There have been several flames about the matter on the linux-kernel mailing list. this is the first like I got: http://kerneltrap.org/node/7563 |
![]() |
| Thread Tools | |
| Display Modes | |
| |