|

楼主 |
发表于 2003-12-11 20:42:03
|
显示全部楼层
http://www.samag.com/documents/s=1148/sam0107a/0107a.htm
Kernel Tweaks for High Performance
In their default configurations, the UNIX-style operating systems we tested do not support the large numbers of simultaneous TCP/IP connections that multi-threaded and asynchronous applications require. This limitation drastically restricts applications performance, and can incorrectly dissuade a systems administrator from using these kinds of high-performance architectures. Fortunately, these limitations are easily overcome with a few kernel tweaks. On UNIX, each TCP/IP connection uses a file descriptor, so you must increase the total number of descriptors available to the operating system, and also increase the maximum number of descriptors each process is allowed to use. All UNIX-style operating systems have a ulimit shell command (sh and bash), which can allow more open file descriptors to commands started in that shell once the appropriate kernel tweak has been made. We suggest ulimit -n 8192. Here are our recommended kernel tweaks:
On Linux: echo 65536 > /proc/sys/fs/file-max changes the number of system-wide file descriptors.
On FreeBSD: Append to /etc/sysctl (or you can use sysctl -w to add these):
kern.maxfiles=65536
kern.maxfilesperproc=32768
On Solaris: Add the following to /etc/system and reboot:
set rlim_fd_max=0x8000
set rlim_fd_cur=0x8000
“ulimit -n 8192”这一项是什么意思? |
|