# HAProxy docker high memory

**URL:** <https://discourse.haproxy.org/t/haproxy-docker-high-memory/7504>\
**Category:** Help!\
**Created:** [March 17, 2022, 1:37pm UTC](https://discourse.haproxy.org/t/haproxy-docker-high-memory/7504 "2022-03-17T13:37:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilien](https://avatars.discourse-cdn.com/v4/letter/e/bcef8e/32.png) [@emilien](https://discourse.haproxy.org/u/emilien)\
**Post date:** [March 17, 2022, 1:37pm UTC](https://discourse.haproxy.org/t/haproxy-docker-high-memory/7504/1 "2022-03-17T13:37:43Z")

</div>

Hi,

I want to run multiple HAProxy instances with Nomad but I don’t understand why HAProxy is consuming so much memory compared to running it natively.

My host OS is Ubuntu 20.04 with up -to-date [docker.io](http://docker.io) package and I’m using the official haproxy images found on Docker Hub. When I use HAProxy \>= 2.4, a basic configuration with one HTTP frontend and 2 backends consumes 137MB of memory, when I use \>= 2.0 it “only” consumes 68MB of memory whereas when I use the “old” 1.8 image it only consumes 10MB of memory.

Why is there so much difference for the same basic configuration ? I plan to run hundreds of HAProxy instances so the smaller the memory footprint is, the more instances on the same host I can put.

When I run a “native” HAProxy instance with the same compile options, it consume much less memory (55MB).

I tried to build an image without openssl, pcre and promex but it keeps consuming 137MB of memory.

Have you an idea ?

Thanks

Emilien

---

<div class="post-metadata">

**Author:** ![lim](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lim](https://discourse.haproxy.org/u/lim)\
**Post date:** [November 30, 2023, 5:32am UTC](https://discourse.haproxy.org/t/haproxy-docker-high-memory/7504/2 "2023-11-30T05:32:14Z")

</div>

Ok, I guess this does not bode well.

I have the same issue when trying to use image: haproxytech/haproxy-alpine:2.8

Should I try something else?
