Company
Date Published
Author
Ankit Singhal
Word count
1408
Language
English
Hacker News points
None

Summary

Harness successfully optimized its CD Community Edition to run on personal laptops with just 3 GB of memory and 2 CPUs, enabling up to eight concurrent deployments. This was achieved by reducing the memory footprint from 12 GB to 3 GB through detailed memory profiling, heap usage reduction, thread count optimization, and switching garbage collection algorithms. Initially, the memory usage for the 12 microservices was dominated by four Java-based services that consumed the most memory, necessitating a decrease in their individual memory requirements from 2.75 GB to 600 MB. Key strategies included optimizing heap and thread usage, reusing Redisson clients, binding executor services, and reducing the number of threads for cron jobs. Additionally, the garbage collection algorithm was switched from G1GC to Serial GC to accommodate the limited CPU resources, while tiered compilation was disabled to conserve memory. These changes successfully reduced the NG Manager service's memory usage to 600 MB, with similar reductions achieved for other services, ultimately allowing the Community Edition to operate efficiently on lower-spec hardware.