Something doesn’t seem right with
Are you also running your database locally?
I’m not really sure how you are using the api, but are you some how using multiple database connections and are running out? If you are just making api calls to your local discourse instance rails should only be using 1 connection, so i doubt that is what is happening.