Questions tagged [sysctl]

The tag has no usage guidance.

112
votes
6answers
96k views

Can I configure my Linux system for more aggressive file system caching?

I am neither concerned about RAM usage (as I've got enough) nor about losing data in case of an accidental shut-down (as my power is backed, the system is reliable and the data are not critical). But ...
84
votes
4answers
98k views

How to persistently control maximum system resource consumption on Mac?

Before Mavericks, I could use /etc/launchd.conf file to change maximum system resource consumption, for example: limit maxfiles 16384 unlimited limit maxproc 16384 unlimited It no longer works in ...
61
votes
11answers
115k views

disable transparent hugepages

We are installing SAP HANA in a RAID machine. As part of the installation step, it is mentioned that, To disable the usage of transparent hugepages set the kernel settings at runtime with echo ...
33
votes
2answers
9k views

What is the difference between “all”, “default” and “eth*” in /proc/sys/net/ipv[46]/conf/?

In sysctl, the /proc/sys/net/ipv[46]/conf/ keys have the following subkeys: all, default, and a key for each network interface. For example, on a machine with a single network interface eth0, it will ...
30
votes
3answers
10k views

What is the difference between ping localhost and ping 127.0.0.1?

After executing the following to disable ping replies: # sysctl net.ipv4.icmp_echo_ignore_all=1 # sysctl -p I obtain different results from pinging localhost vs. 127.0.0.1 # ping -c 3 localhost ...
19
votes
3answers
53k views

Finding out the values of kernel options related to sysctl.conf and sysctl.d

On my Ubuntu machine, in /etc/sysctl.conf file, I've got reverse path filtering options commented out by default like this: #net.ipv4.conf.default.rp_filter=1 #net.ipv4.conf.all.rp_filter=1 but in /...
18
votes
2answers
22k views

Description of kernel.printk values

Between Debian 5 and 6, the default suggested value for kernel.printk in /etc/sysctl.conf was changed from kernel.printk = 4 4 1 7 to kernel.printk = 3 4 1 3. I understand that the first value ...
13
votes
1answer
11k views

dmesg: read kernel buffer failed: Permission denied

Since recently Debian has changed the default behavior for dmesg and I cannot use it simply from my local user. % dmesg dmesg: read kernel buffer failed: Operation not permitted Same goes for: % ...
10
votes
2answers
5k views

/proc/sys vs /sys/modules/mod/parameter

I've been wondering for last few days how exactly does it work. We can set kernel runtimes parameters using sysctl or echo boolen 1> /proc/sys/module/exactParameter but in /sys/modules/module/...
10
votes
2answers
7k views

Find out sysctl default values? (without rebooting)

I have modified the value of net.core.rmem_max with sysctl, and now I would like to set it back to its default value. If I reboot, net.core.rmem_max will go back to its default value (because it is ...
7
votes
2answers
2k views

How to limit range of random port sockets?

There's a binary that I need to run which uses bind with a port argument of zero, to get a random free port from the system. Is there a way I can constrain the range of ports the kernel is allowed to ...
7
votes
1answer
4k views

How to set and understand fs.notify.max_user_watches

I don't understand the best way to set fs.inotify.max_user_watches with sysctl. In fact, I don't understand much of what is happening here other than the fact that I need to set the number of files ...
7
votes
1answer
2k views

Pernicious USB-stick stall problem. Reverting workaround fix?

There's an issue with Ubuntu that hasn't been fixed yet, where the PC freezes or gets really slow whenever it is copying to an USB stick (see Why is my PC freezing while I'm copying a file to a ...
6
votes
1answer
7k views

How to enable user_namespaces in the kernel? (For unprivileged `unshare`.)

My Linux kernel must have been configured with user_namespaces when built, but their use is restricted after boot and has to be explicitly enabled. Which sysctl should I use? (If this was turned on, ...
6
votes
1answer
2k views

What's the difference between setting open file limits in /etc/sysctl.conf vs /etc/security/limits.conf?

I've read two separate ways of increasing the allowed open file count (I'm attempting to modify for root, if it matters). One way is to update the settings in /etc/security/limits.conf with something ...
6
votes
1answer
12k views

What is the difference between all and default in kernel setting? [duplicate]

I want to enable reversed path filtering to prevent source ip spoofing on my server. I noticed that I have the following settings at current: net.ipv4.conf.all.rp_filter = 0 net.ipv4.conf.default....
5
votes
1answer
4k views

Benchmarking Apache using ab

I was doing some performance testing for Apache using ab. Apache in our case is only working as a load balancer balancing load between two Liferay servers. Initially, I did the testing for 1000 ...
4
votes
2answers
279 views

Is sysctl.conf last match?

Where can I find the official documentation that sysctl.conf is last match based? So, there are two entries in the /etc/sysctl.conf file: vm.swappiness=10 vm.swappiness=11 Which will win? The ...
4
votes
2answers
5k views

Why is editing core_pattern restricted?

This question is associated with Where is core file with abrt-hook-cpp installed? . While I was trying to generate a core file for an intentionally-crashing program, at first core file generation ...
4
votes
1answer
15k views

sysctl parameter for correct ARP response

I have a server that has some VMs, but the VMs can't communicate properly with the server because the server has several interfaces, and it responds on the wrong one. Q: We know that there is a ...
4
votes
1answer
5k views

What's the right way to set Linux kernel runtime parameters?

What's the prescribed way to set Linux kernel runtime parameters? I've seen sometimes that people will set these in files such as /etc/rc.local. Is this really the right way to do this?
4
votes
1answer
553 views

Difference between modprobe and sysctl -w in terms of setting system parameters?

We know that sysctl command can change kernel parameters with : # sysctl -w kernel.domainname="example.com" or by directly editing the file in /proc/sys directory. And for persistent changes, the ...
4
votes
1answer
989 views

How to limit port range in Ubuntu 14.04?

I want to limit source port range in my ubuntu machine upto 20000 , that means no Application should be able to use port higher than that.I have this command in mind iptables -A OUTPUT -p tcp --...
3
votes
2answers
2k views

Fedora /etc/sysctl.conf not loaded upon boot

I am running Fedora 27 with kernel 4.14.5 and have a problem that /etc/sysctl.conf is not being loaded upon boot. If I run: sudo sysctl -p after boot, my settings are loaded and everything works ...
3
votes
1answer
5k views

cannot read key “net.ipv6.conf.all.stable_secret” in sysctl?

I am running kernel version as followings on an Arch Linux computer: [root@router ~ ]$ uname -a Linux router 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 and I noticed that every time I ...
3
votes
1answer
2k views

Change sysctl parameters for all interfaces

How can i change a parameter for all interfaces in systemd ? For example: sysctl -w "net.ipv4.conf.eth0.rp_filter=0" sysctl -w "net.ipv4.conf.eth1.rp_filter=0" How can change it for all interfaces ...
3
votes
1answer
1k views

Does changing sysctl require a process restart?

I'm on a redhat machine. I'm changing the value of max_map_count via sysctl: # sysctl vm.max_map_count vm.max_map_count = 65530 # sysctl -w vm.max_map_count=655300 vm.max_map_count = 655300 # sysctl ...
3
votes
2answers
2k views

From where does sysctl -a print all kernel parameters?

We have a Linux machine (Redhat 6) When we print all parameters from /etc/sysctl.conf we see only ~20 but when we perform sysctl -a we see more than 200. So from where sysctl -a print all these ...
3
votes
1answer
5k views

File descriptor limits in /etc/system vs /etc/sysctl.conf vs /etc/security/limits.conf on Solaris

Let me explain first what I understood. In Solaris 10, rlim_fd_max and rlim_fd_cur in /etc/system set the hard and soft limits at the system level. And /etc/security/limits.conf sets the limits for ...
3
votes
0answers
2k views

Why is my `net.ipv4.ip_forward = 1`?

I just discovered accidentally that cat /proc/sys/net/ipv4/ip_forward returns 1. I can't remember having enabled net.ipv4.ip_forward anytime ago, but since my system runs for several years now, I can'...
3
votes
0answers
791 views

Gratuitous ARP packet gets not send out even if “arp_notify” in sysctl is set to 1 on OpenWRT

I am running a router on OpenWRT 15.05.1 and I did notice, that it does not send out Gratuitous ARP packets on a change of the IP address, nor on a reboot, nor on change of the Ethernet link state. ...
3
votes
1answer
699 views

Force local IP traffic to go through LAN WITHOUT ip address changes

I know there's some topics about forcing local IP trafic of a Linux machine to go through the LAN (over the network where a WireShark is captuting trafic) but all solutions implies IP address ...
2
votes
1answer
337 views

Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How is this limit calculated?

I have been testing Linux 4.18.16-200.fc28.x86_64. My system has 7.7G total RAM, according to free -h. I have default values for the vm.dirty* sysctl's. dirty_background_ratio is 10, and ...
2
votes
3answers
2k views

net.ipv4.ip_forward reverting to 0 even though set in /etc/sysctl.conf

I set net.ipv4.ip_forward = 1 in /etc/sysctl.conf and ran sysctl -p which caused it to set to 1 as expected in the output of sysctl -a, but sometime between last night and now something set it back to ...
2
votes
1answer
2k views

Why am I unable to attach `strace` to a kworker process?

As root, I try to attach strace to a running kworker process, without success. root@rasal# whoami root root@rasal:/# cat /proc/sys/kernel/yama/ptrace_scope 0 ...
2
votes
1answer
236 views

Managing settings from /sys directory in arch

I can manage /proc directory settings with sysctl and config files in /etc/sysctl.d but is there equivalent tool for the /sys directory? I want to change the I/O scheduler to bfq permanently. Should ...
2
votes
1answer
3k views

Error: permission denied on key 'fs.file-nr'

# sysctl -w fs.file-nr=131072 error: permission denied on key 'fs.file-nr' Same issue when I edit /etc/sysctl.conf and try sysctl -p. Any reason why I cannot edit this value? I am on CentOS 6.5
2
votes
1answer
1k views

Puppet problem with sysctl

Running CentOS 5.5 with Puppet 0.25.5 I have installed and am using the puppet-sysctl module. However the following error occurs: //linux_tuning/Sysctl::Value[net.core.rmem_default] Sysctl[net.core....
2
votes
1answer
150 views

Writeback cache (`dirty`) seems to be limited below the expected threshold where throttling starts. What is it being limited by?

In a previous question and answer, I showed an experiment about dirty_ratio. Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How ...
2
votes
1answer
558 views

editing sysctl.conf on oracle linux 7.5

I am going to install oracle database 12c on oracle linux 7.5. In the process, I have to edit following kernel parameters and set values. fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = ...
2
votes
0answers
69 views

Using a large number of nullfs mounts to create a virtual FS on FreeBSD - what are the practical limits + impacts?

I have a situation where I'm possibly going to create a virtual file system on FreeBSD, comprised entirely of nullfs mounts of selected "ordinary" dirs within my various ZFS datasets (and their ...
2
votes
0answers
235 views

Is there an alternative for net.ipv6.ip_nonlocal_bind on FreeBSD?

On Linux (Kernel >= 4.3) I can "claim" an entire IPv6 subnet by routing it to localhost (sf#403648), and then by setting net.ipv6.ip_nonlocal_bind=1 so that I can bind on any of these addresses. I ...
1
vote
2answers
277 views

sysctl command returning info not asked about

I want to grep a particular kernel setting as follows $ sudo sysctl -a --ignore | grep -i max_map_count 2>/dev/null sysctl: reading key "net.ipv6.conf.all.stable_secret" sysctl: reading key "net....
1
vote
1answer
1k views

lsmod gives error: “could not get list of modules” on Debian running on WSL

When I run lsmod or sudo lsmod, I get an error that says: libkmod: ERROR ../libkmod/libkmod-module.c:1655 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory Error: ...
1
vote
1answer
735 views

Restore part of a package that was accidentally deleted

In the process of trying to fix an issue, I accidentally deleted /sbin/sysctl when I was intending to delete /etc/sysctl.conf. When I run sysctl I get the error that says The program 'sysctl' is ...
1
vote
1answer
18 views

What's the default value of the admin_reserve_kbytes kernel parameter?

Many of the kernel parameters have default values assigned. But some of them aren't really clear. I'm reading the proc manual and in the case of admin_reserve_kbytes we can read the following: The ...
1
vote
1answer
59 views

Less than 1000 possible connections although I updated sysctl

I ran c1000k on my CentOS 7.2 machine and it told me connections: 921 error: Too many open files Because of this I changed my /etc/sysctl.conf to contain this: fs.file-max = 2097152 But even ...
1
vote
1answer
491 views

Can I restrict dmesg to a group?

I understand that, for security reasons (like address randomization), it makes some sense to not let every user be able to read the kernel's dmesg. Linux allows one to restrict dmesg to the root user ...
1
vote
1answer
3k views

Kernel module for net.bridge.bridge-nf-call-iptables

This is on the Linux OS. I see that on some machines the net.bridge.bridge-nf-call-iptables variable doesn't exist until I modprobe the br_netfilter filter. I also see that there are some machines ...
1
vote
1answer
407 views

Sysctl parameter change after every reboot

I have found that the value of net.netfilter.nf_conntrack_count variable change every time i reboot the system. Did any one have an explanation for that?