Skip to content
Boost Linux Server Performance: Essential Kernel and File Limit Tweaks
Operations 3 min read

Boost Linux Server Performance: Essential Kernel and File Limit Tweaks

This guide shows how to increase file descriptor limits, adjust TCP settings, and tune kernel parameters such as net.ipv4.tcp_max_syn_backlog on Linux systems, providing step‑by‑step commands for both individual users and all users to improve network performance and handle more concurrent connections.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations

1. Increase file descriptor limits

For the current shell:

ulimit -n 102400
echo "ulimit -n 102400" >> ~/.bashrc

For all users, edit /etc/security/limits.conf:

* soft nofile 102400
* hard nofile 102400

For the system-wide limit:

cat /proc/sys/fs/file-max
echo 1024000 > /proc/sys/fs/file-max

2. Adjust TCP kernel parameters

Edit /etc/sysctl.conf and add:

net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_conntrack_max = 10240

Apply the changes: sudo sysctl -p 3. Enable TCP TIME_WAIT reuse and recycle

In /etc/sysctl.conf add:

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

Apply immediately: sudo sysctl -p Understanding net.ipv4.tcp_max_syn_backlog

This kernel parameter controls the size of the SYN‑RECEIVED queue, which defaults to 512 or 1024. When the queue is full, the system stops accepting new TCP connections, helping prevent resource exhaustion. Increase it if you need to handle more simultaneous connection attempts.

Example to view the current value: cat /proc/sys/net/ipv4/tcp_max_syn_backlog On CentOS the default is 1024. To raise it, edit /etc/sysctl.conf and set, for example: net.ipv4.tcp_max_syn_backlog = 2048 Then reload:

sudo sysctl -p
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxsysctlkernel-tuningFile LimitsTCP Settings
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.