Error 504 - With custom segments and real-time visitors

Hello everyone! Matomo returns error 504, when we use for a specific segment the real time widget located in the Visitors section.
We are using the self-host version of matomo and have configured the various PHP settings with a time greater than 60 seconds. However, after 60 seconds the call goes to 504. Can we change other settings so we can solve this problem?

Thank you

not enough information here. are you using nginx? you can’t use PHP to prevent a timeout issued by nginx.
you can configure PHP to allow for longer run times, but nginx still timeouts if there is no answer (from PHP) in time.

To configure nginx to allow more time see the proxy_read_timeout directive.

depending on your configuration, there might be other things you need to adjust.

1 Like

Thank you for your response. Yes we are using nginx and have already taken care to increase these settings:

  • proxy_read_timeout
  • proxy_connect_timeout
  • proxy_send_timeout
  • send_timeout

with a timeout greater than 60 seconds.
We also use cloudflare.

I just checked. we also have these settings (dont know if they are needed):

Apache:
FcgidIOTimeout 7100
FcgidBusyTimeout 7100

ngnix:
fastcgi_read_timeout 7100

I dont know with Cloudflare, but they could have their own timeout settings?

2 Likes

We fixed the 504 error by increasing the value of fastcgi_read_timeout.
Thank you very much!