PostgreSQL Performance: keep seldomly used small database in memory while server busy with big database -


i have server 64gb ram , postgresql 9.2. on 1 small database "a" 4gb queried once hour or , 1 big database "b" 60gb gets queried 40-50x per second!

as expected, linux , postgresql fill ram bigger database's data more accessed.

my problem queries small database "a" critical , have run in <500ms. logfile shows couple of queries per day took >3s though. if execute them hand they, too, take 10ms indexes fine.

so guess long runners happen when postgresql has load chunks of small databases indexes disk.

i have kind of "cache warmer" script repeats "select * x order y" queries small database every second wastes lot of cpu power , improves situation little bit.

any more ideas how tell postgresql want small database "sticky" in memory?

postgresql doesn't offer way pin tables in memory, though community welcome people willing work on thought out, tested , benchmarked proposals allowing people who're willing proposals real code.

the best option have postgresql @ time run separate postgresql instance response-time-critical database. give db big enough shared_buffers whole db reside in shared_buffers.

do not create tablespace on ramdisk or other non-durable storage , put data needs infrequently rapidly accessed there. tablespaces must accessible or whole system stop; if lose tablespace, lose whole database cluster.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -