分享

Nginx主模块(二)

 thy 2009-07-24

Ssl_engine

语法:ssl_engine engine

缺省值:视系统而定

使用此指令我们可以设置自己喜欢的任何一个可用(availiable)的openssl engine 。可在命令行使用openssl engine –t 查看有哪些engine处于availiable状态。

E.g.:

  $ openssl engine -t
(cryptodev) BSD cryptodev engine
      [ available ]
(dynamic) Dynamic engine loading support
      [ unavailable ]

Timer_resolution

语法:timer_resolution t

缺省值:none

E.g.

Timer_resolution 100ms100毫秒)

The directive allows to decrease number gettimeofday() syscalls. By default gettimeofday() is called after each return from kevent(), epoll, /dev/poll, select(), poll().

But if you need an exact time in logs when logging $upstream_response_time, or $msec variables, then you should use timer_resolution.

这个指令允许降低gettimeofday()系统调用的次数,但在默认情况下每次从kevent(),epollselect()poll(), /dev/polll返回时 都会调用gettimeofday()。

    但如果在记录$upstream_response_time, or $msec变量时需要额外的时间,就应该使用timer_resolution指令。

User

语法:user user [group]

缺省值:nobody nobody

指定Nginx Worker进程运行用户,默认是nobody一般我们会增加www www用户和组来作为此进程的运行用户和组。

Worker_cpu_affinity

语法:worker_cpu_afffinity cpumask [cpumask…]

缺省值:none

Linux only.

With this option you can bind the worker process to a CPU, it calls sched_setaffinity().

仅适用于Linux系统,此指令可以调用sched_setaffinit() worker进程和cpu绑定在一起。

E.g.

Worker_processes 4; //指定work_process启用的个数

Worker_cpu_affininty 0001 0010 0100 1000; //为每个worker_process绑定一个cpu

worker_procesess      2;
worker_cpu_affinity 0101 1010;

Bind the first worker to CPU0/CPU2, bind the second worker to CPU1/CPU3. This is suitable for HTT.

CPU0/CPU2绑定给第一个worker进程,将CPU1/CPU3绑定给第二个worker进程。由此我们可以看出每一个二进制位代表一个cpu0001表示cpu00010表示cup1 0100cpu21000cpu3,然后使用“|”按位或的运算将值合到一起。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多