简体   繁体   中英

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.

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 eg nginx for such purposes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM