Extremely slow Mysql

Since installing Devilbox on Centos 7 I have response times of up to 45 seconds to load a page with 900 queries. When on my windows devbox it take 4.8 seconds to load the same page.

I have been trying out so many settings over the last 2 months. I have this issue on Linux Mint at home too running Devilbox however I had the same issue with XAMMP and Linux Mint which is why I tried DevilBox.

The only place this app works fine is with XAMPP on Windows and in production with Centos 7, PHP 7.3 and Apache.

So If I install the same app on two different machines and they are both really slow but in production it is really fast what on earth can it be??

I am running laravel with debug bar and on the slow machines I can see that most queries run at around 40ms but on the fast machine they are mostly registering at 0μs

Please see network tab from Slow machine (top screenshot)
And from fast windows machine (bottom screenshot)

As seen in the fast screenshot I don’t even register HTTPS or HTTP2 but it still much faster.

I have tried many different mysql configs to no avail.
I have tried Mysql 5.7, Maria 10.5 and now Percona 5.7 all slow.
I have change localhost reference to 127.0.0.1 to avoid ipv6 lookups on hosts file
I have disabled ipv6
I have edited DNS settings in /etc/resolv.conf and removed references to 127.0.0.1
I have removed Mysql from Centos and cleaned
I have removed Apache from centos

I have no idea what more I can do. Every Google search now is filled with purple links that I have visited multiple times.

I really have no idea how mysql can have such persistent settings that make it perform so terribly with such ease. Though I’m really not sure what is causing this.

After weeks of trying to speed up devilbox I was unable to reduce mysql query speeds.

In the proccess of trying to get devilbox to speed up I inadvertinadly changed something that made XAMPP speed up again. Now my heavy mysql pages load in 3 seconds with XAMPP, but still 45 seconds in Centos and 30 seconds in Linux Mint and Ubunto 20.04(fresh install)

I want to use Devilbox but I cannot develop with it on mysql heavy pages as it is not fast enough out of the box.