Use container memory limits to manage memory in reference environments

Description

Right now, backend modules launched as containers by Okapi have no memory limits imposed by default. In addition, for Java-based modules, in a container, the JVM by default sees all system memory as available to it, regardless of any container memory limit.

We are currently managing this by setting an environment variable JAVA_OPTIONS=-Xmx256m (or whatever is required according to the developer) for all Java-based modules. This solution works OK, but it requires that the DevOps team configure each module individually, and the memory requirements of the module are not documented except in the deployment variables file in folio-ansible.

A better solution might be:

  • Update the launch descriptors in each module's module descriptor template to set the HostConfig/Memory key in dockerArgs to the appropriate default as determined by the module development team. This will limit each container's memory usage. It could still be overridden in a deployment descriptor

  • Update the base Java image for FOLIO Docker containers to use the -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap switches as part of the Java command line to allow the JVM to see the container memory limit

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Jakub Skoczen October 21, 2019 at 10:38 AM

Completed based on the previous comment – re-open if not the case.

Wayne Schneider September 16, 2019 at 12:54 PM

I believe this is closed through the LD work – we could close now (because a solution has been identified), or wait until (the final cleanup task of that project) is complete.

Jakub Skoczen September 16, 2019 at 11:35 AM

Guys, is this still a todo or has this been closed through the work done wih LDs last week?

Wayne Schneider April 4, 2019 at 7:01 PM

Possible umbrella issue for module metadata:

Oleksii Popov April 4, 2019 at 2:31 PM

Requires final agreement.
Key points:

  • update JDK

  • memory config

Done

Details

Assignee

Reporter

Priority

Sprint

Development Team

Core: Platform

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created January 23, 2019 at 4:15 PM
Updated August 11, 2020 at 4:18 PM
Resolved October 21, 2019 at 10:38 AM
TestRail: Cases
TestRail: Runs