統計80埠的連線資料
netstat -nat | grep -i "80" | wc -l
統計httpd協議連線數
統計已連線的,狀態為establish的
netstat -na | greo establish | wc -l
查出那個ip連線最多,並將其封掉
netstat -na | grep establish | awk | awk -f:| sort | uniq -c | sort -r +on
檢視apache當前併發訪問數
netstat -na | grep establis | wc -l
檢視有多少個程序數
檢視apache的併發請求數及其tcp的連線狀態
netstat -nt | awk 『end『
syn_recv表示正在等待處理的請求數;established表示正常資料傳輸狀態;time_wait表示處理完畢,等待超時結束的請求數。
狀態:描述
closed:無連線是活動 的或正在進行
listen:伺服器在等待進入呼叫
syn_recv:乙個連線請求已經到達,等待確認
syn_sent:應用已經開始,開啟乙個連線
established:正常資料傳輸狀態
fin_wait1:應用說它已經完成
fin_wait2:另一邊已同意釋放
itmed_wait:等待所有分組死掉
closing:兩邊同時嘗試關閉
time_wait:另一邊已初始化乙個釋放
last_ack:等待所有分組死掉
8、用 tcpdump 嗅探 80 埠的訪問看看誰最高 tcpdump -i eth0 -tnn dst port 80 -c 1000 | awk -f"." '' | sort | uniq -c | sort -nr |head -20
9、檢視 /var/log目錄下檔案個數
方法1.12
34[root@oldboy learn_shell]
# tree -l 1 /var/log/ |tail -1
5
directories,
42
files
[root@oldboy]
# tree -l 1 /var/log/ |tail -1 |cut -d " " -f 3
42
tree引數
-l level 限制目錄顯示層級
cut引數
-b :以位元組為單位進行分割。這些位元組位置將忽略多位元組字元邊界,除非也指定了 -n 標誌。
-c :以字元為單位進行分割。
-d :自定義分隔符,預設為製表符。
-f :與-d一起使用,指定顯示哪個區域
方法2.
[root@oldboy]# ls -l /var/log |grep "^-" |wc -l
42方法3.
[root@oldboy learn_shell]# find /var/log/ -maxdepth 1 -type f |wc -l
42統計80埠的連線資料
netstat -nat | grep -i "80" | wc -l
統計httpd協議連線數
統計已連線的,狀態為establish的
netstat -na | greo establish | wc -l
查出那個ip連線最多,並將其封掉
netstat -na | grep establish | awk | awk -f:| sort | uniq -c | sort -r +on
檢視apache當前併發訪問數
netstat -na | grep establis | wc -l
檢視有多少個程序數
檢視apache的併發請求數及其tcp的連線狀態
netstat -nt | awk 『end『
syn_recv表示正在等待處理的請求數;established表示正常資料傳輸狀態;time_wait表示處理完畢,等待超時結束的請求數。
狀態:描述
closed:無連線是活動 的或正在進行
listen:伺服器在等待進入呼叫
syn_recv:乙個連線請求已經到達,等待確認
syn_sent:應用已經開始,開啟乙個連線
established:正常資料傳輸狀態
fin_wait1:應用說它已經完成
fin_wait2:另一邊已同意釋放
itmed_wait:等待所有分組死掉
closing:兩邊同時嘗試關閉
time_wait:另一邊已初始化乙個釋放
last_ack:等待所有分組死掉
8、用 tcpdump 嗅探 80 埠的訪問看看誰最高 tcpdump -i eth0 -tnn dst port 80 -c 1000 | awk -f"." '' | sort | uniq -c | sort -nr |head -20
9、檢視 /var/log目錄下檔案個數
方法1.12
34[root@oldboy learn_shell]
# tree -l 1 /var/log/ |tail -1
5
directories,
42
files
[root@oldboy]
# tree -l 1 /var/log/ |tail -1 |cut -d " " -f 3
42
tree引數
-l level 限制目錄顯示層級
cut引數
-b :以位元組為單位進行分割。這些位元組位置將忽略多位元組字元邊界,除非也指定了 -n 標誌。
-c :以字元為單位進行分割。
-d :自定義分隔符,預設為製表符。
-f :與-d一起使用,指定顯示哪個區域
方法2.
[root@oldboy]# ls -l /var/log |grep "^-" |wc -l
42方法3.
[root@oldboy learn_shell]# find /var/log/ -maxdepth 1 -type f |wc -l
429、檢視 /var/log目錄下檔案個數
方法1.12
34[root@oldboy learn_shell]
# tree -l 1 /var/log/ |tail -1
5
directories,
42
files
[root@oldboy]
# tree -l 1 /var/log/ |tail -1 |cut -d " " -f 3
42
tree引數
-l level 限制目錄顯示層級
cut引數
-b :以位元組為單位進行分割。這些位元組位置將忽略多位元組字元邊界,除非也指定了 -n 標誌。
-c :以字元為單位進行分割。
-d :自定義分隔符,預設為製表符。
-f :與-d一起使用,指定顯示哪個區域
方法2.
[root@oldboy]# ls -l /var/log |grep "^-" |wc -l
42方法3.
[root@oldboy learn_shell]# find /var/log/ -maxdepth 1 -type f |wc -l
42
檢視Apache併發請求數及其TCP連線狀態
prefork mpm startservers number of server processes to start minspareservers minimum number of server processes which are kept spare maxspareservers m...
檢視Apache併發請求數及其TCP連線狀態
這兩天搭建了一組apache伺服器,每台伺服器4g記憶體,採用的是prefork模式,一開始設定的連線數太少了,需要較長的時間去響應使用者的請求,後來修改了一下apache 2.0.59的配置檔案httpd.conf 引用 prefork mpm startservers number of ser...
檢視Apache併發請求數及其TCP連線狀態
這兩天搭建了一組apache伺服器,每台伺服器4g記憶體,採用的是prefork模式,一開始設定的連線數太少了,需要較長的時間去響應使用者的請求,後來修改了一下apache 2.0.59的配置檔案httpd.conf prefork mpm startservers number of server...