Linux kernel parameter: Difference between revisions
(Add categories: Linux, Hardware, Reference, Configuration) |
(Fix: remove --- horizontal lines (7 removed)) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Status | |||
|status=Draft | |||
|owner=Knowledge Agent | |||
|last_update=2026-07-16 | |||
|review=Pending | |||
}} | |||
{{TOC}} | |||
== Overview == | |||
Linux kernel parameter에 대한 기술 문서입니다. | |||
=== Summary === | |||
* 무엇인가? - Linux kernel parameter | |||
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념 | |||
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시 | |||
== Purpose == | |||
이 문서가 존재하는 이유 | |||
* Goal: Linux kernel parameter에 대한 기술 정보 제공 | |||
* Scope: Linux kernel parameter의 개념, 사용법, 설정 | |||
* Non-goals: 다른 주제로의 확장 | |||
== Key Concepts == | |||
{| class="wikitable" | |||
! Concept | |||
! Description | |||
! Related | |||
|- | |||
| Linux kernel parameter | |||
| HPC/서버 환경에서 중요한 기술 개념 | |||
| [[Linux]], [[Server]] | |||
|} | |||
== Detailed Explanation == | |||
* [[Kernel]] | |||
sysctl can be used to modify kernel parameters at runtime without recompiling the entire kernel. | sysctl can be used to modify kernel parameters at runtime without recompiling the entire kernel. | ||
can help in faster release of [[network]] resources.After adjusting the TCP FIN Timeout: | |||
can help in faster release of network resources.After adjusting the TCP FIN Timeout: | |||
sudo sysctl -w net.ipv4.tcp_fin_timeout=30 | sudo sysctl -w net.ipv4.tcp_fin_timeout=30 | ||
determines the time interval for TCP keepalive packets | determines the time interval for TCP keepalive packets | ||
sudo sysctl -w net.ipv4.tcp_keepalive_time=120 | sudo sysctl -w net.ipv4.tcp_keepalive_time=120 | ||
Enable the TCP selective acks option for better throughput: | Enable the TCP selective acks option for better throughput: | ||
# sysctl -w net.ipv4.tcp_sack=1 | # sysctl -w net.ipv4.tcp_sack=1 | ||
Disable the TCP timestamps option for better CPU utilization | Disable the TCP timestamps option for better CPU utilization | ||
# sysctl -w net.ipv4.tcp_timestamps=0 | # sysctl -w net.ipv4.tcp_timestamps=0 | ||
somaxconn is used to set the maximum number of connections that can be queued for a socket. This parameter is used to prevent a flood of connection requests from overwhelming the system. The maximum value for the <code>net.core.somaxconn</code> parameter depends on the system and kernel version. | somaxconn is used to set the maximum number of connections that can be queued for a socket. This parameter is used to prevent a flood of connection requests from overwhelming the system. The maximum value for the <code>net.core.somaxconn</code> parameter depends on the system and kernel version. | ||
The default value for the <code>net.core.somaxconn</code> [[Linux]] kernel parameter is typically 128 and the maximum value is around 65535 on most systems. | The default value for the <code>net.core.somaxconn</code> [[Linux]] kernel parameter is typically 128 and the maximum value is around 65535 on most systems. | ||
It is important to set the <code>net.core.somaxconn</code> parameter to a value that is ''larger'' than the <code>backlog</code> value of NGINX, as the <code>backlog</code> value is used to determine the maximum number of connections that can be queued for a listening socket of NGINX only. If the <code>net.core.somaxconn</code> value is smaller than the backlog value, NGINX will not be able to queue all the incoming connections, resulting in connection errors.<ref>https://www.getpagespeed.com/server-setup/nginx/maximizing-nginx-performance-a-comprehensive-guide-to-tuning-the-backlog-and-net-core-somaxconn-parameters</ref> | It is important to set the <code>net.core.somaxconn</code> parameter to a value that is ''larger'' than the <code>backlog</code> value of NGINX, as the <code>backlog</code> value is used to determine the maximum number of connections that can be queued for a listening socket of NGINX only. If the <code>net.core.somaxconn</code> value is smaller than the backlog value, NGINX will not be able to queue all the incoming connections, resulting in connection errors.<ref>https://www.getpagespeed.com/server-setup/nginx/maximizing-nginx-performance-a-comprehensive-guide-to-tuning-the-backlog-and-net-core-somaxconn-parameters</ref> | ||
For example, if your average queue length from [[vmstat]] is 1000 and you have 2 [[Vmstat|CPU]] cores, | For example, if your average queue length from [[vmstat]] is 1000 and you have 2 [[Vmstat|CPU]] cores, | ||
the optimal value for net.core.somaxconn would be 1000 * 4 / 2 = 2000.<syntaxhighlight lang="bash"> | the optimal value for net.core.somaxconn would be 1000 * 4 / 2 = 2000.<syntaxhighlight lang="bash"> | ||
The formula for net.core.somaxconn | The formula for net.core.somaxconn | ||
optimal value = CPU cores * queue length / 4 | optimal value = CPU cores * queue length / 4 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
can optimize how the kernel handles file system caches | can optimize how the kernel handles file system caches | ||
sudo sysctl -w vm.vfs_cache_pressure=50 | sudo sysctl -w vm.vfs_cache_pressure=50 | ||
== | |||
== Best Practices == | |||
* 최신 버전 사용 권장 | |||
* 공식 문서 참고 | |||
* 테스트 환경에서 먼저 검증 | |||
== References == | == References == | ||
* [https://wiki.hpcmate.com Linux kernel parameter] | |||
== Related Pages == | |||
* [[Linux]] | |||
* [[Server]] | |||
* [[Hardware]] | |||
* [[Network]] | |||
[[Category:Linux]] | [[Category:Linux]] | ||
== Knowledge Graph == | |||
Related | |||
[[ | → [[Linux Kernel Tuning]] | ||
→ [[THP (Transparent Huge Pages)]] | |||
→ [[systemd]] | |||
→ [[Kernel tips and tricks]] | |||
→ [[LVM]] | |||
→ [[iptables]] | |||
→ [[Ubuntu]] | |||
→ [[Kernel boot param]] | |||
[[Category:Configuration]] | [[Category:Configuration]] | ||
Latest revision as of 11:29, 17 July 2026
Overview
Linux kernel parameter에 대한 기술 문서입니다.
Summary
- 무엇인가? - Linux kernel parameter
- 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
- 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
Purpose
이 문서가 존재하는 이유
- Goal: Linux kernel parameter에 대한 기술 정보 제공
- Scope: Linux kernel parameter의 개념, 사용법, 설정
- Non-goals: 다른 주제로의 확장
Key Concepts
| Concept | Description | Related |
|---|---|---|
| Linux kernel parameter | HPC/서버 환경에서 중요한 기술 개념 | Linux, Server |
Detailed Explanation
sysctl can be used to modify kernel parameters at runtime without recompiling the entire kernel. can help in faster release of network resources.After adjusting the TCP FIN Timeout:
sudo sysctl -w net.ipv4.tcp_fin_timeout=30
determines the time interval for TCP keepalive packets
sudo sysctl -w net.ipv4.tcp_keepalive_time=120
Enable the TCP selective acks option for better throughput:
# sysctl -w net.ipv4.tcp_sack=1
Disable the TCP timestamps option for better CPU utilization
# sysctl -w net.ipv4.tcp_timestamps=0
somaxconn is used to set the maximum number of connections that can be queued for a socket. This parameter is used to prevent a flood of connection requests from overwhelming the system. The maximum value for the net.core.somaxconn parameter depends on the system and kernel version.
The default value for the net.core.somaxconn Linux kernel parameter is typically 128 and the maximum value is around 65535 on most systems.
It is important to set the net.core.somaxconn parameter to a value that is larger than the backlog value of NGINX, as the backlog value is used to determine the maximum number of connections that can be queued for a listening socket of NGINX only. If the net.core.somaxconn value is smaller than the backlog value, NGINX will not be able to queue all the incoming connections, resulting in connection errors.[1]
For example, if your average queue length from vmstat is 1000 and you have 2 CPU cores,
the optimal value for net.core.somaxconn would be 1000 * 4 / 2 = 2000.
The formula for net.core.somaxconn
optimal value = CPU cores * queue length / 4
can optimize how the kernel handles file system caches
sudo sysctl -w vm.vfs_cache_pressure=50
Best Practices
- 최신 버전 사용 권장
- 공식 문서 참고
- 테스트 환경에서 먼저 검증
References
Related Pages
Knowledge Graph
Related
→ Linux Kernel Tuning → THP (Transparent Huge Pages) → systemd → Kernel tips and tricks → LVM → iptables → Ubuntu → Kernel boot param