2

I have used Sails framework for my web application. Now we are calling services from mobile app.

I found that the Sails executes only 4 request at a time. Is there any way I can increase that?

2 Answers2

0

Are you sure about that?

I've tested my sails app multiple times with: https://github.com/alexfernandez/loadtest

For example: loadtest http://localhost:1337 --rps 150 -c 20 -k

You can set it to any route of your app, and send GET/POST/PUT/DEL requests. The -c option means concurrent, so you can play with that number and check your app limits, but 5 concurrent is too low.

josebaseba
  • 101
  • 4
  • Thanks for the response. I will this. You can have infinite loop in the method and call the same method 10 time. You will see only 4 request running and rest are in waiting. – Abhishek Upadhyay Sep 21 '16 at 09:33
0

Most likely your browser or http client is limiting the number of requests per server. Refer to https://stackoverflow.com/a/985704/401025 or lookup the maximum number of requests from the manual of your http client.


There are no tcp connection limits imposed by sails or by nodejs. In matter of fact nodejs is known to be able to handle thousands of simultaneous connections.

Without knowing your server/nodejs setup it is hard to say why you are seeing a limit of 4 connections.

Depending on which nodejs version you use, you might check the http module of nodejs and following attributes:

https://nodejs.org/api/net.html#net_server_maxconnections

Set this property to reject connections when the server's connection count gets high.

https://nodejs.org/api/http.html#http_agent_maxsockets

By default set to Infinity. Determines how many concurrent sockets the agent can have open per origin. Origin is either a 'host:port' or 'host:port:localAddress' combination.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601