# Error establ. Database Connection - happening over again

**URL:** <https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077>\
**Category:** Database\
**Created:** [September 8, 2025, 6:48am UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077 "2025-09-08T06:48:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyHestia](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@AndyHestia](https://forum.hestiacp.com/u/AndyHestia)\
**Post date:** [September 8, 2025, 6:48am UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077/1 "2025-09-08T06:48:05Z")

</div>

Hi

so I have this (interesting) problem, that each 4-5 days, this error occurs:

Error establishing Database Connection.

My fix is, that I reboot the whole server.

However, that cannot be a comprehensive solution I’d say….

One of my sites gets quite some traffic (40gb in 1 week);

I have a AWS lightsail plan (4 GB RAM) and thought that it might comes from being underequipped (?)

What would you do in this case?

---

<div class="post-metadata">

**Author:** ![aguilar1181](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/aguilar1181/32/10138_2.png) [@aguilar1181](https://forum.hestiacp.com/u/aguilar1181)\
**Post date:** [September 8, 2025, 4:12pm UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077/2 "2025-09-08T16:12:20Z")

</div>

I’ve seen this issue before, and it was due to not enough memory. Although it was a Windows Server, when MySQL reached its allocation of memory, the service shut down and needed a restarted.

More about your Hestia setup could help suggest some solutions. is it apache only, nginx, only or both? Are you using MariaDB or MYSQL? Are you using any caching?

---

<div class="post-metadata">

**Author:** ![Raphael](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/raphael/32/5217_2.png) [@Raphael](https://forum.hestiacp.com/u/Raphael)\
**Post date:** [September 8, 2025, 4:42pm UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077/3 "2025-09-08T16:42:51Z")

</div>

It is always the same step to debug: Check the logs, as @aguilar1181 already wrote, it is probaly an oom issue (out of memory).

---

<div class="post-metadata">

**Author:** ![AndyHestia](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@AndyHestia](https://forum.hestiacp.com/u/AndyHestia)\
**Post date:** [September 9, 2025, 11:57am UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077/4 "2025-09-09T11:57:16Z")

</div>

I am using apache + nginx, and MariaDB.

Also, I use cloudflare.

---

<div class="post-metadata">

**Author:** ![AndyHestia](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@AndyHestia](https://forum.hestiacp.com/u/AndyHestia)\
**Post date:** [September 9, 2025, 11:57am UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077/5 "2025-09-09T11:57:35Z")

</div>

Nothing suspicious here [added service to firewall]; only a few IP addresses, that were banned.

If it is OOM, how would I get to see that?

---

<div class="post-metadata">

**Author:** ![andrewnewby](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@andrewnewby](https://forum.hestiacp.com/u/andrewnewby)\
**Post date:** [September 11, 2025, 8:34am UTC](https://forum.hestiacp.com/t/error-establ-database-connection-happening-over-again/20077/6 "2025-09-11T08:34:59Z")

</div>

> If it is OOM, how would I get to see that?

Tweak your server, or look for a bigger spec server 🙂 Looking in /var/log/syslog should show OOM errors (search for “OOM”) if I recal. I’ve had it before. Normally its from misconfigured max clients / memory per process / etc)

BTW - Monit is also great for keeping services up

> **[Easy, proactive monitoring of processes, programs, files, directories,...](https://mmonit.com/monit/)**
