I have a VPS with the following configuration:
Processor: 8 cores 2.8 GHz
Memory: 8 GB
Disk: 40 GB SSD
Operating system: Ubuntu 20
This is for a chat application implemented in NodeJS using Socket IO and Express. MongoDB database is used and Redis is used for @socket.io/redis-adapter
(sharded adapter).
When about 700 clients are connected to the server and are sending messages and calling REST APIs, the average server load is 15 (which is given in the screenshot), while less than 4 GB of memory is used and the application slows down. (When I used 6 processor cores, 7 GB of memory was used)
My question is: Is this amount of CPU usage normal for this number of clients? Or is my server not well implemented?
Now, should I upgrade the server or redeploy the application?
Update: In a real test, I generated output from a Node JS app using node --prof
. This output is related to one of the server application workers.