- 论坛徽章:
- 13
|
本帖最后由 ulovko 于 2012-06-29 10:45 编辑
kernel.shmall = 2097152 这个选项是否是所有的共享内存?
kernel.shmmax = 2147483648 这个是支持的最大共享内存
kernel.shmmni = 4096 这个是支持的最小共享内存
kernel.sem = 250 32000 100 128 这个不知道什么意思
fs.file-max = 65536 这个是最大打开文件个数
net.ipv4.ip_local_port_range = 1024 65000 这个是打开端口的范围
net.core.rmem_default = 1048576 |
net.core.rmem_max = 1048576 |
net.core.wmem_default = 262144 |——这四个都不太明白
net.core.wmem_max = 262144 | - > ipcs -M
- shminfo:
- shmmax: 536870912 (max shared memory segment size)
- shmmin: 1 (min shared memory segment size)
- shmmni: 192 (max number of shared memory identifiers)
- shmseg: 128 (max shared memory segments per process)
- shmall: 32768 (max amount of shared memory in pages)
- # man ipcs
- ipcs — report System V interprocess communication facilities status
复制代码 Type: sysctl -w net.core.rmem_max=8388608
This sets the max OS receive buffer size for all types of connections.
Type: sysctl -w net.core.wmem_max=8388608
This sets the max OS send buffer size for all types of connections.
Type: sysctl -w net.core.rmem_default=65536
This sets the default OS receive buffer size for all types of connections.
Type: sysctl -w net.core.wmem_default=65536
This sets the default OS send buffer size for all types of connections.
Type: sysctl -w net.ipv4.tcp_mem='8388608 8388608 8388608'
TCP Autotuning setting. "The tcp_mem variable defines how the TCP stack should behave when it comes to memory usage.
The first value specified in the tcp_mem variable tells the kernel the low threshold.
Below this point, the TCP stack do not bother at all about putting any pressure on the memory usage by different TCP sockets.
The second value tells the kernel at which point to start pressuring memory usage down.
The final value tells the kernel how many memory pages it may use maximally.
If this value is reached, TCP streams and packets start getting dropped until we reach a lower memory usage again.
This value includes all TCP sockets currently in use."
Type: sysctl -w net.ipv4.tcp_rmem='4096 87380 8388608'
TCP Autotuning setting. "The first value tells the kernel the minimum receive buffer for each TCP connection, and this buffer is always allocated to a TCP socket, even under high pressure on the system.
The second value specified tells the kernel the default receive buffer allocated for each TCP socket.
This value overrides the /proc/sys/net/core/rmem_default value used by other protocols.
The third and last value specified in this variable specifies the maximum receive buffer that can be allocated for a TCP socket."
Type: sysctl -w net.ipv4.tcp_wmem='4096 65536 8388608'
TCP Autotuning setting. "This variable takes 3 different values which holds information on how much TCP sendbuffer memory space each TCP socket has to use.
Every TCP socket has this much buffer space to use before the buffer is filled up.
Each of the three values are used under different conditions.
The first value in this variable tells the minimum TCP send buffer space available for a single TCP socket.
The second value in the variable tells us the default buffer space allowed for a single TCP socket to use.
The third value tells the kernel the maximum TCP send buffer space."
Type:sysctl -w net.ipv4.route.flush=1
This will enusre that immediatly subsequent connections use these values. [/code]Ipsysctl-tutorial: http://www.frozentux.net/documents/ipsysctl-tutorial/ |
|