Questions tagged [sysctl]

sysctl is a mechanism for controlling options and limits in the Unix-like operating system kernels. Sysctls can be used to tune performance or change behaviors of many subsystems.

Linux:
The sysctl command and configuration file use the /proc filesystem's sys directory to read information and apply changes.

The Linux Journal has an article about using sysctl, but most for the most complete information look to this description of /proc/sys's contents.

BSD-derived:
The sysctl command is used to read and configure certain system settings. The Handbook describes its general use in more detail, and the FreeBSD Performance Tuning Community Wiki has some ideas.

121 questions
133
votes
4 answers

FreeBSD performance tuning: Sysctl parameter, loader.conf, kernel

I wanted to share knowledge of tuning FreeBSD via sysctl.conf / loader.conf / KENCONF / etc. It was initially based on Igor Sysoev's (author of nginx) presentation about FreeBSD tuning up to 100,000-200,000 active connections. Newer versions of…
SaveTheRbtz
  • 5,761
90
votes
3 answers

How does vm.overcommit_memory work?

When I use the default settings: vm.overcommit_memory = 0 vm.overcommit_ratio = 50 I can read these values from /proc/meminfo file: CommitLimit: 2609604 kB Committed_AS: 1579976 kB But when I change vm.overcommit_memory from 0 to 2, I'm…
43
votes
6 answers

Improving TCP performance over a gigabit network with lots of connections and high traffic of small packets

I’m trying to improve my TCP throughput over a “gigabit network with lots of connections and high traffic of small packets”. My server OS is Ubuntu 11.10 Server 64bit. There are about 50.000 (and growing) clients connected to my server through TCP…
Worker
  • 657
22
votes
1 answer

Sane value for net.ipv4.tcp_max_syn_backlog in sysctl.conf

I'm tuning sysctl.conf. According to an optimization guide on linode's website, the following is a sane value to set in sysctl.conf: net.ipv4.tcp_max_syn_backlog = 3240000 However, the same value in an archlinux optimization guide…
Hassan Baig
  • 2,745
  • 14
  • 36
  • 50
18
votes
2 answers

How to get the count of open files by a user in linux

Is their any specific command or tool to get the count of open files by a user in linux?
thanuja
  • 281
17
votes
2 answers

Linux networking port exhaustion

I've done as much research as I could on this without digging right off in the kernel source. There seems to be a large amount of disinformation/incorrect info on the subject, so I hope this answers the question for me and others once and for…
A.B. Carroll
  • 585
  • 1
  • 5
  • 11
16
votes
2 answers

How to reset sysctl to its OS defaults?

I couldn't find an answer in the man pages for sysctl. My sysctl.conf file is still at its default state. I'm testing several values and loaded new settings via sysctl -p newsettings.conf. I thought it would be sufficient for reseting to do sysctl…
Fleshgrinder
  • 3,918
13
votes
3 answers

Where is the correct place to set net.netfilter.nf_conntrack_buckets?

I'm currently trying to set net.netfilter.nf_conntrack_buckets on boot. I initially assumed that this could be done through sysctl.conf, but net.netfilter.nf_conntrack_buckets (and other net.netfilter configurations) were not applied at all. …
KelchM
  • 155
13
votes
4 answers

Suggestions for making sysfs parameters persist across reboots

I'm experimenting with large changes to Linux system runtime parameters exposed through the sysfs virtual file system. What is the most efficient way to maintain these parameters so that they persist across reboots on a RHEL/CentOS-style system? Is…
ewwhite
  • 201,205
12
votes
1 answer

Difference between ulimit, launchctl, sysctl?

When managing the limits of the operating system (specifically OSX), what is the difference and overlap between the functionality and history of these three tools: ulimit launchctl, launchd sysctl I found it confusing to adjust the maximum…
Eric
  • 221
  • 2
  • 3
12
votes
5 answers

Persisting nf_conntrack_max Across Reboots

In /proc I have two entries for nf_conntrack_max: /proc/sys/net/netfilter/nf_conntrack_max /proc/sys/net/nf_conntrack_max The seem to point to the same value as changing one also changes the other. With both of these set in…
Kyle Brandt
  • 85,693
11
votes
4 answers

Kernel Tuning with Privileged Docker Container

I'm building a container to tune kernel settings for a load balancer. I'd prefer to deploy those changes to the host in an image using a single privileged container. For example: docker run --rm --privileged ubuntu:latest sysctl -w…
allingeek
  • 272
11
votes
2 answers

Higher rmem_max value leading to more packet loss

The rmem_max Linux setting defines the size of the buffer that receives UDP packets. When traffic becomes too busy, packet loss starts occurring. I made a graph showing how packet loss increases depending on the incoming bandwidth. (I use IPerf to…
10
votes
2 answers

sysctl: cannot stat /proc/sys/net/ipv4/netfilter/ip_conntrack_max: No such file or directory

I try to change net.ipv4.netfilter.ip_conntrack_max by editing /etc/sysctl.conf net.ipv4.netfilter.ip_conntrack_max = 65535 and sysctl -p But i receive error: sysctl: cannot stat /proc/sys/net/ipv4/netfilter/ip_conntrack_max: No such file or…
M-A-X
  • 215
10
votes
3 answers

Set sysctl.conf parameters with Puppet

This was a breeze in CFEngine... But I'm in a Puppet environment now, and need to be able to assign/ensure/check certain sysctl.conf variables. In the CFEngine world, I could simply check for specific lines within a config file... I've found a small…
ewwhite
  • 201,205
1
2 3
8 9