-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Is your feature request related to a problem? Please describe.
When users interact with the KVM interface or monitor device status in the console, many API calls to AMT firmware are issued repeatedly (for power state, feature support, KVM displays). Every call adds 150–500ms latency and creates excess backend load, especially during rapid power actions and status polling. This leads to slow response times and unnecessary strain on the backend.
Describe the solution you'd like
Introduce a thread-safe in-memory cache for AMT API endpoints:
- Power state should use a 5-second TTL (to reflect frequent state changes).
- Features and KVM displays should use a 30-second TTL (as these change infrequently).
- Cache must be invalidated automatically on power actions.
- The cache should use TTL-based expiration, support concurrent access (e.g., with
sync.RWMutex), and do background cleanup. - No API contract or request/response changes should be introduced.
- Add log output/metrics for cache hits/misses/invalidations.
- Show performance improvement and backend load reduction with load testing (use baseline-test.sh to demonstrate efficiency).
Describe alternatives you've considered
Considered persistent/distributed caching, but determined in-memory cache is sufficient for current usage and reduces complexity/risk for this iteration.
Additional context
- See performance data in PR feat: add backend caching for AMT API endpoints #768: feat: add backend caching for AMT API endpoints (~15–53x speedup for cached requests; ~67% reduction in AMT API traffic).
- Context: This is especially helpful to avoid repeated slowdowns when users quickly toggle KVM or status actions. Implementation must be as simple and non-intrusive as possible.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status