Copy of Mautic from a subdomain to a new domain on the same VPS is too slow

Your software

My Mautic version is: 2.13.1

My PHP version is: 7.1.33-16+0~20200514.38+debian9~1.gbp1e5820

My MySQL version is : 10.1.44-MariaDB -0+deb9u1 - Debian 9.11

RAM: 6144 MB

CPU: 4

Disc: 40 GB

Number of contacts: 3000

Database size: 5,2 GB

Your problem

My problem is:

very slow work with Mautic – opening a contact takes up to 2 minutes and also Mautic forms on the webpages are not working correctly (they send data to the database, but again takes forever to show a message, that it was sent or to open the right page after sending it)

These errors are showing in the log:

no errors in the Mautic backend under System info – Logs

Steps I have tried to fix the problem:

  • I needed to move my Mautic installation from subdomain to a new domain on the same VPS server
  • so I made the exact same copy of the files and database and upload it to the new domain via SSH, changed the URLs and DB password in local.php, but then I found out that the new domain didnt have SSL, so I turned it on and changed the URLs in local.php again to https
  • I also changed permissions and users via SSH according to these instructions 1
  • I cleared the cache and also rebuild the cache for forms
  • everything works but the speed of Mautic is too slow, so I told my VPS admin to change the PHP configuration to just the same as at the subdomain and also to add cronjobs (the main 3 every 3 minutes but not at the same time), he did it
  • Mautic started to work faster but now still opening a contact is pretty slow, it takes up to 2 minutes + mautic forms on webpages are not working correctly (they send data to the database, but again takes forever to show a message, that it was send or to open the right page after sending it, I changed all URLs to the correct ones)
  • so now I have 2 installations of the same Mautic on one server with the same configuration, the original installation works fine, everything is fast, but the new one is too slow and the forms on the websites don’t work properly, so I can´t use it
  • I had only 2 CPU, co I tried to add another 2 (now I have 4), but it didn´t solve the problem, maybe I need more? I am attaching some CPU screenshot that my VPS admin sent me, but I don´t know what it means, he also said that Opcache is installed on the server and Xdebug is not on the server
  • I am attaching the printscreen from Firefox console showing what script is loading slow when opening a contact
  • I am not a programmer nor developer and my VPS admins aren´t very helpful with Mautic

Thanks for your ideas

Hello Bajola,

You did not describe how the database copy was actually done (via mysqldump?). Make sure that your database copy not only has all the tables, but also all the indexes from the original Mautic database. There are many indexes in the mautic database. If the database copy does not have any indexes… Mautic will work but will be slow.

If one Mautic is OK and the other one is slow on the same hardware, then the problem is a configuration/installation mistake on the copy, like missing indexes. Adding more CPU, RAM, storage or slowing down the cron jobs a bit will probably help, but it won’t solve the root problem.

Hope this helps.

1 Like


you are right, we didn’t do mysqldumb, my admin just did it and the problem is solved. :+1: Thank you!
Forms are also working ok, but it seems my Cron jobs are not set up the same as they were or still something is wrong, because receiving the e-mails acts weird (I tested 5 forms but received only 1 e-mail in 20 minutes and then another 2 in 30 minutes).

I am attaching a screenshot of the cron jobs that are set up in the VPS admin panel:

3 cron jobs were set up via SSH, because I wanted them to start every 3 minutes and not together at once, but I am not sure, if my admin set it up correctly:

php /www/hosting/ mautic:segments:update (minute 1, 4, 7, 10, 13, 16, etc)
php /www/hosting/ mautic:campaigns:rebuild (minute 2, 5, 8, 11, 14, etc)
php /www/hosting/ mautic:campaigns:trigger (minute 3, 6, 9, 12, 15, etc)

Could you pls recommend how to set up the crons if I want people to receive the double opt in e-mail via campaigns as fast as possible after they sign up?

Thx again :wink:

My cron set-up is similar to what you’re showing here, and I do not see any obvious problems. However, I have only played with Mautic 3 so far and you’re using Mautic 2.13. Make sure you can successfully run all the commands from the terminal, in particular mautic:emails:send. I known command names have changed in the past (not sure in which version), and what you’re showing here are recent command names.

Since you have duplicated your Mautic installation on the same server, check that the config/local.php file of the duplicated mautic installation does not contain path pointing to the old mautic installation.

These crons should be correct for 2.13, I saved them 2 years ago when we installed Mautic. Everything is correct in local.php, but I tried to rebuild the cache for forms again (after the new mysqldumb) and now it seems working as it should.

Thanks for your help :wink: