# CPU load high when backend server with healthcheck down

**URL:** <https://discourse.haproxy.org/t/cpu-load-high-when-backend-server-with-healthcheck-down/7810>\
**Category:** Help!\
**Created:** [July 4, 2022, 4:45pm UTC](https://discourse.haproxy.org/t/cpu-load-high-when-backend-server-with-healthcheck-down/7810 "2022-07-04T16:45:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phihos](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/phihos/32/1734_2.png) [@phihos](https://discourse.haproxy.org/u/phihos)\
**Post date:** [July 4, 2022, 4:45pm UTC](https://discourse.haproxy.org/t/cpu-load-high-when-backend-server-with-healthcheck-down/7810/1 "2022-07-04T16:45:49Z")

</div>

Hello everyone,

I have a high-load (~10k reqs/s) HaProxy 2.6.1 instance with HTTP mode backends with L4 health checks. Everything works fine until a minor disturbance causes a backend to become unavailable for a few seconds. Then suddenly CPU usage skyrockets up to the point that not even the health checks themselves are performed and all backends are declared dead worsening the issue.  
I found out, that disabling the L4 check by removing the “check” parameter on each server solves the issue.

I created a minimal example:

```auto
global
  log /dev/log local0
  log /dev/log local1 notice
  chroot /var/lib/haproxy
  user haproxy
  group haproxy
  daemon

defaults
  mode http

frontend some_frontend 
  bind *:8080
  stats enable
  stats uri /stats
  default_backend some_backend

backend some_backend
  server some_server 8.8.8.8:8000 check

```

Blocking the IP via `iptables -A OUTPUT -p tcp --dst 8.8.8.8 --dport 8000 -j DROP` simulates an outage. Bombarding HaProxy with any load testing tool like `wrk` reveals high CPU usage. After removing `check` from the config, reloading and load-testing with the same workload again the usage is way lower, almost non-existant.  
I put a [full Vagrant example on GitHub](https://github.com/phihos/haproxy-hc-cpu-load-poc).

Does anybody know if this is a bug or a configuration issue?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [July 4, 2022, 5:06pm UTC](https://discourse.haproxy.org/t/cpu-load-high-when-backend-server-with-healthcheck-down/7810/2 "2022-07-04T17:06:48Z")

</div>

I think this is very likely a bug. Can you file an issue here:

> **[Issues · haproxy/haproxy](https://github.com/haproxy/haproxy/issues)**
>
> HAProxy Load Balancer's development branch (mirror of git.haproxy.org) - Issues · haproxy/haproxy

Thank you

---

<div class="post-metadata">

**Author:** ![phihos](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/phihos/32/1734_2.png) [@phihos](https://discourse.haproxy.org/u/phihos)\
**Post date:** [July 4, 2022, 5:08pm UTC](https://discourse.haproxy.org/t/cpu-load-high-when-backend-server-with-healthcheck-down/7810/3 "2022-07-04T17:08:39Z")

</div>

Thanks, I wanted to make sure that I did not miss something important here. I will do that now.

---

<div class="post-metadata">

**Author:** ![phihos](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/phihos/32/1734_2.png) [@phihos](https://discourse.haproxy.org/u/phihos)\
**Post date:** [July 4, 2022, 5:23pm UTC](https://discourse.haproxy.org/t/cpu-load-high-when-backend-server-with-healthcheck-down/7810/4 "2022-07-04T17:23:02Z")

</div>

For anybody reading this: [CPU load high when backend server with healthcheck down · Issue #1770 · haproxy/haproxy · GitHub](https://github.com/haproxy/haproxy/issues/1770)
