We have a Drupal 8.7.6 that works fine when logged in as an administrator. All pages, features work flawlessly and provide good performance.
When I tried to load the site as an anonymous user, it continued to spin and ended up with a broken 504 gateway. The logs show the following error:
2019/08/14 20:39:42 (error) 25423 # 25423: * 15460 FastCGI sent in stderr: "PHP message: Fatal PHP error: Allowed memory size of 629145600 bytes exhausted (trying to allocate 20480 bytes) in / core / lib / Drupal / Core / Entity / ContentEntityBase.php on line 191 "while the response header is read from the upstream
(Bug) 25423 # 25423: * 14852 FastCGI sent in stderr: "PHP message: Fatal PHP error: Maximum execution time of 30 seconds exceeded in /core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php on line 606 "reading the response header from the upstream
All this worked fine until yesterday, before we started migrating users and content from our old Drupal 6 system.
We have a similar setup for our development environment that works perfectly well.
I tried setting the execution time in settings.php to 0 to increase the allowed memory, and so on, but this problem persists. There is a lot of data being migrated and I can not recover it from the new copy we have.
Please recommend possible solutions to this problem.