Third party monitoring application shows alert “Too many instances: keepalived” periodically.

Solution Verified - Updated -

Environment

  • RedHat Enterprise Linux 7
  • RedHat Enterprise Linux 8
  • Keepalived

Issue

"Too many instances: keepalived" showing in monitoring whereas only 4 instances is running on the server.

Resolution

  • By default, keepalived service will spawn 3 processes. Refer to the Root cause section for more information.
  • If the keepalive process is reloaded, it will result in more instances. In such case work with your monitoring application vendor to increase the number of instances to be monitored accordingly.

Root Cause

  • Default keepalived processes
$ ps -eaf | grep keepalived
root      1325     1  0  2020 ?       /usr/sbin/keepalived -D -S3
root      1327  1325  0  2020 ?       /usr/sbin/keepalived -D -S3
root      1328  1325  0  2020 ?       /usr/sbin/keepalived -D -S3
root      1325     1  0  2020 ?        /usr/sbin/keepalived -D -S3     
  • This process is the main process of keepalived which acts as a parent process to check two child process
root      1327  1325  0  2020 ?       /usr/sbin/keepalived -D -S3     
  • This is the child process of the parent process which is used to perform health checks
root      1328  1325  0  2020 ?      /usr/sbin/keepalived -D -S3     
  • The third process is usually the one which does VRRP communication and does the VRRP_SCRIPT() routing, so this process uses more CPU compared to the other two (one parent(1325) and one child (1327)).
root      7644  0.0  0.2 127212  2456 ?        S    19:14   0:00 /usr/sbin/keepalived -adDmR
  • The fourth process will show for time being only when we reload the keepalived service

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.