I am working on a project in node.js. The project is dedicated to location tracking (GPS). The ultimate goal of my project is to request a 1M server at the same time. What I've done,
Created a server in the node.js list on port 8000
Html document with google map to determine user location / GPS location
Single socket connection between server and html document for transmitting location information
API for determining the location of the user from client devices (this may be a mobile application)
As soon as the server receives the user's location through the mentioned API, it will transmit this information to the client (HTML document) through the socket.
It works well and well.
Problem
I am using apachebench to load my server. When I increase concurrency, benchmarking often breaks with an error
apr_socket_recv: Connection reset by peer (104)
How can I solve this, What is the actual cause of this problem.
Note. If I run the same server on my local Windows machine, it successfully executes 20K requests.
I changed
ulimit -n 9999999
and access to the soft and hard file is limited to 1,000,000
doesn't solve my problem.
Please help me understand the problem clearly. How to increase concurrency to 1M. is this possible with some additional hardware / network settings?
Edit:
I am using socketCluster on a server that does not have a working equivalent of no of Core / CPU (ie) 4 workers in my case
CPU usage with htop command in server terminal 45%
The memory usage was 4 GB / 8 GB and the swap space was not used.
The ab command used to load the server was
ab -n 20000 -c 20000 "http://IP_ADDRESS:8000/API_INFO"
source share