N+1 at the gateway
Difficulty 3 of 5
Each GraphQL query resolves 50 records through separate calls. The API receives 200 queries/s. Fix the resolver with at most three edits. Keep p99 below 180 ms.
0:00. Gateway p99 is above 180 ms. Graph: catalog calls run at 50 per query, and catalog CPU is at its limit.
Calls per page: 20 · 18% of pages wait 2.0 s
Goals and limits
- p99 latency
- under 180 ms
- Error rate
- under 0.1%
- Monthly cost
- under 100 USD/mo
- Parts you can add
- App backend
- Part limit
- 16
- Edit limit
- 3
- Traffic
- 200 req/s
Concepts
How players did
Player results load from the server.