Linux: March 2011 Archives

Increase Linux ARP cache size

user-pic
Vote 0 Votes

若在 Linux 使用網路遇到 No Buffer Space avaiable, 就是 ARP cache table 滿了,
預設值是 1024, 若要調大成四倍, 可以下指令
sysctl -w net.ipv4.neigh.default.gc_thresh1=512
sysctl -w net.ipv4.neigh.default.gc_thresh2=2048
sysctl -w net.ipv4.neigh.default.gc_thresh3=4096

加到 /etc/sysctl.conf 可以使下次開機生效
echo "net.ipv4.neigh.default.gc_thresh1=512
net.ipv4.neigh.default.gc_thresh2=2048
net.ipv4.neigh.default.gc_thresh3=4096" >> /etc/sysctl.conf

gc_thresh1
The minimum number of entries to keep in the ARP cache. The garbage collector will not run if there are fewer than this number of entries in the cache. Defaults to 128.
gc_thresh2
The soft maximum number of entries to keep in the ARP cache. The garbage collector will allow the number of entries to exceed this for 5 seconds before collection will be performed. Defaults to 512.
gc_thresh3
The hard maximum number of entries to keep in the ARP cache. The garbage collector will always run if there are more than this number of entries in the cache. Defaults to 1024.

ref. Manage of ARP

XZ compression format

user-pic
Vote 0 Votes

xz 格式壓縮率比 bzip2 還高,
XZ Utils 所提供的 Source tar ball 來看,
xz 格式是 bzip2 格式的 88%, gz 格式的 72%

XZ Utils 網站上有 Windows 版的 CLI 工具
單解 xz 檔範
xz -d FreeBSD-8.2-RELEASE-i386-dvd1.iso.xz

xzdec FreeBSD-8.2-RELEASE-i386-dvd1.iso.xz > FreeBSD-8.2-RELEASE-i386-dvd1.iso

tar 從 1.22 版才開始支援 xz, 不過是呼叫 xz 來使用, 不是原生支援 xz
打包壓縮
tar cJf file.tar.xz files
解壓
tar Jxvf file.tar.xz

若 tar 比較較不支援 xz, 解 tar.xz 方法
xzdec file.tar.xz | tar xv

In most distro, Procmail does not support large file by default,
If your mailbox file larger then 2G, you may see maillog like
(can't create user output file. Command output: procmail: Couldn't create "/var/spool/mail/user" )
You have to recompile Procmail using
make CFLAGS='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE'
then Procmail can handle mailbox file larger then 2G.

ref. LargeFile Support

About this Archive

This page is an archive of entries in the Linux category from March 2011.

Linux: February 2011 is the previous archive.

Linux: April 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Linux: Monthly Archives

Monthly Archives