-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.cn
100 lines (73 loc) · 1.9 KB
/
README.cn
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
ngx_debug_timer
==============
该模块可以提供NGINX/Tengine定时器的状态信息。
示例
=======
获取NGINX/Tengine定时器的状态信息
---------------------------------
```
http {
server {
listen 80;
location = /debug_timer {
debug_timer;
}
}
}
```
请求URI /debug_timer,可以获取到该NGINX/Tengine定时器的使用情况统计。
页面输出如下:
```
$ curl 'localhost:80/debug_timer'
pid:80490
timer:2
--------- [0] --------
timers[i]: 00007F837D02C4B8
timer: 148
ev: 00007F837D02C488
data: 00007F837D02C450
handler: 000000010778B450
action:
--------- [1] --------
timers[i]: 00007F837D02C698
timer: 1263
ev: 00007F837D02C668
data: 00007F837D02C630
handler: 000000010778B450
action:
```
定时器的使用情况统计
-----------------------------------
数据说明
====
每个数据段落如"[0]"包含当前标号对应定时器的状态信息,数据项意义如下:
* __timers__: 当前定时器地址
* __timer__: 当前定时器的超时时间
* __ev__: 当前定时器的关联事件
* __data__: 当前定时器的关联事件字段
* __handler__: 当前定时器的关联事件handler,配合addr2line来查询对应函数
* __action__: 当前定时器的log action
NGINX兼容性
===================
* 1.13.4 (stable version of 1.13.x) 及其更高版本
Tengine兼容性
=====================
* 2.1.1 (stable version of 2.1.x) 及其更高版本
安装说明
=======
源码安装,执行如下命令:
```
$ wget http://nginx.org/download/nginx-1.13.4.tar.gz
$ tar -xzvf nginx-1.13.4.tar.gz
$ cd nginx-1.13.4/
$ ./configure --add-module=/path/to/ngx_debug_timer
$ make -j4 && make install
```
配置指令
=========
语法: **debug_timer**
默认: `none`
位置: `server, location`
NGINX/Tenigne的定时器状态信息可以通过该location访问得到。
注意信息
=========