Skip to content

MemoryCritical (Codey)

Severity critical
Fires when Memory usage is above 85% of the limit for 2 hours
General runbook MemoryCritical

Follow the steps in the general runbook first. This page adds the steps for Codey.

Why the numbers can differ

The alert counts only the memory that the Codey processes use (RSS). The Memory column in the Pods table shows the working set, which also includes part of the file cache.

Codey reads a lot of Git data through the file cache, for example during the nightly backup and the Git housekeeping jobs. The Memory column can then be close to the limit while the Codey processes use much less. A high value in the Memory column alone is not a problem: the operating system frees file cache when Codey needs the memory.

What a restart means for your users

Codey keeps the login sessions of your users in memory. When Codey restarts (for example when it reaches the memory limit, or after a compute plan change), all users are logged out and must log in again. Git operations over HTTPS or SSH that run during the restart fail, and must be started again.

Reduce the memory usage

  • Automated jobs: many parallel clones, pushes or fetches at the same time use a lot of memory. Check if an automated job (for example a CI system, a mirror, or a backup script) causes the load. Reduce how often it runs, or how many jobs run at the same time.
  • Repository imports: importing or migrating large repositories can use a lot of memory while the import runs. Import large repositories one after the other.
  • Code search: Codey builds a search index for the code of each repository. Building the index can use a lot of resources, mostly when a repository is indexed for the first time. After you add or import many or large repositories, the memory usage can be higher for some time.

If the memory usage is expected for your number of users and repositories, move the instance to a larger compute plan. See Scaling.