linux系統優化

2021-10-02 06:07:39 字數 2538 閱讀 2910

手動vim /etc/apt/sources.list 清空 替換相應版本的配置。執行apt update更新倉庫

中科⼤:

清華⼤學:

華為:

#cat /etc/security/limits.conf # 複製到文章內容最下方

#root賬⼾的資源軟限制和硬限制

root soft core unlimited

root hard core unlimited

root soft nproc 1000000

root hard nproc 1000000

root soft nofile 1000000

root hard nofile 1000000

root soft memlock 32000

root hard memlock 32000

root soft msgqueue 8192000

root hard msgqueue 8192000

#其他賬⼾的資源軟限制和硬限制

* soft core unlimited

* hard core unlimited

* soft nproc 1000000

* hard nproc 1000000

* soft nofile 1000000

* hard nofile 1000000

* soft memlock 32000

* hard memlock 32000

* soft msgqueue 8192000

* hard msgqueue 8192000

sudo vim /etc/sysctl.conf #文章內的全部內容用以下內容覆蓋

# # controls the maximum number of shared memory segments, in pages

kernel.shmall = 4294967296

# tcp kernel paramater

net.ipv4.tcp_mem = 786432 1048576 1572864

net.ipv4.tcp_rmem = 4096 87380 4194304

net.ipv4.tcp_wmem = 4096 16384 4194304

net.ipv4.tcp_window_scaling = 1

net.ipv4.tcp_sack = 1

# socket buffer

net.core.wmem_default = 8388608

net.core.rmem_default = 8388608

net.core.rmem_max = 16777216

net.core.wmem_max = 16777216

net.core.netdev_max_backlog = 262144

net.core.somaxconn = 20480

net.core.optmem_max = 81920

# tcp conn

net.ipv4.tcp_max_syn_backlog = 262144

net.ipv4.tcp_syn_retries = 3

net.ipv4.tcp_retries1 = 3

net.ipv4.tcp_retries2 = 15

# tcp conn reuse

net.ipv4.tcp_timestamps = 0

net.ipv4.tcp_tw_reuse = 0

net.ipv4.tcp_tw_recycle = 0

net.ipv4.tcp_fin_timeout = 1

net.ipv4.tcp_max_tw_buckets = 20000

net.ipv4.tcp_max_orphans = 3276800

net.ipv4.tcp_synack_retries = 1

net.ipv4.tcp_syncookies = 1

# keepalive conn

net.ipv4.tcp_keepalive_time = 300

net.ipv4.tcp_keepalive_intvl = 30

net.ipv4.tcp_keepalive_probes = 3

net.ipv4.ip_local_port_range = 10001 65000

# swap

vm.overcommit_memory = 0

#net.ipv4.conf.eth1.rp_filter = 0

#net.ipv4.conf.lo.arp_ignore = 1

#net.ipv4.conf.lo.arp_announce = 2

#net.ipv4.conf.all.arp_ignore = 1

#net.ipv4.conf.all.arp_announce = 2

Linux系統優化

最近很多問我 apache的優化引數 prefork模式的 startservers 100 serverlimit 2000 maxclients 1000 minspareservers 20 maxspareservers 50 maxrequestsperchild 10000 具體看其實系...

linux系統優化

1 新增普通使用者賬戶 2 更改ssh伺服器端遠端登陸的配置 建議新增2塊網絡卡,1塊內網,1塊外網 外網保持現有ip不變,內網可以使用10.10.0.x 例如 10.10.6.61保持不變,增加內網10.10.0.61,用於內部訪問 vim sshd config 13 port 52113 修改...

Linux系統優化

root znix cat etc redhat release centos release 6.9 final root znix uname r 2.6.32 696.el6.x86 64 root znix uname m x86 64 root znix useradd clsn root...