sinatra / sinatra

Classy web-development dressed in a DSL (official / canonical repo)

Home Page:https://sinatrarb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High latency observed with Sinatra API intermittently

imnani opened this issue · comments

We are observing high latencies intermittently with our APIs which use the Sinatra framework and puma web server(single mode). We don't see any issues/delays with puma worker threads accepting incoming requests and processing the requests. The issue primarily lies with the delay involved in returning a response from the Sinatra controller. We use New Relic for our observability needs and it clearly indicates that the latency is caused by the controller.
Rack acts as an interface between the Sinatra framework and the puma server and I suspect rack could be contributing to this issue too. We are observing this intermittent issue only during peak load. Any guidance could be appreciated.

Library Versions:
Sinatra: 2.2.2
Puma: 5.5.2
Rack: 2.24

What is your controller doing? 😄 I would concentrate on that 😉

This is a discussion @zzak @jkowens Can you convert it?