Closed mcollina closed 8 years ago
This is the server:
const http = require('http'); var len = 1024 * 1024 * 1024; var chunk = Buffer.alloc(len, 'x'); var server = http.createServer(function(req, res) { res.write(chunk); res.end() }); server.listen(1234, function() { });
And I am using this line: ./autocannon.js -d 10 -j localhost:1234
./autocannon.js -d 10 -j localhost:1234
Running 10s test @ http://localhost:1234 10 connections Stat Avg Stdev Max Latency (ms) 7344 1129.22 9497 Req/Sec 1 1.85 6 Bytes/Sec 1.1 GB 2.02 GB -1.88 GB 10 requests in 10s, 10.74 GB read
I think the problem lies in the int32 conversion:
https://github.com/mcollina/native-hdr-histogram/blob/master/hdr_histogram_wrap.cc#L91-L107
Damn, I remember thinking I will never hit that bug when I wrote those lines.....
cc @bzoz
Cast to int32_t done here in native-hdr-histogram is to blame. Just found it too.
int32_t
Edit: ah, I see you know the reason
This is the server:
And I am using this line:
./autocannon.js -d 10 -j localhost:1234
I think the problem lies in the int32 conversion:
https://github.com/mcollina/native-hdr-histogram/blob/master/hdr_histogram_wrap.cc#L91-L107
Damn, I remember thinking I will never hit that bug when I wrote those lines.....