VMware Cloud Director cell crashes with Out of Memory (OOM) due to database connections exhaustions from API requests
search cancel

VMware Cloud Director cell crashes with Out of Memory (OOM) due to database connections exhaustions from API requests

book

Article ID: 437063

calendar_today

Updated On:

Products

VMware Cloud Director VMware vSphere ESXi

Issue/Introduction

  • VMware Cloud Director (VCD) cells experience high memory utilization or enter an Out of Memory (OOM) state.
  • High frequency of API calls is observed in the environment (Extra Large deployment profile).
  • The primary cell may become unresponsive, or the vmware-vcd service restarts unexpectedly.
  • Database connection counts remain high even during periods of lower activity.
  • The command 'dmesg -T | grep "Out of memory' shows that processes are being killed by the Out of Memory Killer (oom-kill) like this example:

    [yyyy-mm-dd hh:mm:ss] Out of memory: Killed process 406### (systemd-cgroups) total-vm:356kB, anon-rss:4kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:32kB oom_score_adj:0
    [yyyy-mm-dd hh:mm:ss] Out of memory: Killed process 406### (postgres) total-vm:6581520kB, anon-rss:69464kB, file-rss:0kB, shmem-rss:1248152kB, UID:1002 pgtables:12660kB oom_score_adj:-200

  • Below errors can be seen from the /opt/vmware/vcloud-director/logs/cell.log:

    yyyy-mm-dd hh:mm:ss | INFO  | vmware-vcd-cell running
    yyyy-mm-dd hh:mm:ss | INFO  | vmware-vcd-cell running
    yyyy-mm-dd hh:mm:ss | ALERT | vmware-vcd-cell is dead but /var/run/vmware-vcd-cell.pid exists, attempting to restart it
    yyyy-mm-dd hh:mm:ss | INFO  | Started vmware-vcd-cell (pid=######)
    yyyy-mm-dd hh:mm:ss | WARN  | wget failed, return code: 4, will retry in 30 seconds
    yyyy-mm-dd hh:mm:ss | WARN  | Server status returned HTTP/1.1 5mm
    yyyy-mm-dd hh:mm:ss | WARN  | Server status returned HTTP/1.1 5mm
    yyyy-mm-dd hh:mm:ss | INFO  | vmware-vcd-cell running
    yyyy-mm-dd hh:mm:ss | WARN  | Server status returned HTTP/1.1 5mm
    yyyy-mm-dd hh:mm:hh | WARN  | wget failed, return code: 4, will retry in 30 seconds
    yyyy-mm-dd hh:mm:ss | WARN  | wget failed, return code: 4, will retry in 30 seconds
    yyyy-mm-dd hh:mm:hh | WARN  | wget failed, return code: 4, will retry in 30 seconds
    yyyy-mm-dd hh:mm:ss | ALERT | https://<cell-ip>:###/api/server_status output is unexpected, output=[Spider mode enabled. Check if remote file exists.
    --yyyy-mm-dd hh:mm:hh--  https://<cell-ip>/api/server_status
    Connecting to <cell-ip>:###... failed: Connection refused.]
    yyyy-mm-dd hh:mm:ss | ALERT | vmware-vcd-cell is up but attempting to fetch "https://<cell-ip>:###/api/server_status" failed 3 times, rc=4, attempting to restart cell

Environment

VMware Cloud Director 10.6.x

Cause

This issue occurs due to a combination of high API traffic and default connection pool behavior:

  • Heavy API requests quickly consume available database connections.
  • Default database pool parameters do not promptly close the idle connections.
  • Accumulation of these open connections exhausts cell Java heap memory, resulting in an OOM crash.

Resolution

Perform the following steps on all VMware Cloud Director cells in the server group:

  1. Establish an SSH session to the VCD cell as root.
  2. Backup the configuration file before modification:

    cp /opt/vmware/vcloud-director/etc/global.properties /opt/vmware/vcloud-director/etc/global.properties.bak

  3. Edit the file /opt/vmware/vcloud-director/etc/global.properties using a text editor (e.g., vi or nano).
  4. Append the following parameters to the end of the file:

    database.pool.minEvictableIdleTimeMillis=6000
    database.pool.timeBetweenEvictionRunsMillis=30000 

    Note: minEvictableIdleTimeMillis sets the minimum time an object may sit idle in the pool before it is eligible for eviction, timeBetweenEvictionRunsMillis sets the interval between eviction thread runs.

  5. Save and close the file.
  6. Restart the VCD service to apply changes:

    systemctl restart vmware-vcd

  7. Monitor the cell stability. Use top or vcloud-container-debug.log to verify that memory utilization stabilizes and idle database connections are properly cleaned up.