lundi 20 avril 2015

apr_socket_recv: connection reset by peer (104) nodejs Ubuntu 14.10 x64 8GB RAM 4 Core (VPS)

I am working on a project in node.js. The project is about location(GPS) tracking. The ultimate target for my project is to server 1M concurrent requests. What i have done are,

Created a server in node.js listing on port 8000
A html document with google map to locate user positions/GPS locations
A single socket connection between server and html document to pass location information
An API to get user location from client devices ( it can be a mobile app )
Once a server receives user location via the API mentioned it will emit that information to client (HTML document) via socket.

Its working well and good.

Problem
I am using apachebench for load test my server. When i increase the concurrency benchmarking breaks frequently with the error

apr_socket_recv: Connection reset by peer (104)  

how can i solve this, Whats the actual cause of this problem.

Note: if i run the same server in my local windows machine it serving 20K requests successfully.

I have changed the

ulimit -n 9999999

and the soft and hard file openings limit to 1000000

neither solves my problem.
please help me to understands the problem clearly. How i increase the concurrency to 1M. is it possible with some more hardware/network tunings?

Edit:

I am using socketCluster on the server with the no of worker equivalent to the no of Core/CPU (i.e) 4 workers in my case
The CPU usage with the htop command in server terminal is 45%
Memory usage was around 4GB / 8GB & swap space not used
The ab command i used to load the server was

ab -n 20000 -c 20000 "http://IP_ADDRESS:8000/API_INFO"

Aucun commentaire:

Enregistrer un commentaire