You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was stress testing the app in a local server and I discovered that the responses are sent in batches of 5. After some research I found that mongoose uses its default connection pool size, which is 5 (documentation). However, MongoDB's native driver has a default of 100 connections (documentation).
I would recommend changing mongoose.connect call in app.js to:
Can you please provide your stress test technique/data sets and the results before/after the change? It would be very helpful for us to reproduce and verify your suggestion.
The first test I run was inaccurate since I used Chrome and Firefox to run the test. However, both browsers have a limit of 6 parallel connections (as mr. @asidirop noted in a personal email). I run new tests on /announcements/public, which does not need authentication, using Apache Bench.
The results showed that, when the pool size is higher than the concurrency in Apache Bench, the API needs less time to respond to other requests that need access to the database.
We also tried to change this value in the production server and we saw an improvement when the server is stressed with an Apache Bench instance running in https://users.iee.ihu.gr.
I was stress testing the app in a local server and I discovered that the responses are sent in batches of 5. After some research I found that mongoose uses its default connection pool size, which is 5 (documentation). However, MongoDB's native driver has a default of 100 connections (documentation).
I would recommend changing
mongoose.connect
call in app.js to:The text was updated successfully, but these errors were encountered: