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.

113 questions
132
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,621
  • 4
  • 29
  • 45
72
votes
2 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…
Mikhail Morfikov
  • 906
  • 1
  • 10
  • 12
42
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
  • 647
  • 1
  • 6
  • 9
17
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,033
  • 11
  • 27
  • 47
14
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
  • 535
  • 1
  • 4
  • 10
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
  • 1
  • 2
  • 6
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
  • 1
  • 3
12
votes
2 answers

How to reset sysctl to it's OS defaults?

I couldn't find an answer in the man pages for sysctl. My sysctl.conf file is still at it's default state, I'm testing several values and loaded new settings via sysctl -p newsettings.conf. I though it would be sufficient for reseting to do sysctl…
Fleshgrinder
  • 3,638
  • 2
  • 16
  • 19
11
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
  • 194,921
  • 91
  • 434
  • 799
10
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
  • 201
  • 1
  • 2
  • 6
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
  • 216
  • 1
  • 2
  • 5
10
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
  • 262
  • 1
  • 2
  • 10
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
  • 194,921
  • 91
  • 434
  • 799
10
votes
4 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
  • 82,107
  • 71
  • 302
  • 444
9
votes
1 answer

TCP packet being retransmitted 7 times when sysctl tcp_retries1 is set to 3 - why?

Ubuntu 12.04 I am trying to better understand how many times TCP will attempt to retransmit a packet when it does not receive confirmation the destination received it. After reading the tcp man page it seemed clear this is controlled by the sysctl…
HodB
  • 93
  • 1
  • 5
1
2 3 4 5 6 7 8