For the time being I only tested this in a controller environment (not my actual Mautic installation) but if my tests go ok I’ll probably execute the actual migration soon.
Just leaving the topic here in case it helps others
Thank you for sharing! As data/configuration is separated from the code (and should persist in the local filesystem of the host or least in a Docker volume) the upgrade should be as easy as changing the image-tag to fetch from Dockerhub, rebuild and replace the running mautic_web, _cron and _worker containers.
I’m using a local Gitlab server and a CI/CD pipeline to build the image (if needed) and deploy the containers using a Gitlab-Runner.
Regarding the migrations scripts: are there always to be run? I thought this is only needed on database schema changes?
Do you know the purpose of the
DOCKER_MAUTIC_RUN_MIGRATIONS
env var?
Hey, just finished (I hope so!) the upgrade from 5.0.4 to 5.2.1.
A couple of notes about the process:
I had to add this line: $_SERVER['HTTPS'] = 'on'; at the top of index.php to get my ssh working (Something I had to do last time as well).
I was unable to have Mautic detect the fact that it was already installed, so I re-run the installation process and, afterwards copied the db on top of the new one
Applied the migrations
That’s it!
It looks really nice so far, I hope I don’t find any unpleasant surprises going forward…
Apparently the issue was not related to Mautic but to a WordPress site I have running in the same server. I installed php8.3 instead of 8.2 as I had in the previous server and that seems to have made the difference. I downgraded to 8.2 and things seem to be working fine.
You’re probably hitting max RAM - and then get killed by the system to self preserve.
Reduce the RAM allocation by
reduce the keepalive (be careful)
reduce the number of spawned process waiting or hanging for no reason
reduce the number of loaded module (not using it, close that attack surface)
get rid of the htaccess (load it in the vhost configuration - much more efficient)
only logs errors (no warning, info nor any low quality signal)
When dealing with a WordPress, check for classic pain points like the xmlrpc (just echo nothing in it to empty the file if not using it)
Make sure to have compressed medias (+2MB jpg/png/put your format here is a silent killer. How? by doing some kind of legit “slow read attack” where the clients will “slow read” your media, saturate your web server. And ultimately kill it)
It’s me again… I’m afraid what I thought was solved actually wasn’t
I did try a few things:
Putting down the cron container but leaving the web one up
Replaced the NginX+fpm for a simple Apache based image
Simplified the cronjob to only run a single echo
Anyway, I found that, after a little while (30’ or less) the web component takes up all of the available memory in the server and it becomes responsive…
Any idea what I could be missing?
Thanks
Update
My currently running test: changed the configuration in /usr/local/etc/php-fpm.d/www.conf to:
pm = ondemand
pm.max_children = 3
So far so good…
The cronjobs run and everything is still up… I hope it stays like this
Update 2
Nope, it’s still failing.
What I noticed is that everything comes back together if I manually kill the php-fpm process from within the web container. It seems like some particular request is spawing a huge cpu usage but I can’t pinpoint it…
I run a couple of more tests on my new server (Ubuntu 24.04), going through versions 5.1.0 and 5.1.1 with different php-fpm configurations + cronjob frequency and the one that seems to be working (Even with version 5.2.1) is the following:
Changed the php-fpm pool configuration to: pm = static pm.max_children = 2
I’m still not sure why this change made the difference. I checked my previous installation (Ubuntu 23.10 + Mautic 5.0.4) and it was running fine with the default config…
Both servers have the same (virtual) hardware.
I tried increasing the cron frequency to every 3 minutes but that seems to have been too much… I’ll probably try 5 minutes and, if everything goes well I’ll call it a day.
I’m going to leave this thread here so others can benefit from my experience.
I finally got to get Mautic 5.2.1 working on my old server (Ubuntu 23.10, 1GB Ram, 25GB disk).
Then I tried a lot of things on new server instances (Ubuntu 24.04.1 and 24.10) but got the same result over and over: after ~20 min the CPU would go to 100% usage and only after manually killing the in-docker php-fpm process things would get back to normal.
I did notice that my old server is using Docker 24.0.5 and the new ones are on Docker 27.5.0. I tried downgrading but all could get was 24.0.7.
I also tried to explicitly limit the resources used by my containers and that didn’t solve the problem either.
So… right now I have a working environment but I’m afraid when it comes time to do the upgrade to a newer Ubuntu version things might fall apart…