简体   繁体   中英

Express.js application maxing CPU

I have built an Express.js application, running on Ubuntu with a Intel Xeon CPU E5540 2.53Ghz.

The application uses MongoDB for session storage ( express-session-mongo ), EJS for view rendering, MySQL for data storage and Faye for internal messaging. All static files are served by Apache on a different port.

It is a real-time application with a lot of long-polling, where Faye helps a lot. It needs to scale up to at least 500 concurrent users, who will be listening to two different long-polling connections each.

The application maxes CPU around 80-100 users though, which causes 500 errors.

Any ideas about what could be the problem or any general advice about how to debug and fix an issue like this?

You need profile your application to find the bottleneck. You can use look or nodetime to collect CPU profile and find hot spots in your code.

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