How we made a Ruby method 200x faster · Campsite

15-Nov-2024 124
One morning, Campsite was slow. Normally snappy interactions had loading spinners and delayed data. Our observability tooling let us know it wasn’t just us, and it gave us some hints about what was happening. An Axiom monitor sent us a “high API request queue time” message via our Campsite integration. Web server processes were fully utilized, and requests were forced to wait. Fly.io metrics showed HTTP response times were significantly elevated, but didn’t show an increase in traffic. PlanetScale insights didn’t show any increase in database query latency. The spikes in request queue times and response times lined up with a deploy, so with no better leads, we reverted the change, which had refactored how we transform rich text. Request queue times and response times returned to normal levels, and Campsite felt fast again.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle