2006-08-07

Application Temporary Data into RAM

Reduce read/write stress on harddrive for temporary application data.
減少應用程式在硬存上的讀寫

Mount /tmp to RAM tmpfs (auto reszie below 1GB)
/tmp 掛載到 RAM 並設成 1GB 大小.
$ nano -w /etc/fstab
none  /tmp  tmpfs  defaults,nosuid,nodev,noatime,size=1024M,mode=1777  0 0
Edit /etc/bash/bashrc
修改 /etc/bash/bashrc
$ nano -w /etc/bash/bashrc
if [ ! -d /tmp/.$USER ]; then
  mkdir /tmp/.$USER
fi

for x in .adobe .dia .gimp-2.3 .gqview .java .macromedia .mplayer .thumbnails .urlgfe .vlc .xvpics
do
  if [ ! -d /tmp/.$USER/$x ]; then
    mkdir /tmp/.$USER/$x
    ln -sf /tmp/.$USER/$x $HOME
  fi
done

No comments: