
7/8/2020 · Craig Gomes
What this post added
This post details the technical journey of migrating GitLab's application servers from Unicorn to Puma. It explains the architectural differences between the two servers (single-threaded vs. multi-threaded), the motivations for the migration (memory growth and scalability), and the implementation steps. Key technical challenges and solutions discussed include: identifying and fixing a thread-safety issue with the ChronicDuration library by forking it into `gitlab-chronic-duration`, tuning Puma's worker and thread configurations to address latency issues, and contributing an upstream patch to Puma to improve request scheduling and capacity distribution by injecting minimal latency between requests when a worker is busy. The post also quantifies the results, showing a 37% reduction in memory usage.