akash-network / akash-network/console
perf(api): high loop utilization on multiple endpoints (clinic event-loop category)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 264
- Forks
- 94
- Avg merge
- 18h 49m
- Merged PRs (30d)
- 297
Description
Problem
Clinic doctor flagged 7 endpoints with loopUtilization=performance, categorizing them as event-loop bottlenecked. High loop utilization (>90%) means the event loop is saturated and has little headroom for additional work.
Affected Endpoints
| Endpoint | Loop Util avg | Loop Util max | Delay avg | Category |
|---|---|---|---|---|
/v1/gpu |
90% | 97% | 2.39ms | event-loop |
/v1/graph-data/compute |
92% | 98% | 0.17ms | event-loop |
/v1/templates-list |
91% | 98% | 2.97ms | event-loop |
/v1/blocks/1 |
91% | 97% | 0.21ms | event-loop |
/v1/transactions |
90% | 97% | 0.22ms | event-loop |
/v1/providers/akash1example |
91% | 98% | 0.23ms | event-loop |
/v1/provider-dashboard/akash1example |
91% | 100% | 0.88ms | event-loop |
Analysis
While event loop delay is low for these endpoints, the loop utilization is near 100%. This means:
- The server has no spare capacity during sustained load
- Any additional CPU work (other requests, timers, garbage collection) will immediately cause delays
- Under production traffic with mixed endpoints, these will degrade faster than profiled in isolation
Suggested investigation
- These endpoints likely do synchronous JSON serialization or computation that keeps the loop busy
- Consider response caching at the HTTP layer (ETag/304) to avoid re-serialization
- For
/v1/graph-data/compute, check if the map/filter/reduce chains can be pre-computed - For
/v1/templates-list, check JSON.parse/stringify overhead
Context
Part of the API event loop performance audit.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by profiling the seven listed API endpoints, especially /v1/graph-data/compute and /v1/templates-list, under sustained load. Check synchronous serialization, JSON.parse/stringify overhead, and the map/filter/reduce work described in the investigation notes. Done means the event-loop audit shows reduced utilization and the endpoints retain their expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100