retrystorm · Learn · Interview practice · Glossary · Components

Home › Interview practice › Even Out the Exports

Even Out the Exports

A few slow PDF exports drag every request down. Same servers, smarter balancing.

Writers can now export a notebook to PDF. Most requests to Inkwell still take a few milliseconds, but an export can take a hundred times longer, and the slowest requests have started to crawl even though the servers aren't full.

What it does

  • Read: a user opens a note, or exports a notebook (a few of the reads are slow exports).
  • Write: a user saves a note.

Workload

A steady 2 500 rps, 90% reads / 10% writes, for 60 seconds, against 10 000 notes. Every note is about equally popular. Most requests take about 5 ms of app server time; a few take hundreds.

How to build it

You get four medium app replicas and an xlarge database, and they're enough. The question is how the load balancer spreads the work.

  1. Connect the client to a load balancer, the load balancer to an app server, and the app server to a relational database.
  2. Run it and look at the p99, the time 99% of requests finish within.
  3. Try the load balancer's other algorithms. Which one stops slow exports from holding up everyone else?

Part of Chapter 5: Balancing Load.

About · Contact · Privacy · Terms of use