LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-05-2003, 01:45 PM   #1
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Rep: Reputation: 30
Can I set maximun disk cache size in linux?


I found that linux use a lot of memory in disk cache. After running for awhile, linux start to use sap disk space and I don't like that. Can I set maximun cache size to limit the size of disk cache?
 
Old 10-05-2003, 02:39 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
I found that linux use a lot of memory in disk cache. After running for awhile, linux start to use sap disk space and I don't like that. Can I set maximun cache size to limit the size of disk cache?
You should be able to locate it
in the kernel sources ... there's no
"more end user like" way to do it.

However, your should trust Linux.
It's memory utilisation is unsurplused :)

It will swap out processes that are inactive
for a long time, no matter how much RAM
you have, and it really does make sense.

Cheers,
Tink
 
1 members found this post helpful.
Old 10-05-2003, 04:46 PM   #3
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Original Poster
Rep: Reputation: 30
oh, thanks. That mean I shouldn't do it now. I would like to have about 20MB of free ram so some applications might startup faster. Anyway, switch from kde to xfce already help a bit.

Last edited by codec; 10-05-2003 at 04:52 PM.
 
Old 12-07-2010, 01:32 AM   #4
jetole
LQ Newbie
 
Registered: Feb 2008
Posts: 9

Rep: Reputation: 2
I know this post it old but since I found it while looking for something else it means other people will find it as well so I thought I would post some corrections.

There is a "more end user like" way to handle this and it's there because how it is designed in the kernel sources is implemented as what is the assumed best for each user but for a lot of people this isn't the best. Sun (now Oracle) in fact suggests ways to tune the VM (Virtual Memory) usage on Linux for when you install items such as their databases but this can apply to all sorts of things. Also, not everything I suggest had the same option when these posts were submitted however they were available under different names.

To change how much the swap is used, run: sysctl -w vm.swappiness=X
replace X with an int between 0 and 100. 0 means only use swap when their are no other options and 100 means use swap as often as possible.

To make sure you always have X amount of Ram available (in kilobytes), run: sysctl -w vm.min_free_kbytes=X

To empty the page cache and the dirty write buffers with all committed transactions, run: sync && sysctl -w vm.drop_caches=3

vm.drop_caches is a command and not a tunable however the other ones can be stored in /etc/sysctl.conf and automatically set each time the system boots. There are many more options to explore for tuning VM and I would encourage you to read sysctl/vm.txt.gz in the Linux kernel source Documentation folder.

Last edited by jetole; 12-07-2010 at 01:34 AM.
 
Old 12-07-2010, 02:25 AM   #5
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
(Never mind...ancient post )

Last edited by MrCode; 12-07-2010 at 02:29 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
PCI cache line size set incorrectly (32 bytes) by BIOS/FW B1TW1SE Linux - Software 1 08-18-2009 02:43 PM
PCI cache line size set incorrectly (32 bytes) by BIOS/FW B1TW1SE Linux - Newbie 4 03-30-2008 11:25 PM
Cache memory size too high? Boomba Linux - General 2 10-15-2005 01:32 PM
How do i increase the size of the linux fifo's currently set to 4K in 2.6 kernel ? ayb Programming 2 06-25-2004 07:55 AM
How to find size of Cache memory i.e. L1 and L2 elanvital Linux - General 0 05-29-2004 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration