Convert memory_limit to bytes for RssMemoryLimit
In !102300 (merged) we introduced RssMemoryLimit monitor as backward compatibility monitor to PumaWorkerKiller
In !103472 (merged) we enabled Watchdog by default to be used instead of PumaWorkerKiller for our self-managed customers.
The RssMemoryLimit compares Gitlab::Metrics::System.memory_usage_rss[:total] which is measured in bytes against provided memory_limit. The issue is that we are passing memory_limit in megabytes.
Impact
Gitlab.com - is not affected, Watchdog is using HeapFragmentation and UniqueMemoryGrowth monitors since PumaWorkerKiller is disabled by default
Self-managed customers using Omnibus and using release 15.6 are affected since they have PumaWorkerKiller enabled by default.
The effect
The Watchdog will gracefully restart puma worker every 5 minutes.
From user perspective, it will result in increased latencies and likely a decreased request throughput for the GitLab instance.
From the instance administrator perspective, they should see log records about Puma workers restarted because out of memory.
Workaround
Customers can set: GITLAB_MEMORY_WATCHDOG_ENABLED to false
In Gitlab.com and saas, we
This MR fixes and converts memory limit configured with PUMA_WORKER_MAX_MEMORY env variable to bytes