Blog about PostgreSQL and other things
It is possible to personalize the core file name, for example:
echo "core.%e.%p" > /proc/sys/kernel/core_pattern
In order to keep this setting at each boot, you need to set up /etc/sysctl.conf.
kernel.core_pattern = core.%e.%p
The following flags can also be used.
%p: pid
%: '%' is dropped
%%: output one '%'
%u: uid
%g: gid
%s: signal number
%t: UNIX time of dump
%h: hostname
%e: executable filename
Increasing the shared memory that Linux kernel can use might be critical depending on the application used (especially Postgres version prior to 9.3). So add the following lines in /etc/sysctl.conf.
(for 1GB)
kernel.shmall = 262144
kernel.shmmax = 1073741824
(for 2GB)
kernel.shmall = 524288
kernel.shmmax = 2147483648
Only swap +50% of memory that can be handled by applications. Useful to not freeze a laptop when debugging memory allocation problems on an application.
$ cat oom.conf
vm.overcommit_memory = 2
vm.overcommit_ratio = 50
Allow all perf events to be taken.
$ cat perf_settings.conf
kernel.perf_event_paranoid = -1
The Linux kernel comes up with a set of scheduler that can be used to alleviate the I/O behavior on disks and partitions.
It is usually better to stick with the default scheduler except when trying to solve a specific issue, also everything else than cfq would perform badly on non-enterprise class storages (SAN).
On systems facing heavy write load, tuning /etc/sysctl.conf like that is worth doing:
vm.dirty_background_ratio = 0
vm.dirty_ratio = 0
In concurrent heavy-read loads, this setting can be useful for 3.13 kernels.
kernel.sched_autogroup_enabled
Turning off swap entirely may also be worth considering.
Unless otherwise specified, the contents of this website are (C)Copyright Michael Paquier 2010-2026 and are licensed for use under CC BY-NC-ND 4.0.