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.

learn more… | top users | synonyms

101
votes
4answers
140k views

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 ...
25
votes
4answers
58k views

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 ...
14
votes
1answer
9k views

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 ...
10
votes
3answers
9k views

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 ...
8
votes
1answer
780 views

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 ...
7
votes
2answers
9k views

Postgresql Performance - Adjusting SHMMAX and SHMALL

I've read just about everything there is online about improving postgres performance, but the "right" values for SHMMAX and SHMALL still elude me. The consensus seems to be SHMMAX = total_memory/4 ...
7
votes
1answer
1k views

Why change net.inet.tcp.tcbhashsize in FreeBSD?

In virtually every FreeBSD network tuning document I can find: # /boot/loader.conf net.inet.tcp.tcbhashsize=4096 This is usually paired with some unhelpful statement like "TCP control-block hash ...
6
votes
1answer
5k views

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 ...
6
votes
2answers
3k views

Modifying kernel shared memory settings on a lion install

What's the location of the sysctl.conf file on lion? In Snow Leopard it was in /etc/sysctl.conf but now that folder doesn't contain it anymore. Searching for the file in spotlight yields no results. ...
6
votes
4answers
3k views

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 ...
5
votes
1answer
7k views

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 ...
5
votes
3answers
3k views

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 ...
5
votes
2answers
4k views

Netstat -s showing (and growing) “packets pruned from receive queue” and “packets collapsed in receive queue”

we are seeing the following: [root@primary data]# netstat -s | grep buffer ; sleep 10 ; netstat -s | grep buffer 20560 packets pruned from receive queue because of socket buffer overrun ...
5
votes
1answer
2k views

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 ...
5
votes
3answers
3k views

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 ...
4
votes
3answers
87 views
+50

OOM invoked with plenty of free swap

I am running an ARM router with i2p and tor on it - a Netgear R7000. Of course I've added a full 512 MB of SWAP to it to prevent OOMs, understanding that it could slow down the system... But then I ...
4
votes
3answers
3k views

What does tcp_orphan_retries set to 0 mean?

Does setting tcp_orphan_retries to 0 mean there is no limit to retries, or does it mean that it won't retry at all?
4
votes
0answers
202 views

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 ...
3
votes
4answers
11k views

sysctl -p /etc/sysctl.conf returns error

In a fresh installation of CenotOS 6 in a VPS after running sysctl -p /etc/sysctl.conf I got this errors: error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key error: ...
3
votes
2answers
2k views

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 ...
3
votes
1answer
2k views

Permission denied for root to change inotify max_user_watches, how solve this?

As root in a CentOs 6.4 server I got this error in an application: Fri May 16 01:45:23 2014 Error: Terminating since out of inotify watches. Consider increasing /proc/sys/fs/inotify/max_user_watches ...
3
votes
1answer
2k views

Increasing FreeBSD threads

For network apps that create one thread per connection (like Pound), threadcount can become a bottleneck on the number of concurrent connections you can server. I'm running FreeBSD 8 x64: $ sysctl ...
2
votes
4answers
4k views

After reboot debian box ignore sysctl.conf values

Where is right place for sysctl redefined values? I have: > uname -a Linux note 3.1.0-1-amd64 #1 SMP Tue Jan 10 05:01:58 UTC 2012 x86_64 GNU/Linux > cat /etc/debian_version wheezy/sid ...
2
votes
3answers
3k views

sysctl.conf not running on boot

At what point is sysctl.conf supposed to be read during boot, and why might it not be running? I have the following settings which are not being applied when I reboot: ...
2
votes
1answer
1k views

Optimize linux for serving http static content

What would be the system tunables to enhance serving static content? Like increase/decrease swappines, how to max out disk caching and so on...
2
votes
1answer
142 views

How do you change tcp_congestion_control on OpenVZ?

I have a network of OpenVZ machines that I am testing various congestion control methods on. I need to know how to change the congestion control. Currently I get nothing but permission denied. Is it ...
2
votes
1answer
2k views

No buffer space available and tuning with sysctl

Not really a network guy so please bear with me. I'm currently hosting a web application that sends UDP to all IP addresses in it's subnet periodically. That's 2048 IPs. My problem is it throws No ...
2
votes
1answer
4k views

nf_conntrack: table full, dropping packet

Mar 24 03:29:26 kernel: [1557411.243821] TCP: time wait bucket table overflow (CT0) Mar 24 03:29:26 kernel: [1557411.243828] TCP: time wait bucket table overflow (CT0) Mar 24 03:29:26 kernel: ...
2
votes
2answers
1k views

Xserve 10.6.8: Why do `net.inet.ip.forwarding` & `net.inet.ip.fw.enable` kernel sysctl settings stay enabled even disabling?

Very bizarre situation. I have inherited a few Xservers from a previous admin that I have been charged with cleaning up on various levels. I am familiar with settings in Ubuntu & am very ...
2
votes
2answers
3k views

How to make setting of kern.ipc.somaxconn persistent?

Want to rise value of kern.ipc.somaxconn With sysctl works ok $ sudo sysctl kern.ipc.somaxconn=2048 $ kern.ipc.somaxconn: 128 -> 2048 check it: $ sysctl -a|grep somaxconn ...
1
vote
1answer
3k views

Linux webhost security settings in /etc/sysctl.conf

While searching for more ways to secure Linux servers, I found the following /etc/sysctl.conf configuration. It came as is, without much explanation. Before using it on production environment (using ...
1
vote
1answer
2k views

net.ipv6.conf.all.forwarding = 1 is an unknown key

I have few system with ipv6 addresses. I want to forward request from one system to another. hence I kept the option net.ipv6.conf.all.forwarding = 1 in sysctl.conf but the request is not getting ...
1
vote
2answers
2k views

Writeback cache in linux

In linux how do I have a writeback cache on disks? Basically, I'd like to setup a 100MB RAM cache for writing that writes out every 3-5 minutes or when full. Is this possible? Is there a sysctl ...
1
vote
2answers
2k views

SYN Cookies on a LAN server - Ok / advisable to disable?

We are looking at tuning our linux tcp stack on one of our lan boxes. We were wondering if it is ok / advisable to disable SYN cookies on a server that doesnt have any sort of external (eg: ...
1
vote
4answers
6k views

Persistent changes to /proc/sys/sunrpc/tcp_slot_table_entries

I'm trying to make a persistent change to sunrpc.tcp_slot_table_entries on a Linux CentOS 5.5. This value has been found important for the performance of our NFS clients, and must be set before the ...
1
vote
1answer
2k views

File-descriptors setting on /etc/sysctl.conf

I have recently learnt that to be able to increase the amount of virtualhosts that we can serve via Apache depends on file-descriptors. they say the value should be added to /etc/sysctl.conf as ...
1
vote
1answer
775 views

net.inet.tcp.blackhole option on Fedora

This link of freebsdblog.org suggests a configuration option for FreeBSD that tells the system to drop all packages arriving from the network to a closed port and thus somewhat securing your system ...
1
vote
1answer
132 views

Slow POST upload (Linux kernel Tuning)

I'm working in a Caucho Resin backend with an HAproxy configured in front of them, in a dedicated server. Now I'm dealing with a file upload problem. Our web application allows a file upload for ...
1
vote
1answer
816 views

Is there a location of the sysctl kernel parameters for osX?

I would like to read up on os X kernel parameters. I can find them listed, but where can I find the meaning of them? For example this parameter net.alf.loglevel: 55 which are not in the man ...
1
vote
1answer
5k views

Sysctl config for high performance, large activity

We have some server with a huge amount of visitors (every minute, every day). Basically we had a nice fine-tuned sysctl config for this purpose. (If you don't modify it, it starts to behave ...
1
vote
0answers
56 views

How to learn max/min value of a sysctl parameter can be in FreeBSD?

I have a simple question. I want to learn max/min value of a sysctl parameter can be. Where can I find bounds of these parameters? Thanks
1
vote
1answer
1k views

How to make sysctl network bridge settings persist after a reboot?

I am setting up a notebook for software demo purpose. The machine has 8GB RAM, a Core i7 Intel CPU, a 128GB SSD, and runs Ubuntu 12.04 LTS 64bit. The notebook is used as a KVM host and runs a few KVM ...
0
votes
3answers
5k views

Shared memory: shmget fails: No space left on device — how to increase limits?

I call shmget many times in my program, to get shm of of average size 85840 bytes. I obtain about 32771 shm ok, then shmget doesn't return a shm, but the error: "No space left on device". I have ...
0
votes
2answers
6k views

error: “net.ipv4.netfilter.ip_conntrack_max” is an unknown key

I have a problem on Ubuntu 10.04.3 LTS x64 with sysctl net.ipv4.netfilter.ip_conntrack_max . If I run this command on shell, I get back an error: error: net.ipv4.netfilter.ip_conntrack_max" is an ...
0
votes
2answers
784 views

Recommended TCP keepalive settings for a busy server

We are having some network timeout issues on a Debian server that is quite busy, and maintains multiple connections to a number of other servers on the network. Here are our current TCP keepalive ...
0
votes
2answers
762 views

Should rp_filter sysctl parameter be set on bonding master or member slaves?

I have a server running RHEL6.4. I need to configure .rp_filter sysctl parameter for my server's private interconnect. This server has 2 NICs bonded together. I looked through the documentation and ...
0
votes
1answer
2k views

error: “net.netfilter.nf_conntrack_acct” is an unknown key

I have the this error when I run sysctl -p in Debian 5.0.8. error: "net.netfilter.nf_conntrack_acct" is an unknown key My sysctl configuration net.netfilter.nf_conntrack_acct = 1 ...
0
votes
1answer
1k views

How to enable core files on CentOS 6

I am trying to enable core files on a machine running CentOS 6; however, nothing I have tried has produced core files…here is what I have done: Added the following two lines to ...
0
votes
1answer
150 views

Permission denied when setting values in sysctl on Ubuntu 12.04

I am trying to configure my Ubuntu 12.04 VPS (OpenVZ) to reboot when it runs out of memory. To do this I have added following lines to my "/etc/sysctl.conf" file. vm.panic_on_oom = 1 kernel.panic = ...
0
votes
2answers
446 views

Networking (dhcpcd) under LXC

I would like to boot an Arch Linux instance using LXC. Just about everything works, but I'm encountering the following error when trying to configure an interface using dhcpcd: # dhcpcd eth0 ...