nginx-tldk.conf revision e18a033b
1
2user  root;
3worker_processes 2;
4
5# run nginx workers on cpus 5-6.
6worker_cpu_affinity 100000 1000000;
7
8#with TLDK daemon mode is not supported right now.
9daemon off;
10
11pid  /local/nginx.cfg/logs/nginx.pid;
12
13events {
14    use epoll;
15    worker_connections  10240;
16    accept_mutex off;
17}
18
19http {
20    include       mime.types;
21    default_type  application/octet-stream;
22
23    access_log      off;
24    error_log       /local/nginx.cfg/logs/error.log emerg;
25
26    #with TLDK sendfile is not supported right now.
27    sendfile  off;
28
29    keepalive_timeout  0;
30    keepalive_requests 0;
31
32    output_buffers 1 2m;
33
34    open_file_cache max=20000 inactive=1h;
35    open_file_cache_valid 1h;
36    open_file_cache_min_uses 1;
37    open_file_cache_errors on;
38
39
40    server {
41        listen              6000 backlog=4096;
42        server_name         www.xz1;
43        location / {
44            root   /local/nginx.cfg/html;
45            index  index.html index.htm;
46        }
47    }
48}
49
50tldk_main {
51    #create 2 DPDK slave lcores on cpus 9-10.
52    eal_cmd --lcores=8-10 -n 4;
53    port 0 rx_offload 0xf tx_offload 0xf ipv4 192.168.1.60;
54}
55
56tldk_ctx {
57        worker 0;
58        lcore 9;
59        # for benchmarking purposes set TCP TIMEWAIT to zero.
60        tcp_timewait 0;
61        # remove next line to make TLDK back-end to run a DPDK slave lcore 9
62        # within nginx master process.
63        be_in_worker;
64        mbufs 0x20000;
65        streams 0x8000;
66        sbufs 0x100;
67        rbufs 0x800;
68        dev 0 port 0 queue 0;
69        dest dev 0 addr 192.168.1.0 masklen 24 mac 3C:FD:FE:9F:D1:E1;
70}
71
72tldk_ctx {
73        worker 1;
74        lcore 10;
75        tcp_timewait 0;
76        be_in_worker;
77        mbufs 0x20000;
78        streams 0x8000;
79        sbufs 0x100;
80        rbufs 0x800;
81        dev 0 port 0 queue 1;
82        dest dev 0 addr 192.168.1.0 masklen 24 mac 3C:FD:FE:9F:D1:E1;
83}
84