CLOUD PAAS / APPLICATION SETTINGS

OOM Killer Resolutions: Processes with High Risk of Memory Leak

This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.

Click or tap a screenshot to view it at its original size.

Objective

This guide explains how to use OOM Killer Resolutions: Processes with High Risk of Memory Leak on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.

Before you begin

  • Sign in with an account permitted to manage the relevant environment.
  • Confirm the target environment, region and resources before saving changes.
  • Create a backup or rollback plan before changing a production system.

Processes in these groups mostly cause out of memory issues. (Sorted by server role):

Load Balancers

Allocate additional RAM to relevant nodes - This service may require additional memory for normal operation.

Application Servers

The list below provides general advice on dealing with out of memory issues. Based on the programming language used as well as the appropriate solution for the process most relevant to the need:

  • Java
    General advice
    Check the main memory management configuration for your Java machine and, if necessary, adjust it according to your application's needs, such as:

    java -Xmx2048m -Xms256m

    where:
  • Xmxflag specifies memorymemory heapMaximum that can be allocated to the Java Virtual Machine (JVM)
  • Xmsflag setpoolInitial memory allocation
    Refer to the official documentation for more information onJava memory managementsystem

Tips:Ruk-Com Cloud also uses automatic memory management that complements Java containers usingGarbage CollectorYou can customize settings based on your specific application to avoid OOM issues and use memory more efficiently.
Also consider that the JVM requires more memory than the heap - reads.Java memory structurefurther to gain deeper insights.

  • PHP

General advice

1. If a problem occurs with the httpd service (httpd.itk), adjust the server memory management parameters as follows.

- Check the average amount of RAM used eachhttpdInstance

- Delete markJelastic autoconfigurationInside the file/etc/httpd/httpd.conf

- Decrease valueServerLimitandMaxClientsAs specified:(Total_RAM - 5%) / Average_RAM

More:In case you notice constant growth in memory usage per instance (leakage), you will need to reduce the value.MaxRequestsPerChild(About 1,000-5,000 left)

2. For the nginx process, connect to your container via SSH and check the size of the php-fpm instance (such as ps or leading tools):
- If using ~50-100Mb total RAM, disable it.auto configurationand reduce the max_children parameter

- If the instance size varies greatly or more than 200-300Mb, the process may be leaking. You need to review and optimize the code or turn it off. auto configurationand reduce parameters max_requests_per_child

  • Ruby

General advice

Memory leaks are common with Ruby, so the first thing you should do is consider checking and optimizing your code or trying increasing the RAM limit for your instance.

  • Python

General advice

1. If a problem occurs with the httpd service (httpd.itk), adjust the server memory management parameters as follows:

- Check the average amount of RAM used by each instance.

- Delete markJelastic autoconfigurationInside the file/etc/httpd/httpd.conf

- Decrease valueServerLimit andMaxClientsAs specified:(Total_RAM - 5%) / Average_RAM

More:In case you notice constant growth in memory usage per instance (leakage), you will need to reduce the value.MaxRequestsPerChild(About 1,000-5,000 left)

2. Alternatively, allocate more RAM to the node - the main Python process may require more memory for normal operation.

  • NodeJS

General advice

Restart the container to restore the kill process(es). If the problem recurs - allocate more RAM to the node. Applications may require more memory for normal operation.

Database Servers

The list below shows the DB stack along with general advice on OOM issues as well as workarounds for specific killed processes.

  • MySQL

General advice

  1. If using the InnoDB engine (embedded since MySQL version 5.5), check the buffer size with this command:
    SHOW ENGINE INNODB STATUS\G;
    In case of high buffer values (more than 80% of total container RAM), you can reduce the allowed pool size with the parameter. innodb_buffer_pool_size in file/etc/my.cnfOtherwise, allocate additional RAM to the server.
  2. Check the MySQL log for warnings and suggestions.
  • MongoDB

General advice

If there is a problem with the service ofhttpdAdjust the server memory management parameters as follows:

- Check the average amount of RAM used by each instance.

- Delete markJelastic autoconfigurationInside the file/etc/httpd/httpd.conf

- Decrease value ServerLimitandMaxClientsAs specified:(Total_RAM - 5%) / Average_RAM

More:In case you notice constant growth in memory usage per instance (leakage), you will need to reduce the value.MaxRequestsPerChild(About 1,000-5,000 left)

  • PostgreSQL

General advice

Allocate additional RAM to relevant nodes - This service may require additional memory for normal operation.

  • Redis

General advice

Allocate additional RAM to relevant nodes - This service may require additional memory for normal operation.

General operations for different types of stacks

General advice

Processes in this section can be run and later destroyed within different types of nodes. OOM solutions therefore vary and depend on the process - see the table below to find the appropriate recommendations.