How to check the server load and methods to reduce it?
Methods to check:
1) bash12:~$ w
11:31:50 up 9:15, 8 users, load average: 0.81, 0.90, 0.91
11:31:50 up 9:15, 8 users, load average: 0.81, 0.90, 0.91
2) bash12:~$ top -c
Tasks: 144 total, 2 running, 141 sleeping, 0 stopped, 1 zombie
Cpu(s): 28.7%us, 3.0%sy, 0.0%ni, 68.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 994376k total, 934952k used, 59424k free, 30228k buffers
Swap: 1389580k total, 22568k used, 1367012k free, 385788k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8835 hemanth. 20 0 411m 231m 31m R 24.2 23.9 35:23.63 /usr/local/firefox/firefox-bin
6486 root 20 0 117m 74m 9.9m S 5.6 7.6 24:29.87 /usr/X11R6/bin/X :0 -br -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
7037 hemanth. 20 0 40340 18m 10m S 1.3 1.9 0:47.87 gnome-terminal
10025 hemanth. 20 0 5480 2212 1644 R 1.0 0.2 0:00.08 top -c
Cpu(s): 28.7%us, 3.0%sy, 0.0%ni, 68.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 994376k total, 934952k used, 59424k free, 30228k buffers
Swap: 1389580k total, 22568k used, 1367012k free, 385788k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8835 hemanth. 20 0 411m 231m 31m R 24.2 23.9 35:23.63 /usr/local/firefox/firefox-bin
6486 root 20 0 117m 74m 9.9m S 5.6 7.6 24:29.87 /usr/X11R6/bin/X :0 -br -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
7037 hemanth. 20 0 40340 18m 10m S 1.3 1.9 0:47.87 gnome-terminal
10025 hemanth. 20 0 5480 2212 1644 R 1.0 0.2 0:00.08 top -c
3) MySQL connections
root@host # mysqladmin proc
+----------+------------------+-----------+-------------------+----------------+------+--------------------+------------------+| Id | User | Host | db | Command | Time | State | Info |
+----------+------------------+-----------+-------------------+----------------+------+--------------------+------------------+
| 257799 | sgfishes_fishmar | localhost | sgfishes_fishmart | Sleep | 0 | | |
| 34102304 | DELAYED | localhost | technoph_sethwee | Delayed insert | 3 | Waiting for INSERT | |
| 34104667 | technoph_sethwee | localhost | technoph_sethwee | Sleep | 2 | | |
| 34104674 | lancermo_vb | localhost | lancermo_vb | Sleep | 0 | | |
| 34104675 | root | localhost | | Query | 0 | | show processlist |
+----------+------------------+-----------+-------------------+----------------+------+--------------------+------------------+
4) To check the http connections
root@host [/]# pidof httpd
30457 23992 23660 23659 23658 23657 23656 23655 10035 10028
30457 23992 23660 23659 23658 23657 23656 23655 10035 10028
5) root@host [~]# uptime
14:09:07 up 159 days, 23:39, 2 users, load average: 0.30, 0.44, 0.44
14:09:07 up 159 days, 23:39, 2 users, load average: 0.30, 0.44, 0.44
1 )netstat -plan | grep :80 | awk '{print $5}' | cut -d: -f 1 | sort | uniq -c | sort -n
2) netstat -plan | grep :25 | awk '{print $5}' | cut -d: -f 1 | sort | uniq -c | sort -n
3) pstree -paul
4) cd /tmp
5) rm -f dos-* sess_* .spamassassin*
6) find . -user nobody -exec rm -f '{}' \;
7) ps -C exim -fH ewww
8) ps -C exim -fH eww |grep home
9) netstat -ntu | grep ':' | awk '{print $5}' | awk '{sub("::ffff:","");print}' | cut -f1 -d ':' | sort | uniq -c | sort -n
10) mysqladmin proc |grep Sleep |awk {'print $4'}|cut -d_ -f 1|sort|uniq -c|sort -nk 1
11) ps -C exim -fH ewww
12) for i in `ipcs -s | awk '{print $2}'`; do (ipcrm -s $i); done
13) for i in `mysqladmin proc |grep Sleep |cut -d " " -f 2`; do mysqladmin kill $i; done
14) exim -bp |grep "*** frozen ***" |awk '{print $3}' |xargs exim -Mrm
15) exiqgrep -z -i | xargs exim -Mrm;exiqgrep -o 432000 -i | xargs exim -Mrm
2) netstat -plan | grep :25 | awk '{print $5}' | cut -d: -f 1 | sort | uniq -c | sort -n
3) pstree -paul
4) cd /tmp
5) rm -f dos-* sess_* .spamassassin*
6) find . -user nobody -exec rm -f '{}' \;
7) ps -C exim -fH ewww
8) ps -C exim -fH eww |grep home
9) netstat -ntu | grep ':' | awk '{print $5}' | awk '{sub("::ffff:","");print}' | cut -f1 -d ':' | sort | uniq -c | sort -n
10) mysqladmin proc |grep Sleep |awk {'print $4'}|cut -d_ -f 1|sort|uniq -c|sort -nk 1
11) ps -C exim -fH ewww
12) for i in `ipcs -s | awk '{print $2}'`; do (ipcrm -s $i); done
13) for i in `mysqladmin proc |grep Sleep |cut -d " " -f 2`; do mysqladmin kill $i; done
14) exim -bp |grep "*** frozen ***" |awk '{print $3}' |xargs exim -Mrm
15) exiqgrep -z -i | xargs exim -Mrm;exiqgrep -o 432000 -i | xargs exim -Mrm
No comments:
Post a Comment