kernel tuning

From Noah.org
Revision as of 01:02, 22 January 2014 by Root (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


See also sysctl_and_sysfs.

Miscellaneous old notes

  1. overcommit -- the optimistic memory allocation strategy. By default malloc() returns non-NULL no matter how much memory you ask for. There is no guarantee that the memory is really available. The idea is that most applications will not use all the memory they ask for at the same time. This temporarily turns off overcommit: echo 2 > /proc/sys/vm/overcommit_memory. For more information, see kernel documentation files vm/overcommit-accounting and sysctl/vm.txt.
  2. Reliable and consistent filesystem. Prevent drive and kernel caching problems on write. Try mounting filesystem with I/O barrier turned on. Example '/etc/fstab':/dev/sda1 / ext4 defaults,barrier=1 1 1
  3. Setting swappiness to 0 (avoid swapping). See `sysctl -w vm.swappiness=0`. Add to '/etc/sysctl.conf': vm.swappiness=0.
  4. Swap vs. OOM Killer. Current strategy: 1. never swap. 2. Out of Memory and Out of Swap are CRITICAL conditions. 3. Reboot kernel on OOM. Set vm.panic_on_oom=1 and kernel.panic=3. Lots of stuff in cat /proc/sys/vm/. See vm.overcommit_memory. For more ideas see Linux Memory Management. Always fun: awk '{printf "%5d MB %s\n", $3*$4/(1024*1024), $1}' < /proc/slabinfo | sort -n

You need ImageMagick and netpbm (PPM/PNM format tools). ImageMagick is needed to fit an image to a given canvas size, with appropriate centering and filling in background color. I couldn't figure out how to do this with just netpbm or just with ImageMagick.

This takes an image and puts it in the middle of a 480x272 canvas. If there is any transparency or bars on the edges then they are filled with white. The output is a plain text ASCII PPM formatted file.

convert noah_logo.png -background white -compose Copy -gravity center -extent 480x272 -format PNG - | pngtopnm | ppmquant 224 | pnmtoplainpnm > logo_noah_480x272_clut224.ppm

See Also

[sysctl_and_sysfs