# Why? 17 minutes delay

**URL:** <https://forum.mautic.org/t/why-17-minutes-delay/4088>\
**Category:** Product Support\
**Created:** [June 4, 2016, 6:00pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088 "2016-06-04T18:00:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 4, 2016, 6:00pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/1 "2016-06-04T18:00:18Z")

</div>

Hello,  
  
  
  
I created a campaing based on a form. That form triggers an email which is send.  
  
BUT: There is a **big delay between the form submission and the email**.  
  
  
  
Example 1:  
  
At June 4, 2016 **8:07** pm, Form Submitted.  
  
At June 4, 2016 **8:07** pm, Contact Created.  
  
At June 4, 2016 **8:24** pm, Campaign Action Triggered.  
  
At June 4, 2016 **8:24** pm, E-Mail sent  
  
  
  
Example 2:  
  
At June 4, 2016 **8:38 pm** , Form Submitted.  
  
At June 4, 2016 **8:57 pm** , Campaign Action Triggered.  
  
  
  
E-Mail delivery is set to “immediate delivery”.  
  
The campagins:trigger and campaigns:update run every 3 minutes.  
  
  
  
So where does this big delay come from?  
  
  
  
Thanks for your help!  
  
Jan

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 4, 2016, 6:00pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/2 "2016-06-04T18:00:18Z")

</div>

Hello,

I created a campaing based on a form. That form triggers an email which is send.  
BUT: There is a big delay between the form submission and the email.

Example 1:  
At June 4, 2016 8:07 pm, Form Submitted.  
At June 4, 2016 8:07 pm, Contact Created.  
At June 4, 2016 8:24 pm, Campaign Action Triggered.  
At June 4, 2016 8:24 pm, E-Mail sent

Example 2:  
At June 4, 2016 8:38 pm, Form Submitted.  
At June 4, 2016 8:57 pm, Campaign Action Triggered.

E-Mail delivery is set to “immediate delivery”.  
The campagins:trigger and campaigns:update run every 3 minutes.

So where does this big delay come from?

Thanks for your help!  
Jan

---

<div class="post-metadata">

**Author:** ![ninjoan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ninjoan/32/1005_2.png) [@ninjoan](https://forum.mautic.org/u/ninjoan)\
**Post date:** [June 4, 2016, 7:10pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/3 "2016-06-04T19:10:34Z")

</div>

Check your cron job setting. Maybe is set to run every17 Minutes.

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 4, 2016, 7:27pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/4 "2016-06-04T19:27:35Z")

</div>

See above: The cronjobs run every 3 minutes.

Here is the complete list of my cron jobs:  
Mautic campagins:trigger every 3 minutes  
Mautic campaigns:update every 3 minutes  
Mautic email:process every minute  
Mautic fetch:email every hour  
Mautic leadlist:update every 3 minutes  
Mautic segments:update every 15 minutes

---

<div class="post-metadata">

**Author:** ![ninjoan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ninjoan/32/1005_2.png) [@ninjoan](https://forum.mautic.org/u/ninjoan)\
**Post date:** [June 4, 2016, 11:17pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/5 "2016-06-04T23:17:40Z")

</div>

Mautic campaigns:trigger is the one that needs to be trigger less 1 minute  
What cron job service are you using? Are you checking if the cron job has failed in several occasions?

---

<div class="post-metadata">

**Author:** ![pietromantovani](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pietromantovani](https://forum.mautic.org/u/pietromantovani)\
**Post date:** [June 7, 2016, 2:39pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/6 "2016-06-07T14:39:34Z")

</div>

Could be server Time setting?

---

<div class="post-metadata">

**Author:** ![pietromantovani](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pietromantovani](https://forum.mautic.org/u/pietromantovani)\
**Post date:** [June 20, 2016, 6:16am UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/7 "2016-06-20T06:16:51Z")

</div>

Not in “any” order: in the same order as you can see in documentation.

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 17, 2016, 5:55pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/8 "2016-06-17T17:55:43Z")

</div>

So what is the right order? I checked the docs again and the just say “It is recommended that you stagger the following required jobs so as to not run the exact same minute.” [https://mautic.org/docs/en/setup/cron\_jobs.html](https://mautic.org/docs/en/setup/cron_jobs.html)

But how to do this? Let’s say I’m configuring one cronjob to run every 3 minutes and the other one every 5 minutes. After 15 minutes both will run!

The only way to do so is one big script processing all cronjobs one after another. But to me it seems that some script should be executed more often than ofters?

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 17, 2016, 6:35pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/9 "2016-06-17T18:35:54Z")

</div>

Meanwhile I’m getting cronjob results by email. It looks like they run very very very long. The segment update (triggering one new campagin action) finished 10 minutes ago. The campaign triger & update are runnings since then… For sending just one single email. Any ideas on that?

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 17, 2016, 7:42pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/10 "2016-06-17T19:42:13Z")

</div>

@pietromantovani Seems you were correct: The cronjobs were blocking each other by a lock file.

Solution:  
Do not execute cron jobs separate but in (any?) order. Use a shell skript to do so or a PHP skript.

Maybe you have to add more skripts depending on your setup!

Shell:

`php app/console mautic:segments:update 2>&1
php app/console mautic:campaigns:trigger 2>&1
php app/console mautic:campaigns:update 2>&1
`

PHP: (I need to call it using a HTTP wrapper)

[code]\<?php  
echo “

```
”;

echo “\*\*\* segments:update \*\*\*nn”;  
exec(“php app/console mautic:segments:update 2\>&1”, $out, $result);  
echo “Returncode: " .$result .”  
";  
echo “Ausgabe des Scripts: " .”  
";  
print\_r(join($out, “n”));  
$out = array();

echo “nn\*\*\* campaigns:trigger \*\*\*nn”;  
exec(“php app/console mautic:campaigns:trigger 2\>&1”, $out, $result);  
echo “Returncode: " .$result .”  
";  
echo “Ausgabe des Scripts: " .”  
";  
print\_r(join($out, “n”));  
$out = array();

echo “nn\*\*\* campaigns:update \*\*\*nn”;  
exec(“php app/console mautic:campaigns:update 2\>&1”, $out, $result);  
echo “Returncode: " .$result .”  
";  
echo “Ausgabe des Scripts: " .”  
";  
print\_r(join($out, “n”));  
?\>  
[/code]
```

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 17, 2016, 2:32pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/11 "2016-06-17T14:32:19Z")

</div>

Update: E-Mail arrived after 1 hour. ☹  
The email headers show that this is a mautic issue, not a problem of the mailservers. (It took just a few secounds there.)

---

<div class="post-metadata">

**Author:** ![pietromantovani](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pietromantovani](https://forum.mautic.org/u/pietromantovani)\
**Post date:** [June 17, 2016, 2:53pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/12 "2016-06-17T14:53:35Z")

</div>

Ok. That why I’ve said “could”. Another possibility: what about your cron setting? If you run all crons together every 3 minute I think you could get unpredictable result.  
You should execute them in order.

---

<div class="post-metadata">

**Author:** ![jantheofel](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jantheofel](https://forum.mautic.org/u/jantheofel)\
**Post date:** [June 17, 2016, 2:23pm UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/13 "2016-06-17T14:23:54Z")

</div>

@ninjoan Well the difference betweet 3 and 1 minute should not be that big deal? I use this HTTP wrapper to call the cronjobs because my hoster does not offer real cronjobs. Sadly I can’t check this. ☹ [https://www.mautic.org/community/index.php/545-cron-job-set-up-problem/0#p2104](https://www.mautic.org/community/index.php/545-cron-job-set-up-problem/0#p2104)  
@pietromantovani How? Even if the server has a wrong timezone: A cronjob every three minutes is every three minutes. So I don’t understand how that should cause the problem.

I have a very similar problem again:

- Created a segment
- One contact is assigned to that segment
- Created a new campaign with the source of this segment
- Next action in the campaign is a simple email
- Launched campaign about 1 hour ago
- User has been assigned to that campaign
- But no email is sent until now

Is there a way to check which campaign steps were triggerd for which user?

---

<div class="post-metadata">

**Author:** ![tachien](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@tachien](https://forum.mautic.org/u/tachien)\
**Post date:** [August 14, 2017, 10:16am UTC](https://forum.mautic.org/t/why-17-minutes-delay/4088/14 "2017-08-14T10:16:54Z")

</div>

@jantheofel : I have the same problem. Can you kindly advise step by step how to solve? Many thanks your help  
TC
