Might be worth switching that site on to a server you can switch to apache, if the issue goes away, it's OLS, if it doesn't then it's something else, either likely php or db.
Another thing might be to temporary use netdata, since you can look through the metrics and correlate with pauses and try drill down to any iowaits or cpu spikes. That said some are concerned removing it doesn't clean up properly, so again might be something to do on a different server. I had some horrible CPU spikes and didn't know what was causing them until I saw which client php process was with netdata... you already know what client is the issue, but it might give more detail across the board to review.
Does this only affect this site, or does the pauses effect other sites at the same time?
Also have you given this a try? enhance php strace it talks looking for hangs.
Beyond this all I can think of is something like newrelic or php Xray? (not used it but might help you get vision on what's happening) I've setup Xdebug in the past for looking into why LSWS was failing on long executions when I configured the server to allow them. It helped but it's a pain to setup and it was my own code I was working on.
If you've got PHP pretty much set to what it was prior to moving the site, then it really could be something with Mariadb.
I know you said you'd used slow query but what about:
Try Configure Long Query Time: Define the time threshold for a query to be considered “slow”. You can set the long_query_time system variable to a value in seconds (e.g., 5 seconds). For MariaDB 10.11 and later, use log_slow_query_time instead.
SET GLOBAL long_query_time = 5; // or SET GLOBAL log_slow_query_time = 5;
and set it to like 45second, so you can isolate them long pauses and try see if it's caused by DB, if not, then must be PHP loop/ poor execution. Likewise what if you set the php execution down to say 20seconds, can you break the site instead of it hanging?
I think your at the stage of trying to isolate the what and where rather than the how. Fingers crossed for you!