Closed dorinesinenco closed 1 year ago
import HyperExpress from 'hyper-express' import { MongoClient } from 'mongodb'
None of this is uWS. I don't know why it is reported here. Report issues in respective projects, not here.
What I can add, however, is that ab (ApacheBench) is a tool written in the 1990s for HTTP1.0 which is a deprecated protocol nobody should be using, and not supported by uWS so it's not supposed to work. uWS implements the latest RFC for HTTP1.1.
If you want some more competent usage of uWS, you can look at Bun and its DB connectors - I cannot be responsible for whatever MongoClient or HyperExpress does wrong.
Hi! I decided to try out uWebSockets.js
I'm running a simple app, this is the main code
basically retrieving 50 random docs from a mongodb database where we have already 100k documents, when i try to benchmark this with ab it hangs, then i tried wrk (using: wrk -t1 -c500 -d10s http://localhost:8000/bench) and it gives me about 350 reqs/s using 100% (12 cores on ubuntu), while the same exact test, on the same machine, using only 15% of the same CPU - gives me about 5600reqs/s on fastify.js
NOTE1: i tried a simple {hello: "World"} without accessing the db and on 25% CPU load uWebSockets gives me about 200000 reqs/s NOTE2: both apps run in docker containers
Can't get if the issue is on the mongo driver side (although i used the same driver for fastify) or on the framework itself, or maybe i did something wrong )?
IF you have any idea, please let me know. Thank you!