504 Gateway Timeout when login into mautic

Hello, I have a similar issue after upgrading to 5.2.6 from 4.4.13

My user works fine, but 2 of my colleagues that tried encountered the following:

  1. after login, the dashboards page returns 504 timeout
  2. Going to /s/config or whatever still returns 504 timeout
  3. After any page is loaded after some time, you can easily browse through the app.
  4. After a while, you get again 504 timeouts
  5. Repeat 3.

Same amount of data (dashboard) in mautic v4 works fine.