Continuous Performance Improvement of HTTP API

<p>In&nbsp;<a href="https://towardsdatascience.com/how-we-optimized-python-api-server-code-100x-9da94aa883c5" rel="noopener" target="_blank">my previous post</a>, I detailed a few code tricks to improve backend performance. How did I know where to focus and what to optimize, though? Indeed, joining Cython and other low-level gizmos to the party should have solid reasoning.</p> <p>I work at&nbsp;<a href="https://athenian.com/" rel="noopener ugc nofollow" target="_blank">Athenian</a>. Athenian offers a SaaS that helps engineering leaders build a continuous improvement software development culture. We have pretty strict performance targets dictated by the UX. It&rsquo;s hard to achieve great P95 response times without proper tooling. So we&rsquo;ve wrapped ourselves with high-quality apps and services:</p> <ul> <li><a href="https://docs.sentry.io/product/sentry-basics/tracing/distributed-tracing/" rel="noopener ugc nofollow" target="_blank">Sentry Distributed Tracing</a>&nbsp;allows us to investigate why a particular API request executed slow in production. This tool works in the Python domain.</li> <li><a href="https://prodfiler.com/" rel="noopener ugc nofollow" target="_blank">Prodfiler</a>&nbsp;gives an independent zoom into the native CPU performance, including all the shared libraries.</li> <li><a href="https://github.com/benfred/py-spy" rel="noopener ugc nofollow" target="_blank">py-spy</a>&nbsp;is an excellent low-overhead Python profiler by&nbsp; <p><a href="https://medium.com/u/de31421e853a?source=post_page-----86290433aa54--------------------------------" rel="noopener" target="_blank">Ben Frederickson</a></p> .</li> <li>Prometheus + Grafana help to monitor the immediate situation and trigger performance disaster recovery.</li> <li><a href="https://cloud.google.com/logging/docs/logs-based-metrics" rel="noopener ugc nofollow" target="_blank">Google log-based metrics</a>&nbsp;augment the previous toolchain by indicating an elevated frequency of important operational events.</li> <li><a href="https://cloud.google.com/blog/products/databases/get-ahead-of-database-performance-issues-with-cloud-sql-insights" rel="noopener ugc nofollow" target="_blank">Google Cloud SQL Insights</a>&nbsp;is a must-have managed PostgreSQL performance monitor on the individual query level.</li> <li><a href="https://explain.tensor.ru/" rel="noopener ugc nofollow" target="_blank">explain.tensor.ru</a>&nbsp;is my favorite PostgreSQL execution plan visualizer. It offers many automated hints that are always relevant.</li> </ul> <p>Today&rsquo;s post illustrates the weekly routine to identify slow spots and speed up things. In particular, I will demonstrate the usefulness of Sentry traces, py-spy, and Prodfiler.</p> <p><a href="https://betterprogramming.pub/continuous-performance-improvement-of-http-api-86290433aa54">Read More</a></p>
Tags: API HTTP