OS/CentOS

Linux 성능 튜닝

Lawmin 2023. 9. 8. 13:12

[커널 파라미터]
1) /etc/sysctl.conf

 

# IPv6 off

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

 

# file max : total memory / 1024 / 10%

fs.file-max = 65536

 

# Disable IPv6

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

 

# Increase tcp bandwidth
net.core.rmem_default = 253952
net.core.wmem_default = 253952
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 253952 253952 16777216
net.ipv4.tcp_wmem = 253952 253952 16777216


# Increase tcp inbound queue size
net.core.netdev_max_backlog = 30000
net.core.somaxconn = 1024
net.ipv4.tcp_max_syn_backlog = 1024


# Turn on if this server is a proxy-server or client
#net.ipv4.tcp_max_tw_buckets = 1800000
#net.ipv4.tcp_timestamps = 1
#net.ipv4.tcp_tw_reuse = 1

 

# 그외 파라미터 참고

https://meetup.nhncloud.com/posts/55

 

리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기 - 3편 : NHN Cloud Meetup

리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기 - 3편

meetup.nhncloud.com


2) /etc/security/limits.conf
*               soft    core            unlimited
*               hard    core            unlimited
*               soft    nofile          65536
*               hard    nofile          131072
*               soft    nproc           65536
*               hard    nproc           131072