Hi Gustaf,

The results are completely stable, from 5 to 5000 requests, and with concurrency from 1 to 10ish. I'm running on linux, haven't had any issues with ab before. I actually initially noticed the issue using jmeter.

The timing is stable enough that it feels like a timeout or artificial delay, but no idea what that would be. Here is a snippet from 'strace -r' output that highlights a delay of about the right amount of time:

[pid 19394] 0.000012 write(2, "[30/Nov/2018:10:24:11][19386.7fd"..., 108 <unfinished ...> [30/Nov/2018:10:24:11][19386.7fdb0b086700][-conn:default:1:1-] Debug(request): end GET /hello.html HTTP/1.0 [pid 19395] 0.000008 poll([{fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 5001 <unfinished ...>
[pid 19394]      0.000016 <... write resumed> ) = 108
[pid 19394] 0.000021 write(2, "[30/Nov/2018:10:24:11][19386.7fd"..., 269[30/Nov/2018:10:24:11][19386.7fdb0b086700][-conn:default:1:1-] Debug: [1] end of job, waiting 0 current 2 idle 1 ncons 9998 fromQueue 0 start 1543602251.352459 1543602251.352459 accept 0.000000 queue 0.000491 filter 0.000051 run 0.000971 netrun 0.000920 total 0.001462
) = 269
[pid 19394] 0.000039 futex(0x1722224, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 5, {1543602371, 353964000}, ffffffff <unfinished ...> [pid 19395] 0.039269 <... poll resumed> ) = 1 ([{fd=8, revents=POLLIN}]) [pid 19395] 0.000058 write(2, "[30/Nov/2018:10:24:11][19386.7fd"..., 118[30/Nov/2018:10:24:11][19386.7fdb0a885700][-driver:nssock:0-] Debug(ns:driver): === PollWait returned 1, trigger[0] 0
) = 118
[pid 19395] 0.000065 write(2, "[30/Nov/2018:10:24:11][19386.7fd"..., 108[30/Nov/2018:10:24:11][19386.7fdb0a885700][-driver:nssock:0-] Debug(ns:driver): RequestNew reuses a Request
) = 108

Right around 39ms in "... poll resumed".

I tried running ab from a different host, and there, things work as expected. I wonder if there is some localhost network delay being injected here (delayed ack or nagle?). Strangely tho, tclhttpd isn't affected; the keepalive and non-keepalive times are both in the 1 ms/request range.

So really, this appears to be NOT a naviserver issue...

-J

On 11/30/2018 01:11 AM, Gustaf Neumann wrote:
Hi Jeff,

30 requests are not a lot. Are these results stable?
When I tried to repeat your results, I started the server
with your configuration:

    /usr/local/ns/bin/nsd -u nsadmin -t ~/scripts/aol/jeff-conf.tcl -f

When running "ab" without -k" and 1000 requests:
    ab -n 1000 -c 1http://localhost:8080/hello.html
    ...
    Time per request:       0.168 [ms] (mean)
When running  "ab" with -k" and 1000 requests:
    ab -k -n 1000 -c 1http://localhost:8080/hello.html
    ...
    Time per request:       0.098 [ms] (mean)
The results of "ab" are most probably platform dependent.
My results are on a notebook with macOS Darwin 17.7.0,
NaviServer 4.99.17, some snapshot of Tcl 8.7,
most components without C-level optimization.

The reported times show that the keepalive option
improves the results, which is an expected result.

With high numbers for "-c", "ab" hangs sometimes, but that
might be a problem with "ab" on the mac (Apple version);
i remember that i had to fix "ab" in the past in order to get results
on the mac at all.

all the best
-gn

On 29.11.18 23:48, Jeff Rogers wrote:
Hi all,

I am running a test using ab against a local naviserver instance with a vanilla config, and I am seeing requests with http keepalive enabled having a delay of ~38ms per request compared to non-keepalive. This rather surprised me; is there a config setting to avoid that delay, or is it otherwise to be expected?

My config:

ns_section      "ns/servers"
ns_param         default         Naviserver

ns_section      "ns/server/default"
ns_param minthreads 20

ns_section      "ns/server/default/modules"
ns_param         nscp            nscp.so
ns_param         nssock          nssock.so
ns_param         nslog           nslog.so

ns_section      "ns/server/default/module/nssock"
ns_param port 8080


Tests:

$ ab -n 30 -c 1 http://localhost:8080/hello.html
...

Time per request:       0.170 [ms] (mean)

$ ab -k -n 30 -c 1 http://localhost:8080/hello.html
...

Time per request: 38.666 [ms] (mean)





_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to