Every once in a while, I'm seeing response times spike, even when overall throughput, requests per second, and memory usage remains low. Looking at heroku's monitoring, the problem often coincides with an "H27" error, which is their code for a client terminating the connection prematurely, perhaps by closing their browser in the middle of a request.
My app is very simple: I'm serving up static files (including a clojurescript-compiled js file) and process some post requests to log info to a heroku provisioned mongo database. I'm using a basic luminus clojurescript template with the default immutant server.
A note to Heroku's customer support received the following response:
"Depending on how your application is setup, it could be that your
application is being blocked by long running connections, such as the
clients that causing the H27s, and is causing a knock on effect that is
slowing down subsequent requests."
My takeaway from all this is that the most likely explanation is that the behavior of immutant is such that if a client terminates their connection in the middle of the request, it hangs up the server and prevents it from serving up other requests until after the timeout. That sounds... bad. Is there a way to change that behavior? If not, what is the easiest way to switch to one of the other luminus-supported servers? Which server would solve this problem and give me the best performance on heroku?