Skip to content

Commit

Permalink
add sysctl.conf/limits.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Phus Lu committed Jan 4, 2015
1 parent d6ce7ab commit 9ef8a45
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/vps/limits.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ����Ӧ�ó���������ļ���Ŀ����
* hard nofile 65535
* soft nofile 65535
41 changes: 41 additions & 0 deletions server/vps/sysctl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ϵͳ���н���һ�����Դ򿪵��ļ������� ÿ���׽���Ҳռ��һ���ļ�������
fs.file-max = 1491124
# ϵͳͬʱ����TIME_WAIT�׽��ֵ������Ŀ��http �����ӻ�����ܶ� TIME_WAIT �׽��֡�
net.ipv4.tcp_max_tw_buckets = 7000
# �ر� tcp ��Դ����
net.ipv4.conf.default.accept_source_route = 0
# �����׽��ִ��� TIME_WAIT ��ʱ�䣬 60s -> 30s
net.ipv4.tcp_fin_timeout = 30
# ���� TIME_WAIT ���ã�ʹ�ý��� TIEM_WAIT ״̬���׽��ֵĶ˿ڿ������̱������׽���ʹ�á�
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
# �ر� tcp timestamp, �� tw_reuse/tw_recycle ͬʱʹ��
# tw_recycle һ�㲻����ʹ�ã�RFC1323���棬TCP_TW_RECYCLE��TCP��timestampѡ�timestampϵͳĬ�Ͽ�����ͬʱ��Ч��ʱ����NAT�����»ᵼ�·������޷���Ӧ���ӣ����Ҳ�ǿ��Ը��ֵġ�
net.ipv4.tcp_timestamps = 0
# ���ں˵� SYN Cookie ���ܣ����Է�ֹ���� DOS ������
net.ipv4.tcp_syncookies = 1
# ��С tcp keepalive ̽����������Լ�ʱ�ͷų�����
net.ipv4.tcp_keepalive_probes = 3
# ���� tcp keepalive ̽����ʱ�䣬ͬ��
net.ipv4.tcp_keepalive_intvl = 15
# �����ں� backlog ������ʹ��ϵͳ�ܹ����ָ������δ��� TCP �������ֵ��׽��֡�
net.ipv4.tcp_max_syn_backlog = 8388608
# ͬ��
net.core.netdev_max_backlog = 8388608
# ͬ��
net.core.somaxconn = 8388608
# Ĭ�ϲ���
net.ipv4.tcp_keepalive_time = 7200
# �رնԸ���Ļ�������(�糤�ʹܵ�)֧�֣���ʡϵͳ������Դ
net.ipv4.tcp_window_scaling = 0
# �ر��ں˶������Լӵ���Ļ���(��wifi/3g)��TCP�Ż���������·����Ҫ tcp_sack
net.ipv4.tcp_sack = 0
# ����Ӧ�ó�����ö˿ڷ�Χ��
net.ipv4.ip_local_port_range = 1024 65000
# Increase TCP buffer sizes
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_congestion_control = cubic

0 comments on commit 9ef8a45

Please sign in to comment.