Performance Tuning

Performance Tuning:
SAR:
[root@rhel6server Desktop]# sar -q | more
Linux 2.6.32-131.0.15.el6.i686 (localhost.localdomain) 08/06/2017 _i686_ (1 CPU)

04:42:09 AM LINUX RESTART

04:50:02 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
05:00:01 AM 0 274 0.16 0.43 0.43
05:10:01 AM 0 279 0.25 0.19 0.27
05:20:01 AM 0 283 2.00 1.18 0.63
05:30:01 AM 0 288 0.31 0.46 0.55

[root@rhel6server Desktop]# mpstat
Linux 2.6.32-131.0.15.el6.i686 (rhel6server) 08/07/2017 _i686_ (1 CPU)

12:36:07 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
12:36:07 AM all 3.53 0.00 4.21 1.44 0.03 0.08 0.00 0.00 90.71
[root@rhel6server Desktop]#

Report I/O and transfer rate statistics:

[root@rhel6server sysconfig]# sar -b
Linux 2.6.32-131.0.15.el6.i686 (rhel6server) 08/07/2017 _i686_ (1 CPU)

12:00:01 AM tps rtps wtps bread/s bwrtn/s
12:10:01 AM 0.28 0.01 0.27 0.22 2.32
12:20:01 AM 4.42 0.00 4.42 0.00 103.29
12:30:02 AM 10.48 0.00 10.48 0.00 185.03
12:40:01 AM 1.66 0.17 1.49 12.81 14.60
Average: 4.22 0.05 4.17 3.26 76.41
[root@rhel6server sysconfig]#

Report network device statistics:

[root@rhel6server sysconfig]# sar -n DEV
Linux 2.6.32-131.0.15.el6.i686 (rhel6server) 08/07/2017 _i686_ (1 CPU)

12:00:01 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
12:10:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:10:01 AM eth0 0.01 0.01 0.00 0.00 0.00 0.00 0.00
12:10:01 AM pan0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:20:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:20:01 AM eth0 1.64 0.93 2.12 0.10 0.00 0.00 0.00
12:20:01 AM pan0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:30:02 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:30:02 AM eth0 2.81 1.95 3.49 0.17 0.00 0.00 0.00
12:30:02 AM pan0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:40:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:40:01 AM eth0 1.48 1.40 0.93 0.23 0.00 0.00 0.00
12:40:01 AM pan0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: eth0 1.49 1.07 1.64 0.12 0.00 0.00 0.00
Average: pan0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
[root@rhel6server sysconfig]#

[root@rhel6server sysconfig]# vim /etc/cron.d/sysstat

[root@rhel6server sysconfig]# vim /etc/sysconfig/sysstat
HISTORY=20

CPU and I/O statstitics for sda
[root@rhel6server sysconfig]# iostat -x sda
Linux 2.6.32-131.0.15.el6.i686 (rhel6server) 08/07/2017 _i686_ (1 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
3.26 0.00 3.95 1.40 0.00 91.39

Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 1.69 11.01 1.10 3.71 73.59 117.72 39.77 0.68 140.60 4.28 2.06

[root@rhel6server sysconfig]#

Shows CPU related stastitics:
[root@rhel6server ~]# mpstat -P 0
Linux 2.6.32-131.0.15.el6.i686 (rhel6server) 08/07/2017 _i686_ (1 CPU)

01:03:07 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
01:03:07 AM 0 3.26 0.00 3.83 1.38 0.03 0.08 0.00 0.00 91.42
[root@rhel6server ~]#

[root@rhel6server ~]# modinfo -p usb_storage
quirks:supplemental list of device IDs and their quirks
delay_use:seconds to delay before using a new device
swi_tru_install:TRU-Install mode (1=Full Logic (def), 2=Force CD-Rom, 3=Force Modem)
option_zero_cd:ZeroCD mode (1=Force Modem (default), 2=Allow CD-Rom

[root@rhel6server ~]# modprobe usb_storage delay_use=2

[root@rhel6server ~]# cd /etc/modprobe.d/
[root@rhel6server modprobe.d]# ll
total 32
-rw-r–r–. 1 root root 52 Jul 16 15:33 anaconda.conf
-rw-r–r–. 1 root root 884 Apr 27 2011 blacklist.conf
-rw-r–r–. 1 root root 382 Aug 10 2010 dist-alsa.conf
-rw-r–r–. 1 root root 5596 Aug 10 2010 dist.conf
-rw-r–r–. 1 root root 473 Aug 10 2010 dist-oss.conf
-rw-r–r–. 1 root root 30 Oct 9 2009 openfwwf.conf
-rw-r–r–. 1 root root 139 Jul 16 15:48 vmware-tools.conf
[root@rhel6server modprobe.d]# dmsg

[root@rhel6server ~]# dmesg | head
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.32-131.0.15.el6.i686 (mockbuild@x86-001.build.bos.redhat.com) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) ) #1 SMP Tue May 10 15:42:28 EDT 2011
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
NSC Geode by NSC
Cyrix CyrixInstead
Centaur CentaurHauls
Transmeta GenuineTMx86
[root@rhel6server ~]#

[root@rhel6server modprobe.d]# lscpu
Architecture: i686
CPU op-mode(s): 32-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
CPU socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 58
Stepping: 9
CPU MHz: 2594.169
BogoMIPS: 5188.33
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
[root@rhel6server modprobe.d]#

[root@rhel6server modprobe.d]# lscpu -p
# The following is the parsable format, which can be fed to other
# programs. Each different item in every column has an unique ID
# starting from zero.
# CPU,Core,Socket,Node,,L1d,L1i,L2,L3
0,0,0,,,0,0,0,0
[root@rhel6server modprobe.d]#

[root@rhel6server ~]# getconf -a | head
LINK_MAX 32000
_POSIX_LINK_MAX 32000
MAX_CANON 255
_POSIX_MAX_CANON 255
MAX_INPUT 255
_POSIX_MAX_INPUT 255
NAME_MAX 255
_POSIX_NAME_MAX 255
PATH_MAX 4096
_POSIX_PATH_MAX 4096
[root@rhel6server ~]#

[root@rhel6server ~]# dmidecode | head -20
# dmidecode 2.10
SMBIOS 2.7 present.
# SMBIOS implementations newer than version 2.6 are not
# fully supported by this version of dmidecode.
239 structures occupying 9763 bytes.
Table at 0x000E0010.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: Phoenix Technologies LTD
Version: 6.00
Release Date: 07/02/2015
Address: 0xEA5E0
Runtime Size: 88608 bytes
ROM Size: 64 kB
Characteristics:
ISA is supported
PCI is supported
PC Card (PCMCIA) is supported
PNP is supported
[root@rhel6server ~]#

[root@rhel6server id]# pwd
/sys/class/dmi/id
[root@rhel6server id]# ll
total 0
-r–r–r–. 1 root root 4096 Aug 6 14:36 bios_date
-r–r–r–. 1 root root 4096 Aug 6 14:36 bios_vendor
-r–r–r–. 1 root root 4096 Aug 6 14:36 bios_version
-r–r–r–. 1 root root 4096 Aug 7 02:00 board_asset_tag
-r–r–r–. 1 root root 4096 Aug 6 14:36 board_name
-r——–. 1 root root 4096 Aug 6 14:36 board_serial
-r–r–r–. 1 root root 4096 Aug 6 14:35 board_vendor
-r–r–r–. 1 root root 4096 Aug 6 14:36 board_version
-r–r–r–. 1 root root 4096 Aug 7 02:00 chassis_asset_tag
-r——–. 1 root root 4096 Aug 7 02:00 chassis_serial
-r–r–r–. 1 root root 4096 Aug 6 14:36 chassis_type
-r–r–r–. 1 root root 4096 Aug 6 14:36 chassis_vendor
-r–r–r–. 1 root root 4096 Aug 7 02:00 chassis_version
-r–r–r–. 1 root root 4096 Aug 7 02:00 modalias
drwxr-xr-x. 2 root root 0 Aug 7 02:00 power
-r–r–r–. 1 root root 4096 Aug 6 14:36 product_name
-r——–. 1 root root 4096 Aug 6 14:36 product_serial
-r——–. 1 root root 4096 Aug 6 14:36 product_uuid
-r–r–r–. 1 root root 4096 Aug 6 14:36 product_version
-r–r–r–. 1 root root 4096 Aug 7 02:00 smbios_version
lrwxrwxrwx. 1 root root 0 Aug 6 14:36 subsystem -> ../../../../class/dmi
-r–r–r–. 1 root root 4096 Aug 6 14:35 sys_vendor
-rw-r–r–. 1 root root 4096 Aug 6 14:35 uevent
[root@rhel6server id]#

List Devices connected to PCI buses in the system
[root@rhel6server id]# lspci | head
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX – 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX – 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
[root@rhel6server id]#

List Devices connected to USB buses in the system
[root@rhel6server id]# lsusb
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc.
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[root@rhel6server id]#

List devices Registered with the HAL Daemon’s database

[root@rhel6server id]# lshal | head

Dumping 144 device(s) from the Global Device List:
————————————————-
udi = ‘/org/freedesktop/Hal/devices/computer’
info.addons = {‘hald-addon-acpi’} (string list)
info.callouts.add = {‘hal-storage-cleanup-all-mountpoints’} (string list)
info.interfaces = {‘org.freedesktop.Hal.Device.SystemPowerManagement’} (string list)
info.product = ‘Computer’ (string)
info.subsystem = ‘unknown’ (string)
info.udi = ‘/org/freedesktop/Hal/devices/computer’ (string)
[root@rhel6server id]#

To collect helpful Diagnostic information for offline troubleshooting:
[root@rhel6server id]# sosreport

sosreport (version 2.2)

This utility will collect some detailed information about the
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is packaged under
/tmp, which you can send to a support representative.
Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY
and it will be considered confidential information.

This process may take a while to complete.
No changes will be made to your system.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [rhel6server]:
Please enter the case number that you are generating this report for: 1

Running plugins. Please wait …

Completed [52/52] …
Creating compressed archive…

Your sosreport has been generated and saved in:
/tmp/sosreport-rhel6server.1-20170807020955-abc9.tar.xz

The md5sum is: d91cc49064648313eee1eb9c29c9abc9

Please send this file to your support representative.

[root@rhel6server id]#

[root@rhel6server ~]# cd /tmp
[root@rhel6server tmp]# tar xvf sosreport-rhel6server.1-20170807020955-abc9.tar.xz

[root@rhel6server tmp]# cd rhel6server-2017080702091502096954
[root@rhel6server rhel6server-2017080702091502096954]# ll
total 44
drwxr-xr-x. 3 root root 4096 Aug 7 02:09 boot
lrwxrwxrwx. 1 root root 37 Aug 7 02:17 chkconfig -> sos_commands/startup/chkconfig_–list
lrwxrwxrwx. 1 root root 25 Aug 7 02:17 date -> sos_commands/general/date
lrwxrwxrwx. 1 root root 27 Aug 7 02:17 df -> sos_commands/filesys/df_-al
lrwxrwxrwx. 1 root root 31 Aug 7 02:17 dmidecode -> sos_commands/hardware/dmidecode
drwxr-xr-x. 33 root root 4096 Aug 7 02:09 etc
lrwxrwxrwx. 1 root root 24 Aug 7 02:17 free -> sos_commands/memory/free
lrwxrwxrwx. 1 root root 29 Aug 7 02:17 hostname -> sos_commands/general/hostname
lrwxrwxrwx. 1 root root 35 Aug 7 02:17 ifconfig -> sos_commands/networking/ifconfig_-a
lrwxrwxrwx. 1 root root 81 Aug 7 02:17 installed-rpms -> sos_commands/rpm/rpm_-qa_–qf_NAME_-_VERSION_-_RELEASE_._ARCH_INSTALLTIME_date_–
lrwxrwxrwx. 1 root root 48 Aug 7 02:17 java -> sos_commands/general/alternatives_–display_java
drwxr-xr-x. 3 root root 4096 Aug 7 02:09 lib
lrwxrwxrwx. 1 root root 25 Aug 7 02:17 lsmod -> sos_commands/kernel/lsmod
lrwxrwxrwx. 1 root root 36 Aug 7 02:17 lsof -> sos_commands/process/lsof_-b_M_-n_-l
lrwxrwxrwx. 1 root root 27 Aug 7 02:17 lspci -> sos_commands/hardware/lspci
lrwxrwxrwx. 1 root root 29 Aug 7 02:17 mount -> sos_commands/filesys/mount_-l
lrwxrwxrwx. 1 root root 38 Aug 7 02:17 netstat -> sos_commands/networking/netstat_-neopa
drwxr-xr-x. 7 root root 4096 Aug 7 02:09 proc
lrwxrwxrwx. 1 root root 30 Aug 7 02:17 ps -> sos_commands/process/ps_auxwww
lrwxrwxrwx. 1 root root 27 Aug 7 02:17 pstree -> sos_commands/process/pstree
drwxr-xr-x. 2 root root 4096 Aug 7 02:09 root
lrwxrwxrwx. 1 root root 32 Aug 7 02:17 route -> sos_commands/networking/route_-n
lrwxrwxrwx. 1 root root 22 Aug 7 02:17 sar02 -> sos_commands/sar/sar02
lrwxrwxrwx. 1 root root 22 Aug 7 02:17 sar04 -> sos_commands/sar/sar04
lrwxrwxrwx. 1 root root 22 Aug 7 02:17 sar07 -> sos_commands/sar/sar07
lrwxrwxrwx. 1 root root 22 Aug 7 02:17 sar30 -> sos_commands/sar/sar30
lrwxrwxrwx. 1 root root 29 Aug 7 02:17 sestatus -> sos_commands/selinux/sestatus
drwxr-xr-x. 29 root root 4096 Aug 7 02:09 sos_commands
drwxr-xr-x. 2 root root 4096 Aug 7 02:09 sos_logs
drwxr-xr-x. 2 root root 4096 Aug 7 02:09 sos_reports
drwxr-xr-x. 4 root root 4096 Aug 7 02:09 sys
lrwxrwxrwx. 1 root root 28 Aug 7 02:17 uname -> sos_commands/kernel/uname_-a
lrwxrwxrwx. 1 root root 27 Aug 7 02:17 uptime -> sos_commands/general/uptime
drwxr-xr-x. 5 root root 4096 Aug 7 02:09 var
[root@rhel6server rhel6server-2017080702091502096954]#

[root@rhel6server rhel6server-2017080702091502096954]# cat uname
Linux rhel6server 2.6.32-131.0.15.el6.i686 #1 SMP Tue May 10 15:42:28 EDT 2011 i686 i686 i386 GNU/Linux
[root@rhel6server rhel6server-2017080702091502096954]#

[root@rhel6server ~]# cd /sys/block/sda/queue/

[root@rhel6server queue]# ls
add_random discard_zeroes_data iostats max_sectors_kb minimum_io_size optimal_io_size rotational
discard_granularity hw_sector_size logical_block_size max_segments nomerges physical_block_size rq_affinity
discard_max_bytes iosched max_hw_sectors_kb max_segment_size nr_requests read_ahead_kb scheduler
[root@rhel6server queue]#

root@rhel6server queue]# cd iosched/
[root@rhel6server iosched]# ll
total 0
-rw-r–r–. 1 root root 4096 Aug 7 02:37 back_seek_max
-rw-r–r–. 1 root root 4096 Aug 7 02:37 back_seek_penalty
-rw-r–r–. 1 root root 4096 Aug 7 02:37 fifo_expire_async
-rw-r–r–. 1 root root 4096 Aug 7 02:37 fifo_expire_sync
-rw-r–r–. 1 root root 4096 Aug 7 02:37 group_idle
-rw-r–r–. 1 root root 4096 Aug 7 02:37 group_isolation
-rw-r–r–. 1 root root 4096 Aug 7 02:37 low_latency
-rw-r–r–. 1 root root 4096 Aug 7 02:37 quantum
-rw-r–r–. 1 root root 4096 Aug 7 02:37 slice_async
-rw-r–r–. 1 root root 4096 Aug 7 02:37 slice_async_rq
-rw-r–r–. 1 root root 4096 Aug 7 02:37 slice_idle
-rw-r–r–. 1 root root 4096 Aug 7 02:37 slice_sync
[root@rhel6server iosched]# cat low_latency
1
[root@rhel6server iosched]# cat group_idle
8
[root@rhel6server iosched]#

[root@rhel6server iosched]# time ls
back_seek_max fifo_expire_async group_idle low_latency slice_async slice_idle
back_seek_penalty fifo_expire_sync group_isolation quantum slice_async_rq slice_sync

real 0m0.032s
user 0m0.000s
sys 0m0.013s
[root@rhel6server iosched]#

ltrace: To view library call stastitics
strace: Information about system call made by process
[root@rhel6server iosched]# yum install ltrace strace

[root@rhel6server iosched]# strace -c uname
Linux
% time seconds usecs/call calls errors syscall
—— ———– ———– ——— ——— —————-
-nan 0.000000 0 1 read
-nan 0.000000 0 1 write
-nan 0.000000 0 3 open
-nan 0.000000 0 5 close
-nan 0.000000 0 1 execve
-nan 0.000000 0 1 1 access
-nan 0.000000 0 3 brk
-nan 0.000000 0 2 munmap
-nan 0.000000 0 1 uname
-nan 0.000000 0 2 mprotect
-nan 0.000000 0 8 mmap2
-nan 0.000000 0 4 fstat64
-nan 0.000000 0 1 set_thread_area
—— ———– ———– ——— ——— —————-
100.00 0.000000 33 1 total
[root@rhel6server iosched]#

[root@rhel6server iosched]# strace -e open iptables -L
open(“/etc/ld.so.cache”, O_RDONLY) = 3
open(“/lib/libip4tc.so.0”, O_RDONLY) = 3
open(“/lib/libxtables.so.4”, O_RDONLY) = 3
open(“/lib/libm.so.6”, O_RDONLY) = 3
open(“/lib/libc.so.6”, O_RDONLY) = 3
open(“/lib/libdl.so.2”, O_RDONLY) = 3
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@rhel6server iosched]# ltrace -c iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
% time seconds usecs/call calls function
—— ———– ———– ——— ——————–
34.31 0.003492 582 6 fwrite
29.33 0.002985 129 23 __printf_chk
10.05 0.001023 1023 1 iptc_init
7.50 0.000763 254 3 iptc_get_policy
3.45 0.000351 117 3 iptc_first_rule
2.90 0.000295 147 2 getopt_long
2.65 0.000270 90 3 iptc_next_chain
2.54 0.000258 64 4 free
1.39 0.000141 141 1 xtables_init_all
1.18 0.000120 120 1 __xpg_basename
1.09 0.000111 111 1 iptc_commit
1.09 0.000111 111 1 iptc_free
1.03 0.000105 105 1 iptc_first_chain
0.77 0.000078 78 1 xtables_free_opts
0.73 0.000074 74 1 __errno_location
—— ———– ———– ——— ——————–
100.00 0.010177 52 total
[root@rhel6server iosched]#

[root@rhel6server iosched]# getconf -a | tail
LEVEL2_CACHE_ASSOC 8
LEVEL2_CACHE_LINESIZE 64
LEVEL3_CACHE_SIZE 3145728
LEVEL3_CACHE_ASSOC 12
LEVEL3_CACHE_LINESIZE 64
LEVEL4_CACHE_SIZE 0
LEVEL4_CACHE_ASSOC 0
LEVEL4_CACHE_LINESIZE 0
IPV6 200809
RAW_SOCKETS 200809
[root@rhel6server iosched]#

[root@rhel6server iosched]# getconf -a | grep -i cache
LEVEL1_ICACHE_SIZE 32768
LEVEL1_ICACHE_ASSOC 8
LEVEL1_ICACHE_LINESIZE 64
LEVEL1_DCACHE_SIZE 32768
LEVEL1_DCACHE_ASSOC 8
LEVEL1_DCACHE_LINESIZE 64
LEVEL2_CACHE_SIZE 262144
LEVEL2_CACHE_ASSOC 8
LEVEL2_CACHE_LINESIZE 64
LEVEL3_CACHE_SIZE 3145728
LEVEL3_CACHE_ASSOC 12
LEVEL3_CACHE_LINESIZE 64
LEVEL4_CACHE_SIZE 0
LEVEL4_CACHE_ASSOC 0
LEVEL4_CACHE_LINESIZE 0
[root@rhel6server iosched]#