Objectives: Use utilities such as vmstat, iostat, mpstat, sar, gnome-system-monitor, top, powertop and others to analyze and report system and application behavior Configure systems to provide performance metrics using utilities such as Performance Co-Pilot (PCP) Use the Pluggable Authentication Modules (PAM) mechanism to implement restrictions on critical system resources Use /proc/sys, sysctl and /sys to examine and modify and set kernel run-time parameters Use utilities such as dmesg, dmidecode, x86info, sosreport etc. to profile system hardware configurations Analyze system and application behavior using tools such as ps, strace, top and Valgrind Configure systems to run SystemTap scripts Alter process priorities of both new and existing processes Configure systems to support alternate page sizes for applications that use large amounts of memory Given multiple versions of applications that perform the same or similar tasks, choose which version of the application to run on a system based on its observed performance characteristics Configure disk subsystems for optimal performance using mechanisms such as swap partition placement, I/O scheduling algorithm selection, file system layout and others Configure kernel behavior by altering module parameters Calculate network buffer sizes based on known quantities such as bandwidth and round-trip time and set system buffer sizes based on those calculations Select and configure tuned profiles. Manage system resource usage using control groups systemd ==========================e============================ To show all unit files for services: # systemctl list-unit-files --type=service To show all "targets": # systemctl list-unit-files --type=target # systemctl get-default # systemctl set-default multi-user.target # systemctl list-dependencies multi-user.target View initscript settings for service: # systemctl show nginx.service View logs for service from boot: # journalctl -b -u nginx.service chkconfig --list: # systemctl list-unit-files --type=service (or) ls /etc/systemd/system/*.wants/ Jump to new target/runlevel: # systemctl isolate multi-user.target (OR systemctl isolate runlevel3.target OR telinit 3) Booting into a target: At the GRUB menu, edit the selection to add "systemd.unit=target" (without the double-quotation marks) as a kernel option where target is one of the above. (For example, "rescue.target".) The system's copy of unit files are generally kept in the /lib/systemd/system directory. When software installs unit files on the system, this is the location where they are placed by default. /lib/systemd/system is the RAW originals kept by the system. /etc/systemd/system is where the configured configuration lives ... ie: # ls -al /etc/systemd/system/multi-user.target.wants/ total 8 drwxr-xr-x. 2 root root 4096 Jul 6 07:29 . drwxr-xr-x. 9 root root 4096 May 13 05:44 .. lrwxrwxrwx. 1 root root 35 Apr 5 02:06 atd.service -> /usr/lib/systemd/system/atd.service lrwxrwxrwx. 1 root root 38 Apr 2 03:43 auditd.service -> /usr/lib/systemd/system/auditd.service lrwxrwxrwx. 1 root root 39 Apr 4 06:43 chronyd.service -> /usr/lib/systemd/system/chronyd.service lrwxrwxrwx. 1 root root 37 Apr 2 03:42 crond.service -> /usr/lib/systemd/system/crond.service lrwxrwxrwx. 1 root root 37 Apr 13 08:28 httpd.service -> /usr/lib/systemd/system/httpd.service etc..... Use /proc/sys, sysctl and /sys to examine and modify and set kernel run-time parameters ======================================================= Old way through /etc/sysctl.conf OR /etc/sysctl.d/10-ip_forward.conf New (.d/) Directory Method: [root@client1 sysctl.d]# sysctl -a | grep ip_forward net.ipv4.ip_forward = 0 net.ipv4.ip_forward_use_pmtu = 0 [root@client1 sysctl.d]# sysctl -a | grep "ip_forward " | sed 's/0/1/g' >> /etc/sysctl.d/10-ipforward.conf [root@client1 sysctl.d]# [root@client1 sysctl.d]# sysctl -p /etc/sysctl.d/10-ipforward.conf net.ipv4.ip_forward = 1 [root@client1 sysctl.d]# sysctl -a | grep "ip_forward " net.ipv4.ip_forward = 1 Configure kernel behavior by altering module parameters ======================================================= lsmod --> List currently installed modules modprobe -r --> Remove module modinfo --> Get info on module m Modules located in directory: /lib/modules/$(uname -r)/kernel == Alter module params: Disable a module from being loaded by the kernel: blacklist moduleName >> /etc/modprobe.d/blacklist.conf; OR alias moduleName off >> /etc/modprobe.conf == Alter module parameters: # cat /etc/modprobe.conf alias eth0 e1000 alias eth1 e1000 options e1000 Speed=10,100 Duplex=2,1 To load them on the fly: (Reconfigure e1000 module for 100/half:) modprobe -rv e1000 && modprobe -v e1000 Speed=10 Duplex=1 == If you have the kernel source; you can potentially find more descriptions re: module options: # file /usr/src/linux-2.6.19/drivers/net/e1000/e1000_param.c The blacklist command does not stop a kernel module being loaded manually or as a dependency. The "hard" way to stop a kernel module being loaded completely is via the following: echo "install pppol2tp /bin/true" > /etc/modprobe.d/pppol2tp.conf In order to configure the kernel to automatically load kernel modules, add a file into /etc/sysconfig/modules/X.modules ... ie: /etc/sysconfig/modules/bluez-uinput.modules: #!/bin/sh if [ ! -c /dev/input/uinput ] ; then exec /sbin/modprobe uinput >/dev/null 2>&1 fi