博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
F-Stack Nginx APP Guide
阅读量:2029 次
发布时间:2019-04-28

本文共 3728 字,大约阅读时间需要 12 分钟。

F-Stack Nginx APP Guide

F-Stack is an open source network framework based on DPDK. F-Stack supports standard Nginx as HTTP framework which means all web application based on HTTP can easily use F-Stack.

How does Nginx use F-Stack?

Nginx APP is in app/nginx-1.16.1 directory.

+--------+                         +------------------------+     |                            channel: socketpair         |                         +------------------------+     |  signal(reload, quit..)                                                        |                                                        |                                              +---------v--------+                                              |                  |                             +----------------+  master process  +---------------+                             |                |                  |               |                             |  channel       +----------+-------+               |                             |                           |              channel  |                             |                  channel  |                       |                             |                           |                       |                   +---------+----------+     +----------+--------+    +---------+--------+first one to start |                    |     |                   |    |                  | last one to exit<-+   primary worker   |     |  secondary worker |    | secondary worker |                   |                    |     |                   |    |                  |                   +--------------------+     +-------------------+    +------------------+                   +--------------------+     +-------------------+                     |                    |     |                   |                   |   fstack,kernel    |     |   fstack,kernel   |                   |     and channel    |     |     and channel   |                   |     loop thread    |     |     loop thread   |                   |                    |     |			  |                   +--------------------+     +-------------------+                    woker process cycle        woker process cycle
  • spawn primary worker firstly, and then wait for primary startup, continue to spawn secondary workers.

  • a major addition to the worker process is fstack-handling:ff_init();ff_run(worker_process_cycle); worker_process_cycle(handle channel/host/fstack event).

What’s Different?

New directives:

All the directives below are available only when NGX_HAVE_FSTACKis defined.

Syntax: kernel_network_stack on | off;    Default: kernel_network_stack off;    Context: http, server    Determines whether server should run on kernel network stack or fstack.
Syntax: proxy_kernel_network_stack on | off;    Default: kernel_network_stack off;    Context: http, stream, mail, server    Determines whether proxy should go through kernel network stack or fstack.
Syntax: schedule_timeout time;    Default: schedule_timeout 30ms;    Context: main    Sets a time interval for polling kernel_network_stack. The default value is 30 msec.

Command-line reload

the reload is not graceful, service will still be unavailable during the process of reloading.

Necessary modifies in nginx.conf:

user  root; # root account is necessary.    fstack_conf f-stack.conf;  # path of f-stack configuration file, default: $NGX_PREFIX/conf/f-stack.conf.    worker_processes  1; # should be equal to the lcore count of `dpdk.lcore_mask` in f-stack.conf.    events {        worker_connections  102400; # increase        use kqueue; # use kqueue    }    sendfile off; # sendfile off

Nginx compiling

./configure --prefix=/usr/local/nginx_fstack --with-ff_modulemakemake install

转载地址:http://qppaf.baihongyu.com/

你可能感兴趣的文章
enable_shared_from_this模板类使用完全解析
查看>>
回调函数的使用
查看>>
python升级导致yum命令无法使用的解决办法
查看>>
const constexpr C++ 解释
查看>>
SecureCRT中文显示乱码
查看>>
将Putty生成的PrivateKey转换为SecureCRT所需的PublicKey
查看>>
调整Windows7下时间同步的频率
查看>>
ubuntu下mysql-python模块的安装
查看>>
vi/vim 中如何在每行行首或行尾插入指定字符串
查看>>
CentOS下安装JDK1.7
查看>>
Python 获取时间
查看>>
linux 查看端口被哪个程序占用
查看>>
socket
查看>>
Eclipse 找不到Server选项
查看>>
把java文件打包成.jar (jar命令详解)
查看>>
Spring下载地址
查看>>
Linux 日志
查看>>
Linux日志2
查看>>
VS的路径变量[转]
查看>>
MFC消息处理[转]
查看>>