# High CPU on mautic:campaigns:update cron

**URL:** <https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120>\
**Category:** Product Support\
**Created:** [August 13, 2024, 10:27pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120 "2024-08-13T22:27:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [August 13, 2024, 10:27pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/1 "2024-08-13T22:27:51Z")

</div>

**Your software**  
My Mautic version is: 4  
My PHP version is: 8.1

**Your problem**  
My problem is:

Hey guys, i have a VPS server with 3CPU and 4GB ram,  
And it seems like the cron of mautic:campaigns:update run it takes a lot of CPU (around 100% when combine with mariadbd):

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/518af369813a88e160a1c3466f8fb81f51471164.png)

What does mautic:campaigns:update does, and is there anything i can do to make sure take less cpu (maybe make it run slower somehow)?

Thanks

---

<div class="post-metadata">

**Author:** ![rcarabelli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rcarabelli/32/6807_2.png) [@rcarabelli](https://forum.mautic.org/u/rcarabelli)\
**Post date:** [August 15, 2024, 4:25pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/2 "2024-08-15T16:25:18Z")

</div>

Reduce your batches a lot, run the cron more frequently. The process takes all that memory and CPU because it loads all that in the memory and then it process it.

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [August 15, 2024, 4:59pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/3 "2024-08-15T16:59:31Z")

</div>

Thanks for your answer, the cron runs every minute so i can get more frequently.

What does reduce your batches mean? you mean the amount of emails i send in each queue or something else?

I send 200 emails on each queue but i don’t think that what cause the problem.

---

<div class="post-metadata">

**Author:** ![rcarabelli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rcarabelli/32/6807_2.png) [@rcarabelli](https://forum.mautic.org/u/rcarabelli)\
**Post date:** [August 15, 2024, 5:29pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/4 "2024-08-15T17:29:17Z")

</div>

Yes, try, for testing, 25 or 50 per run (minute)

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [August 16, 2024, 4:51am UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/5 "2024-08-16T04:51:15Z")

</div>

Thanks, no effect at all,  
It’s also camapgin upsate cron so it doesn’t seems related.

My guess is that it connected to segments and amount of users and not the email batch.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 16, 2024, 3:34pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/6 "2024-08-16T15:34:54Z")

</div>

Hi!

You can always try to run your cron manually and see if it really finishes in 1 min.

But 3 CPU with 4 GB mem is good for a max 20-30k list, not higher one. Also don’t forget - if you send lot of emails, fast, you’ll have to be able to manage pageviews and email opens.

Joey

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [August 16, 2024, 3:56pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/7 "2024-08-16T15:56:59Z")

</div>

Thanks, i have around 7-8k people in the list and only around 3k active (the others unsubscribe).

On my tests i had to limit the contacts to 4000 in the cron and it finish in about 30 sec to run without the contact limit it run for more than a minute.

The problem is coming from this cron mautic:campaigns:update but it seems like i wasn’t able to find a way to make it take less cpu when running (tried to play around with stoping segemnts and campaigns but it didn’t help).

If i reduce the contacts to 2000 the cron run faster and finish in less time but when it run it still take 100% cpu.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 16, 2024, 4:11pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/8 "2024-08-16T16:11:21Z")

</div>

Do you have lots of contacts in your campaigns? Inactive ones?  
Do you use cache memory?

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [August 16, 2024, 4:48pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/9 "2024-08-16T16:48:31Z")

</div>

The campaign with the most memebers has 620 members.

The campaign is really complex and include about 3 months funnel. But even when i paused it the cpu was still 100% when the cron run.

About the cache I have this set “innodb\_buffer\_pool\_size = 512M”

And i am using cyberpanel to control the website but other than that big change i haven’t made more changes.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 17, 2024, 6:04pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/10 "2024-08-17T18:04:43Z")

</div>

Uh sorry I’m not sure about cyberpanel. I like to configure directly, cause I have no idea what resources the control panel takes away from the system

---

<div class="post-metadata">

**Author:** ![Soliman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/soliman/32/3208_2.png) [@Soliman](https://forum.mautic.org/u/Soliman)\
**Post date:** [August 19, 2024, 3:28pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/11 "2024-08-19T15:28:19Z")

</div>

You are Using cyber panel than I will assume that you are using open lite speed ? ??? Not sure  
But if you are using open lite speed sever  
I would say this is a some familiar behavior of open lite speed of using higher cpu for some applications.  
Not sure why but I end up going back Apache.  
Just want to give a hint you if you are using open lite speed  
Good luck

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [August 19, 2024, 6:34pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/12 "2024-08-19T18:34:04Z")

</div>

Thank a lot appreciate that, i am using open lite speed.  
I will give it a try and check how it works with apache.

---

<div class="post-metadata">

**Author:** ![zero477](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zero477/32/10873_2.png) [@zero477](https://forum.mautic.org/u/zero477)\
**Post date:** [August 20, 2024, 6:12pm UTC](https://forum.mautic.org/t/high-cpu-on-mauticupdate-cron/33120/13 "2024-08-20T18:12:58Z")

</div>

Hello,

Reas this guide from Joey → [Ultimate guide to Mautic cronjobs – Joey Keller](https://joeykeller.com/ultimate-guide-to-mautic-cronjobs/)

It is very helpful.
