119
votes
Accepted
Best way to disable swap in Linux
Identify configured swap devices and files with cat /proc/swaps.
Turn off all swap devices and files with swapoff -a.
Remove any matching reference found in /etc/fstab.
Optional: Destroy any swap ...
96
votes
Accepted
How does vm.overcommit_memory work?
You can find the documentation in man 5 proc (or at kernel.org):
/proc/sys/vm/overcommit_memory
This file contains the kernel virtual memory accounting mode.
Values are:
...
59
votes
How can I find out what is causing interrupts on Windows?
After digging through the documentation (based on the other answers here), this is the process I ended up using:
Capture the ETW log of the problem
The easiest way to do this is using the Windows ...
35
votes
Does the "bs" option in "dd" really improve the speed?
What you have done is only a read speed test. if you are actually copying blocks to another device you have pauses in the reading while the other device is accepting the data you want to write, when ...
22
votes
GRUB "Some modules may be missing from core image" warning
I was having the same problem while rebuilding a degraded SW-RAID array, and tripped over this on another website:
The grub-2.00 source where the warning arises is in ./grub-core/disk/diskfilter.c ...
22
votes
GRUB "Some modules may be missing from core image" warning
Had the same thing today. Turns out it's caused by grub-probe trying to access partitions through /dev/sda, which is not cache-coherent with /dev/sda1 (and sda2 etcetera).
You can fix it using
...
21
votes
How does vm.overcommit_memory work?
This is an old question with a well-established answer, but I think there's more to add.
First of all, when vm.overcommit_memory = 0, the vm.overcommit_ratio value is irrelevant. The kernel will use ...
19
votes
Accepted
Why can't QEMU allocate the memory if the Linux caches are too big?
Not all cached data can be discarded immediately. For example, cached dirty pages have to be written back to disk before they can be removed from RAM. You have no swap, so until those writes complete, ...
18
votes
how to tell if NIC has multiqueue enabled?
ethtool -l <interface>
will display the status of queues associated with an interface, if that interface's driver supports such a thing. In ethtool-land, multiqueue is indicated by "channels".
...
17
votes
How do I list loaded Linux module parameter values?
grep -H '' /sys/module/ath9k*/parameters/*
/sys/module/ath9k/parameters/blink:1
/sys/module/ath9k/parameters/bt_ant_diversity:0
/sys/module/ath9k/parameters/btcoex_enable:0
/sys/module/ath9k/...
17
votes
Kernel stack trace to source code lines
I don't have a ~= RHEL5 at hand, so the output shown is from a Fedora 20, though the process should be mostly the same (the name of the function has changed).
You'd need to install the appropriate ...
17
votes
Accepted
Disabling rp_filter on one interface
Info there: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/Documentation/networking/ip-sysctl.txt?h=v4.9#n1090
Note the last sentence that would explain your attempts:
...
15
votes
Prevent the console from clearing the screen?
With systemd things are different. See article Stop Clearing My God Damned Console. In short:
mkdir /etc/systemd/system/getty@.service.d
cat >/etc/systemd/system/getty@.service.d/noclear.conf &...
15
votes
Accepted
Kernel stack trace to source code lines
Given an unstripped vmlinux with debugging symbols (typically included with "linux-devel" or "linux-headers" packages matching your kernel version), you can use the addr2line program included with ...
15
votes
Best way to disable swap in Linux
It used to be that only swap partitions in /etc/fstab were used automatically, however, systemd may be changing that slightly. You might need to do:
systemctl mask dev-sdXX.swap
(change sdXX) to ...
15
votes
Accepted
Why are connections in FIN_WAIT2 state not closed by the Linux kernel?
The kernel timeout only applies if the connection is orphaned. If the connection is still attached to a socket, the program that owns that socket is responsible for timing out the shutdown of the ...
12
votes
Accepted
What is the unit of "mem" and "memory" in /proc/net/sockstat
There seems to be no documentation of this besides the kernel source itself, and I presume you don't want to dig quite that deep.
After digging through several pages of search results I finally found ...
12
votes
Best way to disable swap in Linux
If you are really sure you want to disable swapping (note: this is not recommended, even where you are pretty sure that physical RAM is more than enough), follow these steps:
run swapoff -a: this ...
11
votes
Does the "bs" option in "dd" really improve the speed?
With regards to the internal hard disk, at least -- when you are reading from the device the block layer at least has to retrieve one sector which is 512 bytes.
So, when handling a 1 byte read you've ...
9
votes
How to auto-start Degraded Software RAID1 under Debian 8.0.0 on boot?
The initramfs executes /scripts/local-top/mdadm to handle raid. In that script is the statement
if $MDADM --assemble --scan --run --auto=yes${extra_args:+ $extra_args};
then
verbose && ...
8
votes
Kernel stack trace to source code lines
Install kernel-debuginfo
Download decode_stacktrace.sh which is in the kernel source tree.
Make stack dump output useful again.
# ./decode_stacktrace.sh /usr/lib/debug/lib/modules/`uname -r`/...
8
votes
How to fine tune TCP performance on Linux with a 10Gb fiber connection
In Linux/Intel I would use following methodology for performance analysis:
Hardware:
turbostat
Look for C/P states for cores, frequencies, number of SMIs. [1]
cpufreq-info
Look for current driver, ...
8
votes
How does CPU affinity interact with cgroups in Linux?
From the cpusets documentation:
Calls to sched_setaffinity are filtered to just those CPUs allowed
in that task's cpuset.
This implies that CPU affinity masks are intersected with the cpus in ...
8
votes
Can't run docker-container 'failed to create endpoint frosty_varahamihira on network bridge'
install the linux-modules-extra-raspi package to get the veth module.
7
votes
rm on a directory with millions of files
TLDR: use rsync -a --delete emptyfolder/ x.
This question has 50k views, and quite a few answers, but nobody seems to have benchmarked all the different replies. There's one link to an external ...
7
votes
Accepted
Linux read disk cache and NFS
Answer A8 of the Linux NFS FAQ has an explanation.
A summary: it's up to the client to poll the server to ask for changes (by checking file attributes to see if they've changed since last time the ...
7
votes
kube-proxy won't start in Minikube because of permission denied issue with /proc/sys/net/netfilter/nf_conntrack_max
change maxPerCore to 0 in configMap of kube-proxy to leave the limit as-is and ignore conntrack-min
6
votes
TIME_WAIT consumes file descriptors?
The file descriptor is used by application to read/write from the socket. Thus if the application call close(), the file descriptor is immediately released.
On the other hand, if the application call ...
6
votes
can high load cause server hang and error "blocked for more than 120 seconds"?
sudo sysctl -w vm.dirty_ratio=10
sudo sysctl -w vm.dirty_background_ratio=5
Then commit the change with:
sudo sysctl -p
solved it for me....
6
votes
Accepted
When a socket switch to TIME_WAIT state, why I can't see its inode number?
When the socket is in TIME_WAIT, there is no process attached to it anymore and the kernel is just holding it in case some other packet arrives. At this point, the software the originally opened this ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
kernel × 811linux × 415
centos × 91
ubuntu × 90
debian × 79
redhat × 54
linux-kernel × 48
boot × 42
networking × 34
memory × 27
grub × 27
kernel-panic × 26
xen × 24
kernel-modules × 24
amazon-ec2 × 23
tcp × 22
yum × 22
security × 20
iptables × 20
centos6 × 17
openvz × 17
logging × 15
update × 15
central-processing-unit × 14
centos7 × 13