Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

負荷、ログ解析をしてみる #2

Open
fr-sasaki opened this issue Jun 3, 2013 · 5 comments
Open

負荷、ログ解析をしてみる #2

fr-sasaki opened this issue Jun 3, 2013 · 5 comments

Comments

@fr-sasaki
Copy link
Owner

https://github.com/fact-real/developers/wiki/%E9%96%8B%E7%99%BA%E7%A0%94%E4%BF%AE-Linux#-5

@fr-sasaki
Copy link
Owner Author

https://github.com/fact-real/developers/wiki/%E9%96%8B%E7%99%BA%E7%A0%94%E4%BF%AE-Linux#1

ロードアベレージ

sar -q

runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
15時10分01秒 0 725 0.07 0.13 0.51
15時20分01秒 0 717 0.44 0.52 0.49
15時30分01秒 0 716 0.16 0.33 0.44
15時40分01秒 0 724 0.71 0.25 0.30
15時50分01秒 0 714 0.35 0.24 0.28
16時00分01秒 0 717 0.08 0.04 0.14
16時10分01秒 0 716 0.04 0.03 0.07
16時20分01秒 0 717 0.00 0.00 0.02
16時30分01秒 0 723 2.01 1.31 0.55
平均値: 0 675 0.13 0.13 0.12

cpu負荷など

sar -P ALL

CPU %user %nice %system %iowait %steal %idle
16時30分01秒 all 1.13 0.00 0.30 3.59 0.00 94.99
16時30分01秒 0 1.42 0.00 0.45 0.29 0.00 97.83
16時30分01秒 1 0.84 0.00 0.37 0.20 0.00 98.60
16時30分01秒 2 2.75 0.00 0.20 0.02 0.00 97.02
16時30分01秒 3 1.89 0.00 0.34 26.63 0.00 71.15
16時30分01秒 4 0.37 0.00 0.28 0.00 0.00 99.35
16時30分01秒 5 0.35 0.00 0.21 0.08 0.00 99.36
16時30分01秒 6 0.76 0.00 0.25 0.33 0.00 98.66
16時30分01秒 7 0.62 0.00 0.27 1.14 0.00 97.96

16時30分01秒のロードアベレージが上がっている。
原因はディスクI/O

@fr-sasaki
Copy link
Owner Author

https://github.com/fact-real/developers/wiki/%E9%96%8B%E7%99%BA%E7%A0%94%E4%BF%AE-Linux#2

sar -W

kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit
16時50分01秒 985064 31796964 97.00 671944 23396528 6209420 16.79
17時00分01秒 968236 31813792 97.05 671988 23400676 6217780 16.82
17時10分01秒 967588 31814440 97.05 672356 23402400 6214648 16.81

17時10分01秒について見ると
空きメモリ容量:967588[KB]
メモリ使用率:97.05%

@fr-sasaki
Copy link
Owner Author

https://github.com/fact-real/developers/wiki/%E9%96%8B%E7%99%BA%E7%A0%94%E4%BF%AE-Linux#3

top

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6106 hirano 20 0 231m 21m 13m S 7.3 0.1 1:08.20 smbd
41 root 20 0 0 0 0 S 1.0 0.0 140:57.91 events/6
10047 sato 20 0 42904 20m 1276 S 0.7 0.1 11:05.92 tmux
13735 suenami 20 0 15528 1800 956 S 0.7 0.0 71:47.77 top
2623 ueda 20 0 104m 82m 980 S 0.3 0.3 36:39.29 tmux
8391 okamoto 20 0 15500 1400 596 S 0.3 0.0 143:31.80 top
12456 sasaki 20 0 15428 1668 952 S 0.3 0.0 0:14.25 top
13749 root 20 0 0 0 0 S 0.3 0.0 0:53.85 flush-8:0
16340 suenami 20 0 53388 30m 952 S 0.3 0.1 28:32.67 tmux
18807 kuwanou 20 0 1405m 141m 8960 S 0.3 0.4 2:28.91 ruby
32325 suenami 20 0 157m 12m 2816 S 0.3 0.0 0:52.31 vim
32600 suenami 20 0 97864 1988 1036 S 0.3 0.0 0:02.41 sshd

ps aux |grep 6106

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
hirano 6106 0.3 0.0 238260 22848 ? S 11:09 1:12 smbd -D
kuwanou 26106 0.0 0.0 108960 2464 pts/108 Ss+ 14:43 0:00 -bash
sasaki 28282 0.0 0.0 107460 944 pts/158 S+ 17:34 0:00 grep 6106

@fr-sasaki
Copy link
Owner Author

https://github.com/fact-real/developers/wiki/%E9%96%8B%E7%99%BA%E7%A0%94%E4%BF%AE-Linux#4

df -h

Filesystem Size Used Avail Use% マウント位置
/dev/sda3 2.7T 618G 2.0T 24% /
tmpfs 16G 0 16G 0% /dev/shm
/dev/sda1 504M 131M 349M 28% /boot
/dev/sdb1 470G 21G 426G 5% /extra

残り容量
/dev/sda3:2.0T
/dev/sda1:349M
/dev/sdb1:426G

@fr-sasaki
Copy link
Owner Author

https://github.com/fact-real/developers/wiki/%E9%96%8B%E7%99%BA%E7%A0%94%E4%BF%AE-Linux#5

cat access_log |grep '[01/Jan/2010:22:01:04 +0900]'

192.168.0.64 - - [04/Apr/2013:13:36:08 +0900] "GET / HTTP/1.1" 200 44
192.168.0.64 - - [04/Apr/2013:13:36:08 +0900] "GET /favicon.ico HTTP/1.1" 404 209
192.168.0.64 - - [04/Apr/2013:13:45:27 +0900] "GET / HTTP/1.1" 304 -
192.168.0.64 - - [04/Apr/2013:13:45:27 +0900] "GET /favicon.ico HTTP/1.1" 404 209
192.168.0.64 - - [04/Apr/2013:14:23:52 +0900] "GET / HTTP/1.1" 304 -
192.168.0.64 - - [04/Apr/2013:14:23:52 +0900] "GET /favicon.ico HTTP/1.1" 404 209
192.168.0.64 - - [04/Apr/2013:17:31:12 +0900] "GET / HTTP/1.1" 304 -
192.168.0.64 - - [04/Apr/2013:17:31:12 +0900] "GET /favicon.ico HTTP/1.1" 404 209
192.168.0.64 - - [04/Apr/2013:19:19:30 +0900] "GET /test.php HTTP/1.1" 200 17
192.168.0.64 - - [04/Apr/2013:19:23:31 +0900] "GET / HTTP/1.1" 200 44

cat access_log |grep '/index.html'

192.168.0.77 - - [16/Apr/2013:17:42:05 +0900] "GET /index.html HTTP/1.1" 200 9582
192.168.0.77 - - [25/Apr/2013:11:54:12 +0900] "GET /index.html HTTP/1.1" 200 9582
192.168.0.116 - - [14/May/2013:13:27:11 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:21 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:22 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:25 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:26 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:26 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:26 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403
192.168.0.116 - - [14/May/2013:13:27:27 +0900] "GET /~kuwanou/index.html HTTP/1.1" 403

cat access_log |awk '{print $7}' |sort |uniq -c |sort -r |head -10

9643 /smart_a/eye-fi/area/test.html
3859 /favicon.ico
3195 /smart_a/
1242 /
929 /ap/resources/images/page_icon_01.gif
909 /hype/css/all/header.css
898 /hype/css/all/footer.css
886 /hype/images/search_icon_01.gif
886 /hype/images/footer_copyright_01.gif
886 /ap/resources/css/all/reset.css?update=20120830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant