user1095490
user1095490

Reputation: 11

Node.js performance bottleneck

I'm currently working on a Node.js app which implement with Express.js. The bussiness is quite simple, send static JSON data alone with response. But when I test performance with ApacheBench the QPS is very poor, only about 1000q/s, this machine is 24 cores/96Gb, during the test CPU usage is around 3~5%, network I/O is also very low. Where could the bottleneck is?

Thanks.

Upvotes: 1

Views: 2132

Answers (1)

Damian Krawczyk
Damian Krawczyk

Reputation: 2241

It is hard to judge without seeing code sample... Node.js is single thread so it won't "scale automatically" when you will increase number of cores. You can try spawn multiple processes with Cluster. However if your resource is static you should consider serving it with Express static middleware or consider e.g. nginx for such purposes.

Upvotes: 2

Related Questions