Browse Source

updated core.md

pull/843/head
Xiaochen Wang 9 years ago
parent
commit
9a0dd2c2ea
  1. 110
      docs/core.md
  2. 115
      docs/core_cn.md

110
docs/core.md

@ -3,11 +3,13 @@
## Directives
---
### force_exit
> Syntax: **force_exit** exit_time;
> Default: —
> Context: main
Syntax: **force_exit** exit_time;
Default: —
Context: main
force worker processes to exit after exit_time.
@ -18,20 +20,23 @@ The force_exit support is not enabled by default. You should compile it explicit
```
---
### worker_processes
Syntax: **worker_processes** [num | auto]
Default: worker_processes auto
> Syntax: **worker_processes** [num | auto]
> Default: worker_processes auto
> Context: main
Context: main
Set the number of worker processes.
When set to 'auto', which is also the default behavior, Tengine will create the same number of worker processes as your CPUs.
---
> Syntax: **worker_cpu_affinity** [mask1 mask2 mask3 ... | auto | off]
> Default: worker_cpu_affinity off
> Context: main
### worker_cpu_affinity
Syntax: **worker_cpu_affinity** [mask1 mask2 mask3 ... | auto | off]
Default: worker_cpu_affinity off
Context: main
Bind worker processes to the sets of CPUs.
When set to 'auto', Tengine will automatically bind each worker process to a specific CPU. If the number of worker processes is larger than the number of your CPUs, then the rest of worker processes will be bond in descendant order. For example, if there are 8 CPUs in your system:
@ -48,11 +53,14 @@ When set to 'auto', Tengine will automatically bind each worker process to a spe
When set to 'off', Tengine will disable the CPU affinity.
---
> Syntax: **error_page** code ... [default] [=[response]]
> Default: -
> Context: http, server, location, if in location
### error_page
Syntax: **error_page** code ... [default] [=[response]]
Default: -
Context: http, server, location, if in location
This directive can specify the page for the specific HTTP response status.
@ -72,55 +80,69 @@ For example:
In this server block, the 404 error page will be set to Tengine's default 404 page.
---
> Syntax: **request_time_cache** [on | off]
> Default: request_time_cache on
> Context: http, server, location
### request_time_cache
Syntax: **request_time_cache** [on | off]
Default: request_time_cache on
Context: http, server, location
When set to 'off', Tengine will get a more precise time on $request_time, $request_time_msec, $request_time_usec because it does not use time cache.
---
> Syntax: **log_empty_request** [on | off]
> Default: log_empty_request on
> Context: http, server, location
### log_empty_request
Syntax: **log_empty_request** [on | off]
Default: log_empty_request on
Context: http, server, location
When you specify it 'off', Tengine will not record any access log when a client issues a connection without any data being sent.
By default, it's on. In the above case, it will print a 400 Bad Request message into the access log.
By default, it's on. In the above case, it will print a 400 Bad Request message into the access log.
### server_admin
Syntax: **server_admin** admin
---
Default: none
> Syntax: **server_admin** admin
> Default: none
> Context: http, server, location
Context: http, server, location
Specify the administrator's information, which will appear in a default 4xx/5xx error response when 'server_info' is turned on.
---
> Syntax: **server_info** on | off
> Default: server_info on
> Context: http, server, location
### server_info
Syntax: **server_info** on | off
Default: server_info on
Context: http, server, location
Show up the server information in a default 4xx/5xx error response. The URL accessed by the user, the hostname serving the request, and the time are included.
---
> Syntax: **server_tag** off | customized_tag
> Default: none
> Context: http, server, location
### server_tag
Syntax: **server_tag** off | customized_tag
Default: none
Context: http, server, location
Specify the customized 'Server' header in the HTTP responses, for example, 'Apache/2.2.22', 'IIS 6.0', 'Lighttpd', etc. You could also suppress the 'Server' header by setting it to 'off'.
---
> Syntax: **reuse_port** on | off
> Default: reuse_port off
> Context: events
### reuse_port
turn on support for SO_REUSEPORT socket option. This option is supported since Linux 3.9.
Syntax: **reuse_port** on | off
Default: reuse_port off
[benchmark](benchmark.html)
<!-- [benchmark](../download/reuseport.pdf) -->
Context: events
turn on support for SO_REUSEPORT socket option. This option is supported since Linux 3.9.

115
docs/core_cn.md

@ -2,9 +2,13 @@
## 指令
> Syntax: **force_exit** exit_time;
> Default: —
> Context: main
### force_exit
Syntax: **force_exit** exit_time;
Default: —
Context: main
强制worker进程在接受到QUIT信号后 exit_time 时间退出。
@ -15,19 +19,24 @@ force_exit功能默认没有编译开启。需要编译时开启:
```
---
### worker_processes
Syntax: **worker_processes** [num | auto]
> Syntax: **worker_processes** [num | auto]
> Default: worker_processes auto
> Context: core
Default: worker_processes auto
Context: core
为worker_processes增加参数auto。当设置成auto,tengine将自动启动与cpu数量相同的worker进程。
---
> Syntax: **worker_cpu_affinity** [mask1 mask2 mask3 ... | auto | off ]
> Default: worker_cpu_affinity off
> Context: core
### worker_cpu_affinity
Syntax: **worker_cpu_affinity** [mask1 mask2 mask3 ... | auto | off ]
Default: worker_cpu_affinity off
Context: core
为worker_cpu_affinity增加参数auto和off。当设置成auto时,tengine将根据worker的数量自动配置cpu绑定位图。绑定的顺序是按CPU编号从大到小。
如果worker数量大于cpu数量,则剩余的worker进程将按照CPU编号从大到小的顺序从编号最大的CPU开始再次绑定。例如:某CPU有8核,
@ -40,11 +49,14 @@ force_exit功能默认没有编译开启。需要编译时开启:
worker_cpu_affinity的error log最多显示64个CPU的绑定情况。
---
> Syntax: **error_page** code ... [default] [=[response]]
> Default: -
> Context: http, server, location, if in location
### error_page
Syntax: **error_page** code ... [default] [=[response]]
Default: -
Context: http, server, location, if in location
该指令用于设置如果出现指定的HTTP错误状态码,返回给客户端显示的对应uri地址。
@ -65,66 +77,79 @@ http {
server中的"error_page"指令将404的页面还原成系统默认。
---
> Syntax: **msie_padding** [on | off]
> Default: msie_padding off
> Context: http, server, location
### msie_padding
Syntax: **msie_padding** [on | off]
Default: msie_padding off
Context: http, server, location
此指令关闭或开启MSIE浏览器的msie_padding特性,若启用选项,nginx会为response头部填满512字节,这样就阻止了相关浏览器会激活友好错误界面,因此不会隐藏更多的错误信息。Tengine中默认关闭此功能。
---
> Syntax: **request_time_cache** [on | off]
> Default: request_time_cache on
> Context: http, server, location
### request_time_cache
Syntax: **request_time_cache** [on | off]
Default: request_time_cache on
Context: http, server, location
设置成'off'时,Tengine将不使用时间缓存,$request_time、$request_time_msec和$request_time_usec将会得到更精确的时间。
---
> Syntax: **log_empty_request** [on | off]
> Default: log_empty_request on
> Context: http, server, location
### log_empty_request
Syntax: **log_empty_request** [on | off]
Default: log_empty_request on
Context: http, server, location
设置成'off'时,Tengine将不会记录没有发送任何数据的访问日志。默认情况下,Tengine会在访问日志里面记录一条400状态的日志。
---
> Syntax: **server_admin** admin
> Default: none
> Context: http, server, location
### server_admin
Syntax: **server_admin** admin
Default: none
Context: http, server, location
设置网站管理员信息,当打开server_info的时候,显示错误页面时会显示该信息。
---
> Syntax: **server_info** on | off
> Default: server_info on
> Context: http, server, location
### server_info
Syntax: **server_info** on | off
Default: server_info on
Context: http, server, location
当打开server_info的时候,显示错误页面时会显示URL、服务器名称和出错时间。
---
> Syntax: **server_tag** off | customized_tag
> Default: none
> Context: http, server, location
### server_tag
Syntax: **server_tag** off | customized_tag
Default: none
Context: http, server, location
自定义设置HTTP响应的server头,‘off’可以禁止返回server头。如果什么都不设置,就是返回默认Nginx的标识。
---
> Syntax: **reuse_port** on | off
> Default: reuse_port off
> Context: events
### reuse_port
Syntax: **reuse_port** on | off
当打开reuse_port的时候,支持SO_REUSEPORT套接字参数,Linux从3.9开始支持。
Default: reuse_port off
Context: events
[测试报告](benchmark_cn.html)
当打开reuse_port的时候,支持SO_REUSEPORT套接字参数,Linux从3.9开始支持。
Loading…
Cancel
Save