Select Git revision
process_memory_cache.rb
-
Stan Hu authored
When we switched from a single-threaded application server (Unicorn) to a multithreaded one (Puma), we did not realize that Puma often reaps threads after a request is done and recreates them later. This makes the thread-local cache ineffective, as the cache does not store anything beyond the lifetime of the thread. Since `ActiveSupport::Cache::MemoryStore` is thread-safe, we should be able to switch the L1 cache for feature flags to use this to reduce load on Redis. Since read and write access is synchronized, this does have the side effect of adding contention when feature flags are accessed. Discovered in https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/9414
Stan Hu authoredWhen we switched from a single-threaded application server (Unicorn) to a multithreaded one (Puma), we did not realize that Puma often reaps threads after a request is done and recreates them later. This makes the thread-local cache ineffective, as the cache does not store anything beyond the lifetime of the thread. Since `ActiveSupport::Cache::MemoryStore` is thread-safe, we should be able to switch the L1 cache for feature flags to use this to reduce load on Redis. Since read and write access is synchronized, this does have the side effect of adding contention when feature flags are accessed. Discovered in https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/9414
Code owners
Assign users and groups as approvers for specific file changes. Learn more.