I'm using MAMP Pro on my Mac (Monterrey) and since a couple weeks I've been having a strange problem. After several tests I've been unable to find out where the problem is, but this is what happens.
The main issue is, when I load any local php/postgre/laravel website, it takes forever to load. 20-30 secs and sometimes it loads, sometimes it doesn't.
Strange thing is, all of the sudden, sometimes websites start loading normally again for some minutes... and then, all of the sudden, they go slow again. Even pages that don't do anything in particular besides just loading an empty view.
Another strange thing is, when the 'slow mode' thing is happening, I tried loading a plain html page and it works normally, so the problem must be mamp/php/library/laravel related?
I'm not using wordpress, my websites are mostly using laravel (5.8.x, 6.x, 8.x) with a couple old exceptions using old plain PHP.
I tried changing my database host from localhost to 127.0.0.1 and the problem persists. Also, I was using SSL for all my local websites, so I tried removing the SSL, changing apache ports from 80 to 8080 and back... didn't work, problem persists.
I tried changing MAMP PHP Settings from Module to CGI and back... didn't work. I tried using cache, not using cache, reinstalling MAMP, reinstalling PHP, using different PHP versions for different websites, using nginx instead of apache... Nothing worked.
One thing that surprised me was, when MAMP was working slow and every website was taking 15-20 secs to load, I ran a php artisan migrate in command line, just to test how long did it take to connect to DB and execute the migration and it worked normally, even tho the websites were in the 'slow mode'. So that just added more questions to my confusion.
What I do know is:
It's not a slow query problem (a simple php with a 'echo "hello
world";' and no database connection takes forever to load aswell).
A HTML file doesn't have a problem, loads normally even when MAMP is
in the 'slow mode'. Tested with PHP/MySQL websites aswell, problem
persists, so I guess it's not 'postgres related' problem.
After a couple weeks dealing with this, I'm out of ideas.. anyone?
Any help will be appreciated.
pd: Sorry if my english is not very good, not my primary language.