GrabRam Dilip PradhanProblem & solution
How we reduced peak memory and CPU usage of the product configuration management SDK
Summary
GrabX’s product configuration SDK used substantial memory and CPU because every client downloaded, decoded, and loaded a single JSON file containing configurations for all services, even when it needed only a small subset. The design also regenerated and fetched complete files every minute, while decoding a file larger than 100 MB could starve request handling and increase P99 latency. The proposed redesign partitions data by service, stores each configuration in its own JSON file and S3 prefix, and adds service-level changelogs so SDKs subscribe only to required services and apply targeted updates. Benchmarking across varied configuration sizes found potential reductions of up to 70% in memory utilisation and more than 50% in maximum CPU utilisation. Further work is planned to reduce SDK initialisation time.
Context
Client services observed high memory and CPU usage in the GrabX SDK. The SDK stored configurations for all services in one JSON file, fetched the complete file every minute, and used substantial CPU to decode files larger than 100 MB, contributing to CPU throttling and increased P99 latency.
Approach / What changed
The redesign partitions configuration data by service, stores each configuration in a separate JSON file with its own Amazon S3 prefix, and maintains a changelog for each service. Client SDKs subscribe only to required services, compare changelog versions, and update only configurations that changed.
Takeaways
The existing SDK loaded all service configurations even though 98% of client services needed less than 1% of the total configuration data.
Service-level changelogs identify configurations created or updated in each version, enabling targeted client-side updates instead of complete file reloads.
Benchmarking indicated potential memory reductions of up to 70% and maximum CPU utilisation decreases of more than 50% across varied configuration data sizes.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.