473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to clear linux file cache?

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 ma*******@postgresql.org)

Nov 23 '05 #1
3 12718
Janning Vygen <vy***@gmx.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.

-Doug

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

http://archives.postgresql.org

Nov 23 '05 #2
Am Dienstag, 16. November 2004 16:39 schrieb Doug McNaught:
Janning Vygen <vy***@gmx.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

Nov 23 '05 #3
The world rejoiced as vy***@gmx.de (Janning Vygen) wrote:
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
Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sure | last post by:
Hello Group, I have a php file which will list the pending task for each developer. If the developer changes some thing it will update to database. Once the user clicks the update button it...
19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
0
by: Vincent Lefevre | last post by:
Under Linux, I currently use xsltproc (libxslt), but it is awfully slow and takes a lot of memory (e.g. more than 100 MB) when using many XML files with a large DTD (e.g. DocBook): With my DTD...
1
by: manoj.bhosale | last post by:
Hello Friends, I am Manoj, just started learning c++ on linux. In 'C' or 'C++' program on DOS/Windows we use clrscr(); with #include<conio.h> file included. In linux conio.h file is not exist,...
4
by: PaulR | last post by:
Hi, We have a Server running SLES 8 and 3GB memory, with 1 DB2 instance and 2 active Databases. General info... DB2level = "DB2 v8.1.0.72", "s040914", "MI00086", and FixPak "7" uname -a =...
2
by: Romy Sreedharan | last post by:
Hello, I am wondering whether there is a mechanism to clear the Hard Disk Cache using C#? This is for O.S Windows XP regards romy
2
by: Les Caudle | last post by:
When displaying a database driven product page, I cache the page using: <%@ OutputCache Duration="86400" VaryByParam="ProductID" %> which works fine UNLESS I change the pricing or description...
5
by: tshad | last post by:
When I log of I do: HttpContext.Current.Session.Clear() FormsAuthentication.SignOut() The problem is that it clears the variables that I set up in my Session_Start function in my...
7
by: david wolf | last post by:
I have a problem that is used to test memory leak as follows, however, after each run of the program, if I am using the command "free" on the linux box, I did not see any difference about the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.