dbTalk Databases Forums  

How to clear linux file cache?

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss How to clear linux file cache? in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Janning Vygen
 
Posts: n/a

Default How to clear linux file cache? - 11-16-2004 , 03:59 AM






Hi,

i am testing a few queries in my postgresql DB. The first query after reboot
is always slower because of an empty OS page/file cache.

I want to test my queries without any files in the linux kernel cache, just to
know what would be the worst execution time. At the moment i stop postgresql
and do something like

find / -name foo

for a few minutes and start postgresql afterwards.

I search manuals with "apropos page cache" and found sync but it doesnt clear
the cache, just writes dirty pages back to disk. I googled for "linux clear
page cache" but did not found what i need. (of course i searched the
archives, too)

So how do i easily empty all page/file caches on linux (2.4.24)?

Sorry for beeing a little bit OT, but i think my question still relates to
postgresql.

kind regards,
janning

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #2  
Old   
Doug McNaught
 
Posts: n/a

Default Re: How to clear linux file cache? - 11-16-2004 , 09:39 AM






Janning Vygen <vygen (AT) gmx (DOT) de> writes:

Quote:
So how do i easily empty all page/file caches on linux (2.4.24)?
Probably the closest you can easily get is to put the Postgres data
files on their own partition, and unmount/remount that partition
before running yuour tests. Unmounting will sync and throw away all
cached file data for that partition.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
  #3  
Old   
Christopher Browne
 
Posts: n/a

Default Re: How to clear linux file cache? - 11-16-2004 , 09:50 AM



The world rejoiced as vygen (AT) gmx (DOT) de (Janning Vygen) wrote:
Quote:
So how do i easily empty all page/file caches on linux (2.4.24)?
You can empty them of PostgreSQL-related data by filling them with
something else.

You might head to some directory that has more data in it than you
have memory, and "cat" the files...
--
"cbbrowne","@","linuxfinances.info"
http://www.ntlug.org/~cbbrowne/sap.html
"As far as Saddam Hussein being a great military strategist, he is
neither a strategist, nor is he schooled in the operational arts, nor
is he a tactician, nor is he a general, nor is he as a soldier. Other
than that, he's a great military man, I want you to know that."
-- General Norman Schwarzkopf, 2/27/91


Reply With Quote
  #4  
Old   
Janning Vygen
 
Posts: n/a

Default Re: How to clear linux file cache? - 11-16-2004 , 10:37 AM



Am Dienstag, 16. November 2004 16:39 schrieb Doug McNaught:
Quote:
Janning Vygen <vygen (AT) gmx (DOT) de> writes:
So how do i easily empty all page/file caches on linux (2.4.24)?

Probably the closest you can easily get is to put the Postgres data
files on their own partition, and unmount/remount that partition
before running yuour tests. Unmounting will sync and throw away all
cached file data for that partition.
very good idea. i will do it like this.

thanks.
janning

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.