home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / linux-2.0.34 / memory-tuning.txt < prev    next >
Encoding:
Text File  |  1997-08-18  |  1.7 KB  |  49 lines

  1. There are several files in /proc/sys/vm you can use to tune the
  2. memory system with.
  3.  
  4. You inspect them with 'cat', and set them with 'echo'. For example,
  5. /proc/sys/vm/freepages:
  6.  
  7. '# cat /proc/sys/vm/freepages' may yield:
  8. 64      96      128
  9.  
  10. These three numbers are: min_free_pages, free_pages_low and 
  11. free_pages_high.
  12.  
  13. You can adjust these with a command such as:
  14.  
  15. # echo "128 256 512" > /proc/sys/vm/freepages
  16.  
  17. Free memory never goes down below min_free_pages except for atomic
  18. allocation.  Background swapping is started if the number of free
  19. pages falls below free_pages_high, and intensive swapping is started
  20. below free_pages_low.  A "page" is 4 kB.
  21.  
  22. The values selected as boot defaults are the following:  For a
  23. machine with n>=8 Megabytes of memory, set min_free_pages = n*2,
  24. free_pages_low = n*3 and free_pages_high = n*4.  Machines with less
  25. than 8 Megabytes or less as if they had 8 Megabytes.
  26.  
  27. If "out of memory" errors sometimes occur, or if your machine does lots
  28. of networking, increasing min_free_pages to 64 or more may be a good
  29. idea.
  30.  
  31. free_pages_low should probably be about double of min_free_pages.
  32.  
  33. After a period of inactivity, the difference between free_pages_high and
  34. free_pages low is immediately available for any program you want to
  35. start up, without any need to swap out anything else.  If your memory
  36. is large enough (e.g. > 16 Meg), keeping 2 or 3 megabytes of memory
  37. ready for this purpose is probably a good idea.
  38.  
  39. I've found that
  40.  
  41. # echo "128 256 1024" > /proc/sys/vm/freepages
  42.  
  43. gives good performance for a 32 Meg system used as a small server and
  44. personal workstation.
  45.  
  46. The other three files in /proc/sys/vm are undocumented, as yet.
  47.  
  48. Thomas Koenig, ig25@rz.uni-karlsruhe.de
  49.