OpenFastPath / nginx_ofp

NGiNX integrated with OFP_ODP_DPDK
26 stars 14 forks source link

Performance issue with dpdk on single core #7

Open HsuJv opened 4 years ago

HsuJv commented 4 years ago

Hi there,

As my post in ofp#242, I've set up an env that runs nginx_ofp with dpdk, tested with wrk.

But it turns out to be that the nginx ofp is much slower than the original nginx. I compiled it following your README and only modify some codes to make it runs on a single core

The test resultes are:

--------------------------original nginx-------------------------- [xxx@yyy ~]$ wrk -c4000 -d120s -t12 --latency "http://myserver//" Running 2m test @ http://myserver// 12 threads and 4000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 41.19ms 104.87ms 2.00s 96.46% Req/Sec 2.39k 1.25k 9.29k 68.53% Latency Distribution 50% 24.46ms 75% 29.89ms 90% 38.71ms 99% 494.92ms 2559265 requests in 2.00m, 409.92MB read Socket errors: connect 2987, read 0, write 0, timeout 945 Requests/sec: 21313.51 Transfer/sec: 3.41MB


+ wrk from the host which runs nginx itself and got

--------------------------nginx_ofp-------------------------- [root@localhost wrk-master]# ./wrk -c1000 -d120s -t12 --latency "http://myserver//"
Running 2m test @ http://myserver// 12 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 55.50ms 10.34ms 268.90ms 87.49% Req/Sec 1.34k 214.35 2.35k 69.42% Latency Distribution 50% 55.35ms 75% 59.35ms 90% 63.86ms 99% 81.24ms 1926373 requests in 2.00m, 306.85MB read Socket errors: connect 0, read 1, write 0, timeout 0 Requests/sec: 16040.38 Transfer/sec: 2.56MB

--------------------------original nginx-------------------------- [root@localhost wrk-master]# ./wrk -c1000 -d120s -t12 --latency "http://myserver//"
Running 2m test @ http://myserver// 12 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 30.68ms 106.45ms 2.00s 91.86% Req/Sec 3.27k 1.58k 21.29k 77.98% Latency Distribution 50% 2.73ms 75% 3.01ms 90% 82.72ms 99% 380.81ms 4664706 requests in 2.00m, 747.14MB read Socket errors: connect 0, read 826, write 0, timeout 376 Requests/sec: 38840.71 Transfer/sec: 6.22MB


Here's my nginx.conf, both of the original and the ofp one use the same configure

user root; worker_processes 1;

error_log logs/error.log info;

events { worker_connections 1024; }

http { include mime.types; default_type application/octet-stream;

sendfile        off;

keepalive_timeout  65;

server {
    listen       80;
    server_name  localhost;

    access_log /dev/null;

    location / {
        return 200 "Testing";
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

}

}



Thanks in advance for your kindly advise
QinLongFei commented 4 years ago

I also confused the performance result. ofp-nginx run user space with dpdk. It should be faster than original niginx ideally. But the result was negative.

So, do we have official test result about ofp-nginx compare to other kernel or user stack? Thanks