The sysctl is a Unix interface used to modify variables that the kernel uses to determine behavior. There are two ways to work with sysctl: by directly reading and modifying files in /proc/sys and by using the sysctl program supplied with most distributions. The regedit interface is the closest parallel for Windows.
Questions tagged [sysctl]
174 questions
26
votes
2 answers
Solving Redis warnings on overcommit_memory and Transparent Huge Pages for Ubuntu 16.04 on EC2
On a fresh Ubuntu 16.04 EC2 instance the warnings appear like so:
WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run…

legel
- 2,507
- 3
- 23
- 22
25
votes
3 answers
Cannot run sysctl command in Dockerfile
I'm trying to make my first dockerfile(I'm new to this), and I need the system to run the command sysctl -w kernel.randomize_va_space=0 (its an lab env.), but I get the error:
sysctl: setting key "kernel.randomize_va_space": Read-only file
…

neorus
- 477
- 1
- 6
- 19
24
votes
7 answers
Refresh net.core.somaxcomm (or any sysctl property) for docker containers
I am trying to change net.core.somaxconn for docker container to be able to have larger queue of requests for my web application.
On OS, outside docker, I first modify the property successfully:
$ cat /proc/sys/net/core/somaxconn
128
$ sudo sysctl…

Tuukka Mustonen
- 4,722
- 9
- 49
- 79
24
votes
2 answers
Disable and re-enable address space layout randomization only for myself
I would like to disable address space layout randomization (ASLR) on my system (Ubuntu Gnu/Linux 2.6.32-41-server), but, if I use
sysctl -w kernel.randomize_va_space=0
the change would affect all users on the system, I presume. (Is this true?) …

Amittai Aviram
- 2,270
- 3
- 25
- 32
13
votes
2 answers
Permanent fix to tail: cannot watch `log/development.log': No space left on device
I've been using Ubuntu 11.10 for a little over a week now. But after some time I encountered this error(the one in the title) when Im trying to access the log in my RoR project. I found a fix which is by pasting this in the terminal:
sudo sysctl…

Normz
- 271
- 1
- 2
- 9
13
votes
2 answers
Need to "calculate" optimum ulimit and fs.file-max values according to my own server needs
Need to "calculate" optimum ulimit and fs.file-max values according to my own server needs.
Please do not conflict with "how to set those limits in various Linux distros" questions.
I am asking:
Is there any good guide to explain in detail,…

Kunthar
- 472
- 1
- 5
- 15
13
votes
1 answer
Detect which app is currently running on iOS using sysctl
I have currently implemented a simple activity monitor to watch all running processes on iOS.
To retrieve a list of all running processes, I do this:
size_t size;
struct kinfo_proc *procs = NULL;
int status;
NSMutableArray *killedProcesses =…

hackerdiehack
- 372
- 3
- 11
12
votes
1 answer
Invalid argument" setting key "net.core.somaxconn"
I tried setting Linux kernel. After editing /etc/sysctl.conf and executing the sysctl -p
it shows error
Invalid argument" setting key "net.core.somaxconn"
Linux distribution: Ubuntu 12.04.4 LTS, x86_64, 3.2.0-60-generic
$ cat…

linbo
- 2,393
- 3
- 22
- 45
11
votes
1 answer
Can I use `sysctl` to retrieve a process list with the user?
I am in need of a way to retrieve all running processes for all users on a Mac (using Cocoa). I found an implementation to retrieve the process using sysctl, but I also need the running user. This is a snipping of what I've got to get the process…

bugfixr
- 7,997
- 18
- 91
- 144
10
votes
1 answer
What does '|' mean in file /proc/sys/kernel/core_pattern?
$ cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport %p %s %c %d %P
What does '|' mean in file /proc/sys/kernel/core_pattern?

Ren
- 2,852
- 2
- 23
- 45
10
votes
8 answers
Monitoring network usage excluding local traffic
I am working on an app that monitors network usage. However I noticed many ways to do this does not allow exclusion of local traffic (say, Time Machine).
I am looking for a way to exclude local traffic, and only monitors usage that goes directly…

koo
- 2,888
- 1
- 23
- 29
8
votes
2 answers
How to get maximum TCP Receive/Send window in MAC OS X?
How to get maximum TCP Receive/Send window in MAC OS X?
There are two ctl in Linux.
/proc/sys/net/core/rmem_max - Maximum TCP Receive Window (NET_CORE_RMEM_MAX)
/proc/sys/net/core/wmem_max - Maximum TCP Send Window (NET_CORE_WMEM_MAX)
but i…

Vlad
- 2,090
- 3
- 21
- 37
8
votes
2 answers
Does anybody know equivalent for NETLINK Sockets API for MAC OS X?
Does anybody know equivalent for NETLINK Sockets API for MAC OS X ?
I am trying to port Linux application to MAC OS X and I couldn’t find anything similar in MACOS.
I need to provide asynchronous access to the network adapter in my…

Vlad
- 2,090
- 3
- 21
- 37
8
votes
2 answers
Linux parameters sysctl list of the Linux kernel and its explanation
Does anyone know where I can find a parameters list of sysctl for the linux kernel and its explanation?
I've searched for it and have found nothing. I looked in the kernel headers too with the same result.

Emilio Granados
- 101
- 1
- 1
- 5
7
votes
1 answer
iOS cpu usage for each process using sysctl()?
Is there a way to get cpu usage for each process using sysctl() ?
I'm trying to find a way to detect the launch of a specific application. It seems there's no way to get foreground running app information. So I guess if I can monitor cpu usage for…

Rukshan
- 7,902
- 6
- 43
- 61