0

We are using sails framework for our web application and MongoDB as database.

Now we are calling services of the web app from the mobile.

There can be around 200-300 concurrent users calling webservice.

I observed that there are around 5-6 services executed and rest are ignore with time out exception.

I read somewhere that sails-mongo has default connection pool size 5.

How can I change it?

Here is config file. Though the connection pool size not changing. mongodb: { adapter: 'sails-mongo', url : 'mongodb://127.0.0.1:27017/mydb?poolSize=200' },

user3759750
  • 123
  • 3
  • 10

2 Answers2

1

I found poolSize configuration in sails-mongo documention.

Can you try something like below.

  someMongoDb: {
adapter: 'sails-mongo',
host: 'localhost', // defaults to `localhost` if omitted
port: 27017, // defaults to 27017 if omitted
user: 'username_here', // or omit if not relevant
password: 'password_here', // or omit if not relevant
database: 'database_name_here' // or omit if not relevant
poolSize: 10 //or omit if not relevant

}

  • Thanks for the response. I tried this still not working. It looks like the sails framework limits the concurrent request. I remove the fetching data from mongodb and just make the method empty without sending response. I observe that it executes 4 requests and make other request for wait. If I kill one request it takes other waited request. – user3759750 Sep 20 '16 at 19:41
0

It looks like the sails framework limits the concurrent request. I remove the fetching data from mongodb and just make the method empty without sending response. I observe that it executes 4 requests and make other request for wait. If I kill one request it takes other waited request

Sails/node/mongodb are not the problem as they can handle thousands of simultaneous requests. Nodejs is configured to accept infinite number of sockets by default https://nodejs.org/api/http.html#http_agent_maxsockets.

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.

Community
  • 1
  • 1
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601