# Performance issue in admin and tracking code

**URL:** <https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964>\
**Category:** Product Support\
**Created:** [November 23, 2017, 12:19pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964 "2017-11-23T12:19:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 23, 2017, 12:19pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/1 "2017-11-23T12:19:34Z")

</div>

Hi, I have a severe performance issue using Mautic. The tracking code takes up to 10 seconds to load, and everu page in the admin takes a lopt of time to refresh. The website is running fine, both are located on a dedicated server, under the same domain.  
  
  
  
I have 2,600 contacts and a low volume of web traffic.  
  
  
  
What can I look or try?  
  
  
  
Regards,  
  
Xavier

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 23, 2017, 12:19pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/2 "2017-11-23T12:19:34Z")

</div>

Hi, I have a severe performance issue using Mautic. The tracking code takes up to 10 seconds to load, and everu page in the admin takes a lopt of time to refresh. The website is running fine, both are located on a dedicated server, under the same domain.

I have 2,600 contacts and a low volume of web traffic.

What can I look or try?

Regards,  
Xavier

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 24, 2017, 10:40am UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/3 "2017-11-24T10:40:07Z")

</div>

Hi, I have found a solution in this older thread: [https://www.mautic.org/community/index.php/113-incredibly-slow-response-times/p1#p23894](https://www.mautic.org/community/index.php/113-incredibly-slow-response-times/p1#p23894), from wittwerch. It has reduced the load time of the tracking script from 4-8 seconds to approx. 1 second.

===

Beside that Mautic has that weird concept of sleep times built in: [https://github.com/mautic/mautic/blob/556f4e4969ad9124106dcb9535a5704d863665fc/app/bundles/CampaignBundle/Model/EventModel.php#L618](https://github.com/mautic/mautic/blob/556f4e4969ad9124106dcb9535a5704d863665fc/app/bundles/CampaignBundle/Model/EventModel.php#L618)  
That will basically introduce artificial wait time into your process, so I would recommend to set that to zero so you make use of all the CPU power you have.

app/config/parameters\_local.php

\<?php $parameters = array( 'batch\_sleep\_time' =\> 0, );

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 24, 2017, 11:09am UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/4 "2017-11-24T11:09:05Z")

</div>

Hi,

Sorry it is not fixed, I looked at the wrong script. It is still taking up to 10 secondfs to load.

Any hints?

Xavier

---

<div class="post-metadata">

**Author:** ![denispavliha](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@denispavliha](https://forum.mautic.org/u/denispavliha)\
**Post date:** [November 24, 2017, 2:29pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/5 "2017-11-24T14:29:41Z")

</div>

So the mtc.js call takes like 10 seconds? What do webserver logs say? And the db server logs?

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 24, 2017, 6:41pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/6 "2017-11-24T18:41:48Z")

</div>

Hi,

I have cleaned the Mautic cache and updated the database schema, as the doc says. Then looked at the server logs:

Apache error log is clean  
PHP error log is clean  
MySQL log is clean  
Mautic log is also clean

There are no traces of any errors in the logs, all records look good. The server has low traffic, there are no CPU issues, and it is a dedicated server with loads of memory, CPU and disk space.

But mtc.js tajes 5 to 10 secs to load (more often 10).

What else can I look at?

Xavier

---

<div class="post-metadata">

**Author:** ![denispavliha](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@denispavliha](https://forum.mautic.org/u/denispavliha)\
**Post date:** [November 24, 2017, 6:50pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/7 "2017-11-24T18:50:25Z")

</div>

Argh, I don’t think I can be of help. Seems like you’ve checked everything I would.

Have you experimented with turning off individual Apache and/or PHP modules just in case some of these are causing you issues? I don’t know, possibly gzip or something similar.

Sorry I can’t be of greater help.  
D

PS: mtc.js is generated dynamically (using PHP) so maybe if you turned on some verbose PHP logging, you could find something out…?

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 25, 2017, 4:33pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/8 "2017-11-25T16:33:42Z")

</div>

Hi,

PHP logging does not add anything new. I will try removing individuañ modules, but I cannog think of anyone that can cause a delay instead of an error.

Besides, I have looked at a customer’s site, where I installed Mautic and is a very similar server, actyually a bit less powerful. There, mtc.js loads in under 2 seconds - as it should be.

Both servers are very similar, they come from the same provider, and there is no difference in the installation (same version).

Is there any way to see what is happening inside Mautic, to trace or time or see queries?

Xavier

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 26, 2017, 2:21pm UTC](https://forum.mautic.org/t/performance-issue-in-admin-and-tracking-code/9964/9 "2017-11-26T14:21:49Z")

</div>

Hi,

I found the issue. It was the MySQL server, I have disabled the DNS lookup and times are correct now, they have reduced to one fifth the original time. It affected all sites, though Mautic was much more severely affected, don’t know why.

Thanks for your help.

Regards,  
Xavier
