Home / Companies / New Relic / Blog / Post Details
Content Deep Dive

Solving slow downs in FastAPI apps with New Relic

Blog post from New Relic

Post Details
Company
Date Published
Author
Sadé C. Johnson, Developer Relations Engineer
Word Count
2,297
Language
English
Hacker News Points
-
Summary

FastAPI, a Python web framework, enables developers to create REST services efficiently, but like any framework, it can encounter performance issues, which can be diagnosed and resolved with observability tools like New Relic. Common causes of slowdowns include heavy request payloads, blocking I/O operations, and insufficient hardware resources. An example in the text illustrates how a steganography application faced performance issues due to synchronous code in a function responsible for extracting image pixels, leading to timeouts. Attempts to resolve the issue with asynchronous programming surprisingly worsened the performance, but resizing the image before pixel extraction significantly improved response times. The blog emphasizes using New Relic's platform to monitor and troubleshoot such issues effectively, providing a comprehensive application performance monitoring dashboard. Additionally, the text offers guidance on installing the New Relic Python agent for FastAPI applications through a quickstart guide, aiming to enhance observability and performance management.