@elukey found puppetdb misbehaving today with puppet runs failing throughout the fleet. Fist non INFO level log for this day is:
2017-07-15 08:32:38,151 WARN [o.e.j.s.HttpChannel] /v3/commands?checksum=6fec653112b6b1faf7a57b53d1876afbb1961be2 java.lang.OutOfMemoryError: Java heap space
followed by a ton of
java.lang.OutOfMemoryError: Java heap space
Puppetdb was running since Jun 29 and at the time of debugging has a VIRT of 10052304 (~10G) and a RSS of 4568496 (>4G). The default max heapsize is 3.9G
java -XX:+PrintFlagsFinal -version |grep MaxHeapSize
uintx MaxHeapSize := 4208984064 {product}We should increase via Xmx the Max Heap Size for the JVM.
Despite config to have the jvm killed on an OutOfMemoryError this did not work due to
Jul 15 08:28:21 nitrogen puppetdb[576]: # Executing /bin/sh -c ""kill -9 puppetdb" -Xmx -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/ Jul 15 08:28:21 nitrogen puppetdb[576]: sh: 1: kill -9 puppetdb: not found
Seems like Java 8u92 added 2 new settings for this as well. -XX:+ExitOnOutOfMemoryError and
-XX:+CrashOnOutOfMemoryError. We should investigate this as well as we have 8u131
I 've restarted puppetdb manually and CPU and memory usage dropped back to normal