# Very high memory usage

**URL:** https://community.zammad.org/t/very-high-memory-usage/13380
**Category:** Technical assistance
**Created:** [February 12, 2024, 10:48am UTC](https://community.zammad.org/t/very-high-memory-usage/13380 "2024-02-12T10:48:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vic](https://community.zammad.org/user_avatar/community.zammad.org/vic/32/3198_2.png) [@vic](https://community.zammad.org/u/vic)
#### Post date: [February 12, 2024, 10:48am UTC](https://community.zammad.org/t/very-high-memory-usage/13380/1 "2024-02-12T10:48:31Z")

</div>

I’ve been using Zammad for 3 years now. We have grown from 3 to 5 agents in the meantime, there are about 7000 tickets in the system.

I started using Zammad on an all-in-one system with 16GB of RAM. This offered a good performance for the first 2 years. Last year, however, things started to become worse.

Elasticsearch started heavily eating up memory. While the system uses about 6GB RAM with everything except Elasticsearch running, as soon as I turn on Elasticsearch, the 16GB RAM are being exhausted and the swap partition (4GB in my case) is also being filled. Naturally, this slows the whole system.

For other reasons as well, I decided to move Zammad to a new server with a lot more power and RAM. Everything works well and fast. On this new server, I’m running the current version of Zammad (package) on Ubuntu 22, files are stored on the FS. No performance tuning applied. For Elasticsearch, in accordance with the documentation, the following to configuration entries were made:

```auto
http.max_content_length: 400mb
indices.query.bool.max_clause_count: 2000

```

Unchecked, Elasticsearch takes up a whopping **33GB** of RAM on this new system. CPU load of the whole system is very low, though.

I understand that I can instruct Elastic to limit its memory usage by setting Xmx and Xms. Luckily, after the move I’m in the situation that I don’t have to, there’s plenty of RAM available.

Still, I wonder if this is the kind of memory usage one would expect to see? After all, according to the [hardware requirements](https://docs.zammad.org/en/latest/prerequisites/hardware.html) mentioned in the documentation, for just 5 agents, 8GB RAM should be sufficient for Zammad including Elasticsearch.

And say I wanted to reduce memory consumption of Elasticsearch, what number would still be safe (for Xmx and Xms) without notably losing performance? If it is even possible to give such an estimate.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [February 12, 2024, 11:21am UTC](https://community.zammad.org/t/very-high-memory-usage/13380/2 "2024-02-12T11:21:14Z")

</div>

It’s nothing new that Elasticsearch by default takes 50 percent of your memory.  
Search for “heap size” in the elasticsearch documentation and limit the memory usage to something like 2GB.

Don’t know what the other problems are, but most likely they can be fixed with slight performance tuning ( [Configuration via Environment Variables — Zammad System Documentation documentation](https://docs.zammad.org/en/latest/appendix/configure-env-vars.html) ) and ensuring you’ve configured the system to expactations ( [Configure Database server — Zammad System Documentation documentation](https://docs.zammad.org/en/latest/appendix/configure-database-server.html) )

---

<div class="post-metadata">

### Author: ![vic](https://community.zammad.org/user_avatar/community.zammad.org/vic/32/3198_2.png) [@vic](https://community.zammad.org/u/vic)
#### Post date: [February 12, 2024, 2:35pm UTC](https://community.zammad.org/t/very-high-memory-usage/13380/3 "2024-02-12T14:35:55Z")

</div>

> [@MrGeneration](#):
>
> It’s nothing new that Elasticsearch by default takes 50 percent of your memory.  
> Search for “heap size” in the elasticsearch documentation and limit the memory usage to something like 2GB.

As I mentioned, I know how to reduce heap size for Elasticsearch.

On my current system, Elasticsearch is not taking up 50% of my memory (128GB in total, so it’s consuming about 25%). On the old system, it was taking up 100% including swap space which is why performance suffered greatly.

Hence my questions, specifically what the consequences of reducing heap size to 2G or 4G will be, if any.

> [@](#):
>
> Don’t know what the other problems are, but most likely they can be fixed with slight performance tuning ( [Configuration via Environment Variables — Zammad System Documentation documentation](https://docs.zammad.org/en/latest/appendix/configure-env-vars.html) ) and ensuring you’ve configured the system to expactations ( [Configure Database server — Zammad System Documentation documentation](https://docs.zammad.org/en/latest/appendix/configure-database-server.html) )

No other problems, just Elasticsearch taking up a lot of memory.

But since you mentioned it, can you give any specific recommendations?

- WEB\_CONCURRENCY - does this need to be changed with only 5 users?
- ZAMMAD\_SESSION\_JOBS\_CONCURRENT - as I understand this only becomes relevant if there are 40 agents or more.
- ZAMMAD\_PROCESS\_DELAYED\_JOBS\_WORKERS - same as above.
- ZAMMAD\_PROCESS\_SCHEDULED\_JOBS\_WORKERS - I only have one single scheduled job in Zammad so I assume this won’t have any effect.
- REDIS\_URL - it is my understanding that this is default anyway with Zammad 6+, so nothing to do here.

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [February 6, 2025, 2:36pm UTC](https://community.zammad.org/t/very-high-memory-usage/13380/4 "2025-02-06T14:36:09Z")

</div>

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