I have an application that is meant to check the status of text messages and resend same, if failed, but each time after I restart it on Heroku, it works well for about 15 minutes, before it crashes with the following error:
ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)):
This I suspect is being caused by the high number of hit to the application endpoint.
I am trying to reproduce this error locally on my computer, so I won't need to have to push changes each time before I can know if it works or not.
could anybody point me in the right direction to take?
I am thinking of googling for something like stress testing
, or load testing
FYI: I am using rspec
for my testing
You can use some load testing tool, that works from the console, to test your app on localhost:
https://github.com/tsenart/vegeta
https://github.com/lubia/sniper