`--amount` is not precise with high concurrency
See original GitHub issueExample server (modified from restify/benchmarks):
// bare.js
'use strict'
let i = 0
const server = require('http').createServer(function (req, res) {
i++
res.setHeader('content-type', 'application/json; charset=utf-8')
res.end(JSON.stringify({ hello: 'world' }))
})
process.on('SIGINT', () => {process._rawDebug(`Reqs' ${i}`); process.exit(0)})
server.listen(3000)
Running npx against the server above with -a 1000000
and with the same parameters used on restify/benchmarks:
$ node benchmarks/bare.js &
[1] 14966
$ npx autocannon --debug -c 100 -p 10 -a 1000000 localhost:3000
Running 1000000 requests test @ http://localhost:3000
100 connections with 10 pipelining factor
running [====================] 99%βββββββββββ¬βββββββ¬βββββββ¬ββββββββ¬ββββββββ¬ββββββββββ¬ββββββββββ¬βββββββββββ
β Stat β 2.5% β 50% β 97.5% β 99% β Avg β Stdev β Max β
βββββββββββΌβββββββΌβββββββΌββββββββΌββββββββΌββββββββββΌββββββββββΌβββββββββββ€
β Latency β 0 ms β 0 ms β 11 ms β 13 ms β 1.42 ms β 3.75 ms β 130.8 ms β
βββββββββββ΄βββββββ΄βββββββ΄ββββββββ΄ββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββββ
βββββββββββββ¬βββββββββ¬βββββββββ¬ββββββββββ¬ββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββ
β Stat β 1% β 2.5% β 50% β 97.5% β Avg β Stdev β Min β
βββββββββββββΌβββββββββΌβββββββββΌββββββββββΌββββββββββΌβββββββββββΌβββββββββββΌβββββββββ€
β Req/Sec β 5211 β 5211 β 68927 β 75967 β 62447.63 β 17040.52 β 5208 β
βββββββββββββΌβββββββββΌβββββββββΌββββββββββΌββββββββββΌβββββββββββΌβββββββββββΌβββββββββ€
β Bytes/Sec β 855 kB β 855 kB β 11.3 MB β 12.5 MB β 10.2 MB β 2.8 MB β 854 kB β
βββββββββββββ΄βββββββββ΄βββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββ
Req/Bytes counts sampled once per second.
999k requests in 16.08s, 164 MB read
$ kill -INT 14966
Reqs' 999969
[1] + 14966 done node benchmarks/bare.js
autocannon
reports 999k
requests (instead of 1000k
), and when we stop the server it reports 999969
requests (instead of 1000000). With -c 1
and -p 1
the server will reply to 1000000 requests correctly.
This might be the server unable to handle that many concurrent requests, but autocannon
doesnβt report any errors (not even with --debug), so it might be a bug on autocannon
as well.
I saw this issue on both Node.js v10 and v12, and on autocannon 3.2.2
as well as 4.4.0
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
High-concurrency counters without sharding - Stack Overflow
Here are the tradeoffs I see: 2 does not require datastore transactions. To get the counter's value, #2 requires a datastore fetch while...
Read more >A Concurrency Cost Hierarchy - Performance Matters
Concurrent operations can be grouped relatively neatly into categories based on their cost.
Read more >Working with concurrency scaling - Amazon Redshift
With the Concurrency Scaling feature, you can support virtually unlimited concurrent users and concurrent queries, with consistently fast query performance.
Read more >Concurrency problems - theory and experimentation in SQL ...
Both transactions do not update this record to the same value. ... If no precision is made about a transaction isolation level in...
Read more >Warehouse Considerations - Snowflake Documentation
It does not provide specific or absolute numbers, values, ... including number of concurrent users/queries, number of tables being queried, and data size...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
sure. I created a pull request @mcollina
@elirandav Would you like to send a Pull Request to address this issue? Remember to add unit tests.