Docker health check powershell cmd high CPU usage Windows Server issue

Hi,

Maybe this is more Docker related question, but maybe someone can suggest something.

I use Windows Server 2016
Hosting ES version 7.1.1 in Docker container microsoft/windowsservercore- ltsc2016

I've built an image with the health check command
...
HEALTHCHECK --interval=5s CMD powershell -command
try { $content = (iwr -useb http://localhost:9205/_cat/health).Content;
$health = $content.Split(' ')[3]; if ($health -eq 'green' -or $health -eq 'yellow') { return 0 }
else { return 1 }; `
} catch { return 1 }
..

Now every 5 seconds, Powershell script executes and takes 50% CPU.
If I run 2 containers with ES and one with Kibana, CPU usage is 100%

Could you suggest another health check approach in this case?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.