Tsar簡介
- Tsar是淘寶自己開發的一個采集工具,主要用來收集服務器的系統信息(如cpu,io,mem,tcp等),以及應用數據(如squid haproxy nginx等)。
- 收集到的數據存儲在磁盤上,可以隨時查詢歷史信息,輸出方式靈活多樣,另外支持將數據存儲到mysql中,也可以將數據發送到nagios報警服務器。
- Tsar在展示數據時,可以指定模塊,並且可以對多條信息的數據進行merge輸出,帶–live參數可以輸出秒級的實時信息。
- Tsar能夠比較方便的增加模塊,只需要按照tsar的要求編寫數據的采集函數和展現函數,就可以把自定義的模塊加入到Tsar中。
總體架構
- Tsar是基於模塊化設計的程序,程序有兩部分組成:框架和模塊。
- 框架程序源代碼主要在src目錄,而模塊源代碼主要在modules目錄中。
- 框架提供對配置文件的解析,模塊的加載,命令行參數的解析,應用模塊的接口對模塊原始數據的解析與輸出。 模塊提供接口給框架調用。
- Tsar依賴與cron每分鍾執行采集數據,因此它需要系統安裝並啟用crond,安裝后,tsar每分鍾會執行
tsar --cron
來定時采集信息,並且記錄到原始日志文件。
Tsar的運行流程圖

主要執行流程
1.解析輸入
根據用戶的輸入,初始化一些全局信息,如間隔時間,是否merge,是否指定模塊,運行模式
2.讀取配置文件信息
主要解析tsar的配置文件,如果include生效,則會解析include的配置文件
配置文件用來獲得tsar需要加載的模塊,輸出方式,每一類輸出方式包含的模塊,和此輸出方式的接收信息
如mod_cpu on代表采集cpu的信息
output_interface file,nagios表示向文件和nagios服務器發送采集信息和報警信息
3.加載相應模塊
根據配置文件的模塊開啟關閉情況,將模塊的動態庫load到系統
4.tsar的三種運行模式
tsar在運行的時候有三種模式:
print模式僅僅輸出指定的模塊信息,默認顯示最近一天的;
live模式是輸出當前信息,可以精確到秒級
cron模式,此一般是crontab定時執行,每一分鍾采集一次所有配置的模塊信息,並將數據寫入原始文件,在cron運行的時候 會判斷是否配置輸出到db或者nagios,如果配置則將相應格式的數據輸出到對應接口。
5.釋放資源
程序最后,釋放動態庫,程序結束
項目地址: https://github.com/alibaba/tsar
Tsar安裝
從github上檢出代碼
1 2 3 4
|
$ git clone git://github.com/alibaba/tsar.git $ cd tsar $ make $ make install
|
從github上下載源碼
1 2 3 4 5
|
$ wget -O tsar.zip https://github.com/alibaba/tsar/archive/master.zip --no-check-certificate $ unzip tsar.zip $ cd tsar $ make $ make install
|
安裝后生成的文件
Tsar配置文件路徑:/etc/tsar/tsar.conf,tsar的采集模塊和輸出的具體配置;
定時任務配置:/etc/cron.d/tsar,負責每分鍾調用tsar執行采集任務;
日志文件輪轉配置:/etc/logrotate.d/tsar,每個月會把tsar的本地存儲進行輪轉;
模塊路徑:/usr/local/tsar/modules,各個模塊的動態庫so文件;
Tsar配置
Tsar配置文件介紹
1 2 3 4
|
$ cat /etc/cron.d/tsar # cron tsar collect once per minute MAILTO="" * * * * * root /usr/bin/tsar --cron > /dev/null 2>&1
|
如上所示,/etc/cron.d/tsar
里面負責每分鍾以root用戶的角色調用tsar命令來執行數據采集。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
$ cat /etc/logrotate.d/tsar /var/log/tsar.data { monthly rotate 120 create nocompress nodateext notifempty prerotate /usr/bin/chattr -a /var/log/tsar.data endscript postrotate /usr/bin/chattr +a /var/log/tsar.data endscript }
|
在日志文件輪轉配置中,每個月會把tsar的本地存儲進行輪轉,此外這里也設定了數據在/var/log/tsar.data
下
/etc/tsar/tsar.conf
負責tsar的采集模塊和輸出的具體配置;在這里配置啟用哪些模塊,輸出等內容。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
$ cat /etc/tsar/tsar.conf ####debug_level(INFO DEBUG WARN ERROR FATAL) debug_level ERROR ####[module] mod_cpu on mod_mem on mod_swap on mod_tcp on mod_udp on mod_traffic on mod_io on mod_pcsw on mod_partition on mod_tcpx on mod_load on mod_apache off mod_lvs off mod_haproxy off mod_squid off mod_nginx off mod_nginx_multiport off mod_nginx_live off #mod_nginx_sys_mport on 80 8080 mod_swift off mod_swift_code off mod_swift_domain off mod_swift_esi off mod_swift_fwd off mod_swift_store off mod_swift_swapdir off mod_swift_purge off mod_swift_sys off mod_swift_tcmalloc off mod_tmd off mod_percpu off mod_tcprt off mod_proc off pidname mod_pharos off mod_tmd4 off mod_keyserver off #mod_erpc on /etc/tsar/erpc.conf #mod_search on
####output_interface file,db,nagios output_interface file
####[output_file] original data to store output_file_path /var/log/tsar.data
####[output_stdio] these mod will be show as using tsar command output_stdio_mod mod_swap,mod_partition,mod_cpu,mod_mem,mod_lvs,mod_haproxy,mod_traffic,mod_squid,mod_load,mod_tcp,mod_udp,mod_tcpx,mod_apache,mod_pcsw,mod_io,mod_percpu
####[output_db] #output_db_mod mod_swap,mod_partition,mod_cpu,mod_mem,mod_traffic,mod_load,mod_tcp,mod_udp,mod_pcsw,mod_io #output_db_addr console2:56677
####[output_tcp] #output_tcp_mod mod_swap,mod_cpu #output_tcp_addr localhost:9666 #output_tcp_merge on
####support include other mod conf include /etc/tsar/conf.d/*.conf
####The IP address or the host running the NSCA daemon #server_addr nagios.server.com ####The port on which the daemon is running - default is 5667 #server_port 8086 ####The cycle of send alert to nagios #cycle_time 300 ####nsca client program #send_nsca_cmd /usr/bin/send_nsca #send_nsca_conf /home/a/conf/amon/send_nsca.conf
####tsar mod alert config file ####threshold servicename.key;w-min;w-max;c-min;cmax; #threshold cpu.util;N;N;N;N;
|
常用參數說明
debug_level 指定tsar的運行級別,主要用來調試使用
mod_xxx on/off 開啟指定模塊
out_interface 設置輸出類型,支持file,nagios,db
out_stdio_mod 設置用戶終端默認顯示的模塊
output_db_mod 設置哪些模塊輸出到數據庫
output_db_addr 數據庫的ip和端口
output_nagios_mod 設置哪些模塊輸出到nagios
include 支持include配置,主要用來加載用戶的自定義模塊
cycle_time 指定上報的間隔時間,由於tsar每一分鍾采集一次,上報時會判斷是否符合時間間隔,如設置300的話,則在0,5等整點分鍾會上報nagios
threshold 設置某個要報警項的閥值,前面是模塊和要監控的具體名稱,后面的四個數據代表報警的范圍,warn和critical的范圍
/etc/tsar/conf.d/
這個目錄下是用戶的自定義模塊配置文件,配置基本在用戶開發自定義模塊時確定,主要包含模塊的開啟,輸出類型和報警范圍
Tsar使用介紹
在Tsar的使用中,可以參考下面的幫助信息,完成對應的監控。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
$ tsar -h Usage: tsar [options] Options: -check 查看最后一次的采集數據 --check/-C 查看最后一次tsar的提醒信息,如:tsar --check / tsar --check --cpu --io --cron/-c 使用crond模式來進行tsar監控 --interval/-i 指明tsar的間隔時間,默認單位分鍾,默認顯示間隔5分鍾;帶上--live參數則單位是秒,默認是5秒。 --list/-L 列出啟用的模塊 --live/-l 啟用實時模式,類似iostat等,可以配合-i參數和模塊參數使用。 --file/-f 指定輸入文件 --ndays/-n 控制顯示多長時間的歷史數據,默認1天 --date/-d 指定日期,YYYYMMDD或者n代表n天前 --detail/-D 能夠指定查看主要字段還是模塊的所有字段 --spec/-s 指定字段,tsar –cpu -s sys,util --watch/-w 顯示最后多少分鍾的記錄. 如:tsar --watch 30 / tsar --watch 30 --cpu --io --merge/-m 對有多個數據的展示,進行匯總,如機器上跑了3個squid,可以用 tsar –squid -m的放式進行展示匯總。 --item/-I 顯示指定項目數據, 如:tsar --io -I sda -–help/-h 顯示提示信息和模塊信息 Modules Enabled: --cpu 列出cpu相關的監控計數 --mem 物理內存的使用情況 --swap 虛擬內存的使用情況 --tcp TCP協議IPV4的使用情況 --udp UDP協議IPV4的使用情況 --traffic 網絡傳出的使用情況 --io Linux IO的情況 --pcsw 進程和上下文切換 --partition 磁盤使用情況 --tcpx TCP連接相關的數據參數 --load 系統負載情況
|
- tsar命令行主要擔負顯示歷史數據和實時數據的功能,因此有控制展示模塊和格式化輸出的參數,默認不帶任何參數/選項的情況下,tsar打印匯總信息。
- tsar命令行主要顯示給人看的,所以數據展示中都進行了k/m/g等的進位。
- tsar命令會在顯示20行數據后再次打印各個列的列頭,以利於用戶理解數據的含義。
- tsar的列頭信息包括2行,第一行為模塊名,第二行為列名。
- tsar輸出最后會作min/avg/max的匯總統計,統計所展示中的最小/平均/最大數據。
Tsar使用實例
Tsar監控系統
查看可用的模塊列表
1 2 3 4 5 6 7 8 9 10 11 12 13
|
$ tsar -L tsar enable follow modules: cpu mem swap tcp udp traffic io pcsw partition tcpx load
|
查看指定模塊的運行狀況,模塊是指tsar -L
列出來的名稱。如查看CPU運行情況
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
$ tsar --cpu Time -----------------------cpu---------------------- Time user sys wait hirq sirq util 18/05/16-09:20 0.03 0.08 0.01 0.00 0.02 0.12 18/05/16-09:25 0.00 0.02 0.00 0.00 0.01 0.04 18/05/16-09:30 0.00 0.02 0.00 0.00 0.02 0.05 18/05/16-09:35 0.00 0.87 2.06 0.00 0.02 0.90 18/05/16-09:40 0.00 0.03 0.00 0.00 0.02 0.05 18/05/16-09:45 0.00 0.02 0.00 0.00 0.02 0.04 18/05/16-09:50 0.00 0.02 0.00 0.00 0.02 0.04 18/05/16-09:55 0.01 0.02 0.00 0.00 0.02 0.05 18/05/16-10:00 0.00 0.02 0.00 0.00 0.02 0.05 18/05/16-10:05 0.07 0.16 0.00 0.00 0.02 0.24 18/05/16-10:10 0.12 0.32 0.04 0.00 0.02 0.46 18/05/16-10:15 0.02 0.09 0.00 0.00 0.02 0.13 18/05/16-10:20 0.04 0.15 0.00 0.00 0.02 0.20 18/05/16-10:25 0.03 0.07 0.00 0.00 0.02 0.11 18/05/16-10:30 0.01 0.03 0.00 0.00 0.02 0.05 18/05/16-10:35 0.00 0.02 0.00 0.00 0.02 0.04 18/05/16-10:40 0.01 0.03 0.00 0.00 0.02 0.05 18/05/16-10:45 0.00 0.02 0.00 0.00 0.02 0.05 18/05/16-10:50 0.00 0.03 0.00 0.00 0.02 0.05 Time -----------------------cpu---------------------- Time user sys wait hirq sirq util 18/05/16-10:55 0.07 0.10 0.00 0.00 0.02 0.19 18/05/16-11:00 0.02 0.07 0.00 0.00 0.02 0.10 18/05/16-11:05 0.02 0.05 0.00 0.00 0.01 0.09 18/05/16-11:10 0.01 0.03 0.00 0.00 0.01 0.06 18/05/16-11:15 0.01 0.03 0.00 0.00 0.01 0.05 18/05/16-11:20 0.01 0.03 0.00 0.00 0.02 0.06 18/05/16-11:25 0.01 0.03 0.00 0.00 0.01 0.05
MAX 0.03 0.87 2.06 0.00 0.02 0.90 MEAN 0.02 0.09 0.08 0.00 0.02 0.13 MIN 0.03 0.08 0.01 0.00 0.02 0.12
|
查看實時數據
1 2 3 4 5 6 7 8 9 10 11 12
|
$ tsar -l Time ---cpu-- ---mem-- ---tcp-- -----traffic---- --sda--- --dm-0-- --dm-1-- --dm-2-- ---load- Time util util retran bytin bytout util util util util load1 18/05/16-11:27:47 0.05 33.16 0.00 24.00 74.00 0.04 0.04 0.00 0.00 0.00 18/05/16-11:27:52 0.05 33.15 0.00 30.00 52.00 0.06 0.06 0.00 0.00 0.00 18/05/16-11:27:57 0.20 33.15 0.00 12.00 40.00 0.02 0.02 0.00 0.00 0.00 18/05/16-11:28:02 0.50 33.18 0.00 12.00 40.00 0.00 0.00 0.00 0.00 0.00 18/05/16-11:28:07 0.15 33.18 0.00 85.00 40.00 0.04 0.04 0.00 0.00 0.00 18/05/16-11:28:12 0.15 33.18 0.00 159.00 40.00 0.00 0.00 0.00 0.00 0.00 18/05/16-11:28:17 0.05 33.18 0.00 12.00 40.00 0.06 0.06 0.00 0.00 0.00 18/05/16-11:28:22 0.10 33.18 0.00 24.00 52.00 0.00 0.00 0.00 0.00 0.00 18/05/16-11:28:27 0.15 33.17 0.00 48.00 40.00 0.00 0.00 0.00 0.00 0.00
|
顯示1天內的歷史匯總(summury)信息,以默認5分鍾為間隔
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
$ tsar Time ---cpu-- ---mem-- ---tcp-- -----traffic---- --sda--- --dm-0-- --dm-1-- --dm-2-- ---load- Time util util retran bytin bytout util util util util load1 18/05/16-09:20 0.12 24.61 0.00 42.00 33.00 0.07 0.07 0.00 0.00 0.00 18/05/16-09:25 0.04 24.58 0.00 12.00 2.00 0.03 0.03 0.00 0.00 0.00 18/05/16-09:30 0.05 24.62 0.00 6.00 3.00 0.03 0.03 0.00 0.00 0.00 18/05/16-09:35 0.90 32.99 0.00 3.00 2.00 11.16 11.05 0.00 0.11 0.35 18/05/16-09:40 0.05 32.98 0.00 8.00 2.00 0.14 0.14 0.00 0.00 0.00 18/05/16-09:45 0.04 32.98 0.00 16.00 2.00 0.01 0.01 0.00 0.00 0.00 18/05/16-09:50 0.04 33.03 0.00 11.00 3.00 0.03 0.03 0.00 0.00 0.00 18/05/16-09:55 0.05 32.95 0.00 8.00 2.00 0.03 0.03 0.00 0.00 0.00 18/05/16-10:00 0.05 33.00 0.00 9.00 2.00 0.02 0.02 0.00 0.00 0.00 18/05/16-10:05 0.24 33.00 0.00 77.00 167.00 0.05 0.05 0.00 0.00 0.00 18/05/16-10:10 0.46 33.50 0.00 146.00 377.00 0.23 0.23 0.00 0.00 0.00 18/05/16-10:15 0.13 33.01 0.00 31.00 60.00 0.04 0.04 0.00 0.00 0.00 18/05/16-10:20 0.20 33.03 0.00 51.00 120.00 0.05 0.05 0.00 0.00 0.00 18/05/16-10:25 0.11 33.01 0.00 27.00 26.00 0.04 0.04 0.00 0.00 0.01 18/05/16-10:30 0.05 33.04 0.00 2.00 3.00 0.02 0.02 0.00 0.00 0.00 18/05/16-10:35 0.04 32.99 0.00 10.00 2.00 0.01 0.01 0.00 0.00 0.00 18/05/16-10:40 0.05 33.03 0.00 22.00 2.00 0.02 0.02 0.00 0.00 0.00 18/05/16-10:45 0.05 33.00 0.00 10.00 3.00 0.03 0.03 0.00 0.00 0.00 18/05/16-10:50 0.05 33.01 0.00 16.00 3.00 0.02 0.02 0.00 0.00 0.00 Time ---cpu-- ---mem-- ---tcp-- -----traffic---- --sda--- --dm-0-- --dm-1-- --dm-2-- ---load- Time util util retran bytin bytout util util util util load1 18/05/16-10:55 0.19 33.02 0.00 45.00 63.00 0.02 0.02 0.00 0.00 0.00 18/05/16-11:00 0.10 33.04 0.00 21.00 30.00 0.02 0.02 0.00 0.00 0.00 18/05/16-11:05 0.09 33.01 0.00 32.00 23.00 0.03 0.03 0.00 0.00 0.00 18/05/16-11:10 0.06 33.04 0.00 14.00 3.00 0.01 0.01 0.00 0.00 0.01 18/05/16-11:15 0.05 33.02 0.00 12.00 2.00 0.01 0.01 0.00 0.00 0.00 18/05/16-11:20 0.06 33.03 0.00 10.00 2.00 0.04 0.04 0.00 0.00 0.03 18/05/16-11:25 0.05 33.03 0.00 7.00 2.00 0.01 0.01 0.00 0.00 0.03
MAX 0.90 33.50 0.00 146.00 377.00 11.16 11.05 0.00 0.11 0.35 MEAN 0.13 32.36 0.00 24.24 36.24 0.48 0.48 0.00 0.00 0.02 MIN 0.12 24.61 0.00 2.00 2.00 0.07 0.07 0.00 0.00 0.00
|
以1秒鍾為間隔,實時打印tsar的概述數據
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
$ tsar -i 1 -l Time ---cpu-- ---mem-- ---tcp-- -----traffic---- --sda--- --dm-0-- --dm-1-- --dm-2-- ---load- Time util util retran bytin bytout util util util util load1 18/05/16-10:17:17 0.25 33.13 0.00 60.00 314.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:18 0.00 33.13 0.00 60.00 202.00 0.50 0.50 0.00 0.00 0.00 18/05/16-10:17:19 0.49 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:21 0.00 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:22 0.49 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:23 0.25 33.13 0.00 120.00 262.00 0.20 0.20 0.00 0.00 0.00 18/05/16-10:17:24 0.25 33.13 0.00 60.00 202.00 0.40 0.40 0.00 0.00 0.00 18/05/16-10:17:25 0.00 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:26 0.00 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:27 0.49 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:28 0.25 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00 18/05/16-10:17:29 0.25 33.13 0.00 60.00 202.00 0.00 0.00 0.00 0.00 0.00
|
tsar cpu監控
使用參數-–cpu
可以監控系統的cpu,參數user表示用戶空間cpu, sys內核空間cpu使用情況,wait是IO對應的cpu使用情況,hirq,sirq分別是硬件中斷,軟件中斷的使用情況,util是系統使用cpu的總計情況。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
$ tsar --cpu Time -----------------------cpu---------------------- Time user sys wait hirq sirq util 18/05/16-09:20 0.03 0.08 0.01 0.00 0.02 0.12 18/05/16-09:25 0.00 0.02 0.00 0.00 0.01 0.04 18/05/16-09:30 0.00 0.02 0.00 0.00 0.02 0.05 18/05/16-09:35 0.00 0.87 2.06 0.00 0.02 0.90 18/05/16-09:40 0.00 0.03 0.00 0.00 0.02 0.05 18/05/16-09:45 0.00 0.02 0.00 0.00 0.02 0.04 18/05/16-09:50 0.00 0.02 0.00 0.00 0.02 0.04 18/05/16-09:55 0.01 0.02 0.00 0.00 0.02 0.05 18/05/16-10:00 0.00 0.02 0.00 0.00 0.02 0.05 18/05/16-10:05 0.07 0.16 0.00 0.00 0.02 0.24 18/05/16-10:10 0.12 0.32 0.04 0.00 0.02 0.46 18/05/16-10:15 0.02 0.09 0.00 0.00 0.02 0.13 18/05/16-10:20 0.04 0.15 0.00 0.00 0.02 0.20 18/05/16-10:25 0.03 0.07 0.00 0.00 0.02 0.11 18/05/16-10:30 0.01 0.03 0.00 0.00 0.02 0.05 18/05/16-10:35 0.00 0.02 0.00 0.00 0.02 0.04 18/05/16-10:40 0.01 0.03 0.00 0.00 0.02 0.05 18/05/16-10:45 0.00 0.02 0.00 0.00 0.02 0.05 18/05/16-10:50 0.00 0.03 0.00 0.00 0.02 0.05 Time -----------------------cpu---------------------- Time user sys wait hirq sirq util 18/05/16-10:55 0.07 0.10 0.00 0.00 0.02 0.19 18/05/16-11:00 0.02 0.07 0.00 0.00 0.02 0.10 18/05/16-11:05 0.02 0.05 0.00 0.00 0.01 0.09 18/05/16-11:10 0.01 0.03 0.00 0.00 0.01 0.06 18/05/16-11:15 0.01 0.03 0.00 0.00 0.01 0.05 18/05/16-11:20 0.01 0.03 0.00 0.00 0.02 0.06 18/05/16-11:25 0.01 0.03 0.00 0.00 0.01 0.05
MAX 0.03 0.87 2.06 0.00 0.02 0.90 MEAN 0.02 0.09 0.08 0.00 0.02 0.13 MIN 0.03 0.08 0.01 0.00 0.02 0.12
|
顯示一天內的cpu和內存歷史數據,以1分鍾為間隔
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$ tsar --cpu --mem -i 1 Time -----------------------cpu---------------------- -----------------------mem---------------------- Time user sys wait hirq sirq util free used buff cach total util 18/05/16-09:14 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 456.9M 35.9M 95.8M 1.8G 24.54 18/05/16-09:15 0.01 0.02 0.00 0.00 0.02 0.05 1.2G 456.9M 35.9M 95.8M 1.8G 24.53 18/05/16-09:16 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 456.8M 36.0M 95.8M 1.8G 24.53 18/05/16-09:17 0.01 0.03 0.00 0.00 0.02 0.06 1.2G 456.6M 36.0M 95.8M 1.8G 24.52 18/05/16-09:18 0.19 0.46 0.08 0.00 0.02 0.67 1.2G 458.8M 36.7M 95.8M 1.8G 24.64 18/05/16-09:19 0.00 0.03 0.00 0.00 0.02 0.05 1.2G 457.9M 36.8M 95.8M 1.8G 24.59 18/05/16-09:20 0.00 0.02 0.00 0.00 0.02 0.05 1.2G 458.3M 36.8M 95.8M 1.8G 24.61 18/05/16-09:21 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 457.8M 36.8M 95.8M 1.8G 24.58 18/05/16-09:22 0.01 0.02 0.00 0.00 0.02 0.05 1.2G 457.5M 36.8M 95.8M 1.8G 24.57 18/05/16-09:23 0.00 0.03 0.00 0.00 0.02 0.05 1.2G 457.6M 36.9M 95.8M 1.8G 24.57 18/05/16-09:24 0.00 0.02 0.00 0.00 0.02 0.05 1.2G 457.7M 36.9M 95.8M 1.8G 24.58 18/05/16-09:25 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 457.7M 36.9M 95.8M 1.8G 24.58 18/05/16-09:26 0.00 0.02 0.00 0.00 0.02 0.05 1.2G 457.7M 36.9M 95.9M 1.8G 24.58 18/05/16-09:27 0.01 0.03 0.00 0.00 0.02 0.06 1.2G 457.4M 36.9M 95.9M 1.8G 24.56 18/05/16-09:28 0.00 0.02 0.00 0.00 0.02 0.04 1.2G 457.5M 36.9M 95.9M 1.8G 24.57 18/05/16-09:29 0.00 0.02 0.00 0.00 0.02 0.03 1.2G 457.5M 37.0M 95.9M 1.8G 24.57 18/05/16-09:30 0.00 0.03 0.00 0.00 0.02 0.05 1.2G 458.4M 37.0M 95.8M 1.8G 24.62 18/05/16-09:31 0.00 0.02 0.01 0.00 0.02 0.05 1.2G 457.5M 37.0M 95.9M 1.8G 24.57 18/05/16-09:32 0.00 0.02 0.00 0.00 0.02 0.04 1.2G 457.5M 37.0M 95.9M 1.8G 24.57
|
顯示一天內cpu的歷史信息,以1分鍾為間隔
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$ tsar --cpu -i 1 Time -----------------------cpu---------------------- -----------------------mem---------------------- Time user sys wait hirq sirq util free used buff cach total util 18/05/16-09:14 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 456.9M 35.9M 95.8M 1.8G 24.54 18/05/16-09:15 0.01 0.02 0.00 0.00 0.02 0.05 1.2G 456.9M 35.9M 95.8M 1.8G 24.53 18/05/16-09:16 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 456.8M 36.0M 95.8M 1.8G 24.53 18/05/16-09:17 0.01 0.03 0.00 0.00 0.02 0.06 1.2G 456.6M 36.0M 95.8M 1.8G 24.52 18/05/16-09:18 0.19 0.46 0.08 0.00 0.02 0.67 1.2G 458.8M 36.7M 95.8M 1.8G 24.64 18/05/16-09:19 0.00 0.03 0.00 0.00 0.02 0.05 1.2G 457.9M 36.8M 95.8M 1.8G 24.59 18/05/16-09:20 0.00 0.02 0.00 0.00 0.02 0.05 1.2G 458.3M 36.8M 95.8M 1.8G 24.61 18/05/16-09:21 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 457.8M 36.8M 95.8M 1.8G 24.58 18/05/16-09:22 0.01 0.02 0.00 0.00 0.02 0.05 1.2G 457.5M 36.8M 95.8M 1.8G 24.57 18/05/16-09:23 0.00 0.03 0.00 0.00 0.02 0.05 1.2G 457.6M 36.9M 95.8M 1.8G 24.57 18/05/16-09:24 0.00 0.02 0.00 0.00 0.02 0.05 1.2G 457.7M 36.9M 95.8M 1.8G 24.58 18/05/16-09:25 0.00 0.02 0.00 0.00 0.01 0.04 1.2G 457.7M 36.9M 95.8M 1.8G 24.58 18/05/16-09:26 0.00 0.02 0.00 0.00 0.02 0.05 1.2G 457.7M 36.9M 95.9M 1.8G 24.58 18/05/16-09:27 0.01 0.03 0.00 0.00 0.02 0.06 1.2G 457.4M 36.9M 95.9M 1.8G 24.56 18/05/16-09:28 0.00 0.02 0.00 0.00 0.02 0.04 1.2G 457.5M 36.9M 95.9M 1.8G 24.57 18/05/16-09:29 0.00 0.02 0.00 0.00 0.02 0.03 1.2G 457.5M 37.0M 95.9M 1.8G 24.57 18/05/16-09:30 0.00 0.03 0.00 0.00 0.02 0.05 1.2G 458.4M 37.0M 95.8M 1.8G 24.62 18/05/16-09:31 0.00 0.02 0.01 0.00 0.02 0.05 1.2G 457.5M 37.0M 95.9M 1.8G 24.57 18/05/16-09:32 0.00 0.02 0.00 0.00 0.02 0.04 1.2G 457.5M 37.0M 95.9M 1.8G 24.57
|
tsar監控虛擬內存和load情況
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$ tsar --swap --load Time ---------------swap------------- -------------------load----------------- Time swpin swpout total util load1 load5 load15 runq plit 18/05/16-09:20 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 147.00 18/05/16-09:25 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 147.00 18/05/16-09:30 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 149.00 18/05/16-09:35 0.00 0.00 1.9G 0.00 0.35 0.11 0.04 0.00 147.00 18/05/16-09:40 0.00 0.00 1.9G 0.00 0.00 0.03 0.01 0.00 147.00 18/05/16-09:45 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 147.00 18/05/16-09:50 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 147.00 18/05/16-09:55 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:00 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:05 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:10 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 147.00 18/05/16-10:15 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:20 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 1.00 148.00 18/05/16-10:25 0.00 0.00 1.9G 0.00 0.01 0.01 0.00 0.00 146.00 18/05/16-10:30 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:35 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:40 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:45 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:50 0.00 0.00 1.9G 0.00 0.00 0.00 0.00 0.00 146.00
|
tsar監控內存使用情況
1 2 3 4 5 6 7 8 9
|
$ tsar --mem Time -----------------------mem---------------------- Time free used buff cach total util 23/08/15-21:25 2.1G 5.7G 0.00 164.0M 8.0G 71.44 23/08/15-21:30 2.1G 5.7G 0.00 181.4M 8.0G 71.43 23/08/15-21:35 2.1G 5.7G 0.00 213.9M 8.0G 71.42 23/08/15-21:40 2.1G 5.7G 0.00 233.8M 8.0G 71.43 23/08/15-21:45 1.4G 5.7G 0.00 924.6M 8.0G 71.43 23/08/15-21:50 1.4G 5.7G 0.00 889.4M 8.0G 71.42
|
以2秒鍾為間隔,實時打印mem的數據
1 2 3 4 5 6 7 8 9
|
$ tsar --live --mem -i 2 Time -----------------------mem---------------------- Time free used buff cach total util 18/05/16-11:30:59 905.8M 617.2M 219.4M 119.8M 1.8G 33.14 18/05/16-11:31:01 904.9M 618.1M 219.4M 119.8M 1.8G 33.19 18/05/16-11:31:03 904.9M 618.1M 219.4M 119.8M 1.8G 33.19 18/05/16-11:31:05 904.9M 618.0M 219.4M 119.8M 1.8G 33.19 18/05/16-11:31:07 904.9M 618.0M 219.4M 119.8M 1.8G 33.19 18/05/16-11:31:09 905.0M 618.0M 219.4M 119.8M 1.8G 33.19
|
tsar監控io使用情況
1 2 3 4 5 6 7 8
|
$ tsar --io Time ------------------------------------------sda------------------------------------------- Time rrqms wrqms rs ws rsecs wsecs rqsize qusize await svctm util 18/08/16-21:25 0.28 3.4K 184.40 389.25 4.9K 15.0K 35.47 3.00 6.35 0.29 16.44 18/08/16-21:30 0.00 3.2K 109.71 382.74 2.5K 14.5K 35.27 3.00 7.33 0.30 14.68 18/08/16-21:35 0.15 3.1K 156.91 342.16 3.8K 13.8K 36.15 3.00 6.60 0.29 14.37 18/08/16-21:40 0.86 3.3K 234.00 371.43 6.9K 14.6K 36.43 3.00 5.93 0.28 16.83 18/08/16-21:45 0.72 3.4K 376.80 357.13 11.7K 14.8K 37.03 3.00 4.84 0.25 18.50
|
tsar監控網絡監控統計
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
$ tsar --traffic Time ---------------------traffic-------------------- Time bytin bytout pktin pktout pkterr pktdrp 18/05/16-09:20 42.00 33.00 0.00 0.00 0.00 0.00 18/05/16-09:25 12.00 2.00 0.00 0.00 0.00 0.00 18/05/16-09:30 6.00 3.00 0.00 0.00 0.00 0.00 18/05/16-09:35 3.00 2.00 0.00 0.00 0.00 0.00 18/05/16-09:40 8.00 2.00 0.00 0.00 0.00 0.00 18/05/16-09:45 16.00 2.00 0.00 0.00 0.00 0.00 18/05/16-09:50 11.00 3.00 0.00 0.00 0.00 0.00 18/05/16-09:55 8.00 2.00 0.00 0.00 0.00 0.00 18/05/16-10:00 9.00 2.00 0.00 0.00 0.00 0.00 18/05/16-10:05 77.00 167.00 1.00 0.00 0.00 0.00 18/05/16-10:10 146.00 377.00 2.00 1.00 0.00 0.00 18/05/16-10:15 31.00 60.00 0.00 0.00 0.00 0.00 18/05/16-10:20 51.00 120.00 0.00 0.00 0.00 0.00 18/05/16-10:25 27.00 26.00 0.00 0.00 0.00 0.00 18/05/16-10:30 2.00 3.00 0.00 0.00 0.00 0.00 18/05/16-10:35 10.00 2.00 0.00 0.00 0.00 0.00 18/05/16-10:40 22.00 2.00 0.00 0.00 0.00 0.00 18/05/16-10:45 10.00 3.00 0.00 0.00 0.00 0.00 18/05/16-10:50 16.00 3.00 0.00 0.00 0.00 0.00 Time ---------------------traffic-------------------- Time bytin bytout pktin pktout pkterr pktdrp 18/05/16-10:55 45.00 63.00 0.00 0.00 0.00 0.00 18/05/16-11:00 21.00 30.00 0.00 0.00 0.00 0.00 18/05/16-11:05 32.00 23.00 0.00 0.00 0.00 0.00 18/05/16-11:10 14.00 3.00 0.00 0.00 0.00 0.00 18/05/16-11:15 12.00 2.00 0.00 0.00 0.00 0.00 18/05/16-11:20 10.00 2.00 0.00 0.00 0.00 0.00 18/05/16-11:25 7.00 2.00 0.00 0.00 0.00 0.00 18/05/16-11:30 97.00 241.00 1.00 1.00 0.00 0.00
MAX 146.00 377.00 2.00 1.00 0.00 0.00 MEAN 27.04 44.12 0.15 0.08 0.00 0.00 MIN 2.00 2.00 0.00 0.00 0.00 0.00
|
1 2 3 4 5 6 7 8
|
$ tsar --tcp --udp -d 1 Time -------------------------------tcp------------------------------ ---------------udp-------------- Time active pasive iseg outseg EstRes AtmpFa CurrEs retran idgm odgm noport idmerr 18/05/16-00:05 0.79 1.52 1.6K 2.1K 0.00 0.03 3.4K 0.02 0.00 2.00 0.00 0.00 18/05/16-00:10 0.73 1.40 884.25 921.56 0.00 0.03 3.4K 0.01 0.00 3.00 0.00 0.00 18/05/16-00:15 0.77 1.46 959.62 1.0K 0.00 0.03 3.4K 0.01 0.00 3.00 0.00 0.00 18/05/16-00:20 0.69 1.43 1.0K 1.0K 0.00 0.03 3.4K 0.01 0.00 3.00 0.00 0.00 18/05/16-00:25 0.72 1.42 1.2K 1.1K 0.00 0.03 3.4K 0.00 0.00 3.00 0.00 0.00
|
tsar監控查看系統tcp連接情況,5秒刷新一次
1 2 3 4 5 6 7 8
|
$ tsar --tcp -l 5 Time -------------------------------tcp------------------------------ Time active pasive iseg outseg EstRes AtmpFa CurrEs retran 18/05/16-11:34:01 0.00 0.00 0.20 0.20 0.00 0.00 1.00 0.00 18/05/16-11:34:06 0.00 0.20 6.20 4.60 0.00 0.00 2.00 0.00 18/05/16-11:34:11 0.00 0.00 4.60 2.80 0.00 0.00 2.00 0.00 18/05/16-11:34:16 0.20 0.00 1.20 1.20 0.00 0.00 2.00 0.00 18/05/16-11:34:21 0.40 0.00 1.40 1.80 0.00 0.00 4.00 0.00
|
tsar檢查告警信息
查看最后一次tsar的提醒信息,這里包括了系統的cpu,io的告警情況。
1 2
|
$ tsar --check --cpu --io localhost.localdomain tsar cpu:user=25.0 cpu:sys=2.1 cpu:wait=0.1 cpu:hirq=0.0 cpu:sirq=0.2 cpu:util=27.4 io:sda:rrqms=0.0 io:sda:wrqms=4172.4 io:sda:rs=80.3 io:sda:ws=493.0 io:sda:rsecs=1664.0 io:sda:wsecs=18661.7 io:sda:rqsize=35.5 io:sda:qusize=4.0 io:sda:await=7.7 io:sda:svctm=0.3 io:sda:util=18.5
|
tsar歷史數據回溯
通過參數-d 2
可以查出兩天前到現在的數據,-i 1
表示以每次1分鍾作為采集顯示。
1 2 3 4 5 6 7 8 9 10 11
|
$ tsar -d 2 -i 1 Time ---cpu-- ---mem-- ---tcp-- -----traffic---- --sda--- ---load- Time util util retran bytin bytout util load1 15/05/16-00:02 ------ 71.40 0.03 754.2K 421.4K 14.38 1.59 15/05/16-00:03 34.55 71.41 0.01 773.7K 400.9K 13.39 1.42 15/05/16-00:04 31.80 71.41 0.03 708.6K 391.9K 12.88 1.54 15/05/16-00:05 28.70 71.40 0.00 544.5K 305.9K 11.32 1.68 15/05/16-00:06 25.83 71.41 0.02 521.1K 280.4K 13.32 1.48 15/05/16-00:07 25.68 71.42 0.00 495.0K 265.2K 12.08 1.21 15/05/16-00:08 30.89 71.41 0.01 811.0K 280.1K 14.92 0.92 15/05/16-00:09 23.83 71.41 0.03 636.7K 349.4K 11.81 1.47
|
tsar查看指定日期的數據
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$ tsar --load -d 20160518 #指定日期,格式YYYYMMDD Time -------------------load----------------- Time load1 load5 load15 runq plit 18/05/16-09:20 0.00 0.00 0.00 0.00 147.00 18/05/16-09:25 0.00 0.00 0.00 0.00 147.00 18/05/16-09:30 0.00 0.00 0.00 0.00 149.00 18/05/16-09:35 0.35 0.11 0.04 0.00 147.00 18/05/16-09:40 0.00 0.03 0.01 0.00 147.00 18/05/16-09:45 0.00 0.00 0.00 0.00 147.00 18/05/16-09:50 0.00 0.00 0.00 0.00 147.00 18/05/16-09:55 0.00 0.00 0.00 0.00 146.00 18/05/16-10:00 0.00 0.00 0.00 0.00 146.00 18/05/16-10:05 0.00 0.00 0.00 0.00 146.00 18/05/16-10:10 0.00 0.00 0.00 0.00 147.00 18/05/16-10:15 0.00 0.00 0.00 0.00 146.00 18/05/16-10:20 0.00 0.00 0.00 1.00 148.00 18/05/16-10:25 0.01 0.01 0.00 0.00 146.00 18/05/16-10:30 0.00 0.00 0.00 0.00 146.00 18/05/16-10:35 0.00 0.00 0.00 0.00 146.00 18/05/16-10:40 0.00 0.00 0.00 0.00 146.00 18/05/16-10:45 0.00 0.00 0.00 0.00 146.00 18/05/16-10:50 0.00 0.00 0.00 0.00 146.00
|
tsar查看所有字段
1 2 3 4 5 6 7 8 9 10
|
$ tsar --mem -D Time -----------------------mem---------------------- Time free used buff cach total util 18/05/16-09:20 1333063680.00 480555008.00 38567936.00 100483072.00 1952669696.00 24.61 18/05/16-09:25 1333542912.00 479940608.00 38682624.00 100503552.00 1952669696.00 24.58 18/05/16-09:30 1332707328.00 480657408.00 38801408.00 100503552.00 1952669696.00 24.62 18/05/16-09:35 961646592.00 644251648.00 227205120.00 119566336.00 1952669696.00 32.99 18/05/16-09:40 961708032.00 644059136.00 227336192.00 119566336.00 1952669696.00 32.98 18/05/16-09:45 961646592.00 643997696.00 227434496.00 119590912.00 1952669696.00 32.98 18/05/16-09:50 960610304.00 644898816.00 227569664.00 119590912.00 1952669696.00 33.03
|
查看fstab指定掛在的系統目錄的使用情況 ,-I
指定查看某個目錄
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
$ tsar --partition -I / Time ---------------------------/---------------------------- Time bfree bused btotl util ifree itotl iutil 18/05/16-09:20 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:25 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:30 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:35 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:40 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:45 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:50 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-09:55 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:00 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:05 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:10 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:15 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:20 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:25 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:30 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:35 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:40 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:45 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-10:50 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 Time ---------------------------/---------------------------- Time bfree bused btotl util ifree itotl iutil 18/05/16-10:55 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:00 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:05 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:10 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:15 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:20 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:25 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:30 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 18/05/16-11:35 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71
MAX 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 MEAN 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71 MIN 27.5G 19.1G 49.1G 42.00 2.7M 3.1M 14.71
|
Tsar監控應用
Tsar默認支持的模塊,如下
1 2 3
|
$ ls /usr/local/tsar/modules mod_apache.so mod_haproxy.so mod_load.so mod_mem.so mod_nginx.so mod_pcsw.so mod_pernic.so mod_squid.so mod_tcp.so mod_traffic.so mod_cpu.so mod_io.so mod_lvs.so mod_ncpu.so mod_partition.so mod_percpu.so mod_proc.so mod_swap.so mod_tcpx.so mod_udp.so
|
默認安裝完后,只啟用了系統相關的模塊。如要監控應用就需手動啟用相應模塊,以Nginx為例
1 2
|
$ vim /etc/tsar/tsar.conf mod_nginx on
|
驗證Nginx模塊是否啟用
1 2
|
$ tsar -L|grep nginx nginx
|
配置Nginx
該配置主要是為nginx開啟status統計頁面,給tsar提供http數據。Tsar統計的原理是通過獲取status頁面的輸出結果,並對輸出內容進行統計和計算得出的結果。而且其獲取狀態頁的url默認是http://127.0.0.1/nginx_status ,所以在nginx上你必須有如下的配置
1 2 3 4 5 6
|
location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; }
|
注:以上的url並非不能更改,可以修改環境變量實現。其自帶的幾個環境變量如下。
1 2 3 4
|
export NGX_TSAR_HOST=192.168.0.1 export NGX_TSAR_PORT=8080 export NGX_TSAR_SERVER_NAME=status.taobao.com export NGX_TSAR_URI=/nginx_status
|
監控Nginx狀態
1 2 3 4 5 6 7 8 9 10 11 12
|
$ tsar --nginx -l -i 2 Time ----------------------------------------------nginx--------------------------------------------- Time accept handle reqs active read write wait qps rt sslqps spdyps sslhst 18/05/16-13:11:30 1.00 1.00 1.00 1.00 0.00 1.00 0.00 0.20 0.00 0.00 0.00 0.00 18/05/16-13:11:35 1.00 1.00 1.00 1.00 0.00 1.00 0.00 0.20 0.00 0.00 0.00 0.00 18/05/16-13:11:40 1.00 1.00 1.00 1.00 0.00 1.00 0.00 0.20 0.00 0.00 0.00 0.00 18/05/16-13:11:45 1.4K 1.4K 1.4K 1.00 0.00 1.00 0.00 280.40 0.00 0.00 0.00 0.00 18/05/16-13:11:50 1.00 1.00 1.00 1.00 0.00 1.00 0.00 0.20 0.00 0.00 0.00 0.00 18/05/16-13:11:55 1.00 1.00 1.00 1.00 0.00 1.00 0.00 0.20 0.00 0.00 0.00 0.00 18/05/16-13:12:00 10.1K 10.1K 10.1K 1.00 0.00 1.00 0.00 2.0K 0.00 0.00 0.00 0.00 18/05/16-13:12:05 2.00 2.00 2.00 1.00 0.00 1.00 0.00 0.40 0.00 0.00 0.00 0.00 18/05/16-13:12:10 1.00 1.00 1.00 1.00 0.00 1.00 0.00 0.20 0.00 0.00 0.00 0.00
|
參考文檔
http://www.google.com
http://code.taobao.org/p/tsar/wiki/index/
http://blog.csdn.net/Road_long/article/details/47959221
http://blog.itpub.net/22664653/viewspace-1273519/
http://www.361way.com/tsar-nginx/2308.html