On 02/17/2014 08:45 PM, Jeff Janes
wrote:
I read that the suggestion not to cache a file when reading it is given by programs at the time the file is opened. That prompted me to think that there might be a way of telling PostgreSQL to apply that to the pages of a specific relation. I did not mean to suggest it should be a process-wide or database-wide setting.
Since a process is launched every time a session opens, e.g. a query window in pgAdmin, I thought it would be possible to do it per session rather than for the whole service. Either way, I agree this wouldn't solve the problem.
I have no idea how the kernel manages its cache, but I think that since individual pages that store the data of the table are small, the kernel has no way of knowing that a process will read a very large number of relatively small files that collectively will cause harm. Maybe if it were a single file large than total physical RAM it would act differently. But I am just speculating.
Thanks for asking. 3.8.0-35-generic. I'm curious. What does it do? Or do you know where I can read about this (just out of curiosity).
This server is read-mostly. It has 64 GB of RAM, a single 6-core i7 processor, and four SATA hard drives on software RAID 10. I get about 400 MB/s of sequential reads on simple benchmarks. Shared buffers is set to 16 GB, temp buffers to 8 MB, work mem to 100 MB, and maintenance work mem to 100 MB. I could probably tweak this but I know very little about it. Do you think I should set any of these higher? Other things run on the server, but most of the usage is PostgreSQL queries on tables of several hundred GB... some of which need to process whole tables. So other than the possibility of tweaking shared_buffers, the only other solution is getting a server with TBs of RAM?
I really appreciate your help. Thank you (and Tom). |