Table of Contents

Redhat / Centos on server

Rocky Linux / CentOS / Oracle Linux 8

This is a workaround for the `postgresql.service` remaining stuck in status “deactivating”: Create the file `/etc/systemd/system/postgresql.service.d/stop.conf` and put the following contents to it

[Service]
ExecStopPost=+/usr/bin/systemctl daemon-reload

Set Localization

localectl list-locales
localectl set-locale LANG=en_US.UTF-8

Rename ethX network

/etc/udev/rules.d/70-persistent-net.rules

Kernel limits

fs.aio-max-nr = 1048576
fs.file-max = 6815744
fs.inotify.max_user_watches=524288
fs.inotify.max_user_instances = 1024
kernel.sem = 250 320000 100 1280
kernel.shmmax = 4398046511104
kernel.shmmni = 4096
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_challenge_ack_limit = 1048576 // CVE-2016-5389

File limits

/etc/security/limits.d/90-nproc.conf

* soft nofile 102400
* hard nofile 102400
* soft nproc 10240
* hard nproc 10240

set_ulimit

/etc/pam.d/common-session
/etc/pam.d/common-session-noninteractive
/etc/pam.d/login

session required pam_limits.so

Systemd

LimitNOFILE=10000

Change IO Scheduler

/boot/grub/grub.conf

title Red Hat Enterprise Linux Server (2.6.18-8.el5)
	root (hd0,0) 
	kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/sda2 elevator=deadline
	initrd /initrd-2.6.18-8.el5.img

Disable Hugepage

cat /sys/kernel/mm/transparent_hugepage/enabled

grub.conf

transparent_hugepage=never