HackIllinois / api

The Official API supporting HackIllinois
https://api.hackillinois.org
Other
23 stars 51 forks source link

Add pool limit for mongodb connection #459

Closed tanyongzhi closed 2 years ago

tanyongzhi commented 2 years ago

This PR limits the number of our pooled connections to Mongo.

Testing with calling the POST /registration/attendee/ endpoint 300 times concurrently:

Note that this test was done locally. I chose the value of 25 for now, although suggestions for other pool limit values are welcome

PatrickKan commented 2 years ago

Fixes #404 ? (Or does the rate limit need to be in place to truly fix it?)

tanyongzhi commented 2 years ago

Fixes #404 ? (Or does the rate limit need to be in place to truly fix it?)

I think we should leave #404 open for now, but perhaps rename it and provide a little bit more context in the issue description, since the issue with Mongo is a symptom of the much larger problem of rate limiting requests.

Let me know if you think that this is a good approach!

PatrickKan commented 2 years ago

Sounds good to keep the issue open, looks good to merge! Can def try to stress test the API once these changes are in master