Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

If load balancer is a bottle neck, then how sites like google serve millions of queries per second

I am using following setup: 1 express (node.js) server running on quad-core system. Since, node.js by default is single threaded, I assume having 4 cores is moot point.

I benchmarked my server using ab (apache benchmark):

ab -n 10000 -c 1000 http://<hostname>:8004/
Requests per second:    2636.53 [#/sec] (mean)
CPU 60%

ab -n 1000 -c 100 http://<hostname>:8004/
Requests per second:    2641.15 [#/sec] (mean)
CPU 15%

ab -n 25000 -c 10000 http://<hostname>:8004/
Time per request:       5382.541 [ms] (mean)
CPU 100%

My server is pretty simple:

var express = require('express');

var app = express();

app.get('/', function (req, res) {
    res.send({'status': 'ok'});
});


app.listen(8004, () => console.log("Listening on port 8004"));

As I can see in the above measurements maximum requests I can serve per second is just over 5,000. Since, it is pretty plain server, I would expect the number of requests would decrease drastically, as soon I as put some business logic in it.

My question is how sites like google able to scale to millions of queries per second.

Do they use hardware with very high configuration? Or something else?

Comments