Timeout errors randomly

Hi,

I am using HestiaCP on Ubuntu 22.04 LTS VPS with 6 Ryzen VCPUs and 8GB RAM. The server is only hosting 2 WordPress sites with very low traffic.

Both sites are running behind the CloudFlare proxy and the problem I have been facing is the site gives 522 timeout errors randomly.

It happens on both sites, and randomly anywhere.

The error log looks like this:

[client xxx:0] AH01071: Got error ‘Primary script unknown’, referer: http://domain.com//cgi-bin/install.php
[Wed Oct 18 19:10:18.078319 2023] [proxy_fcgi:error] [pid 1102656:tid 139752841922112] (70007)The timeout specified has expired: [client xxx:0] AH01075: Error dispatching request to : (polling), referer: https://domain.com/wp-admin/post.php?post=15011&action=edit
[Wed Oct 18 19:19:02.043194 2023] [proxy_fcgi:error] [pid 1300398:tid 139753504618048] (70007)The timeout specified has expired: [client xxx:0] AH01075: Error dispatching request to : (polling), referer: https://domain.com/wp-admin/post.php?post=15011&action=edit&classic-editor
[Wed Oct 18 19:51:18.218385 2023] [proxy_fcgi:error] [pid 1300398:tid 139752363767360] (70007)The timeout specified has expired: [client xxx:0] AH01075: Error dispatching request to : (polling), referer: https://domain.com/wp-admin/

Can someone please help me solve this issue?

Hello @attiqfsd,

You could try to increase the timeout for php directive max_execution_time (by default it is 60 seconds). For example, if you want to raise the max execution time to 120 seconds, create a file .user.ini in your public_html directory with this content:

max_execution_time = 120

I see you are using Apache, maybe you should increase Timeout directive in /etc/apache2/apache2.conf (by default it is 30 seconds).

Remember to restart apache if you modify apache’s conf:

systemctl restart apache2

Cheers,
sahsanu

2 Likes

This was happening when I was using the “caching” template and I decided to change it back to the “default” template. But the problem happened again, so I have now gone back to the “caching” template.

I have also increased the timeout to 300 from 30 in apache2.conf. Let’s see if that helps.

Also updated the PHP max_execution_time to 240

1 Like