I solved the problem. Thanks for your assistance.
Summary of the solution:
I was using apache as my web server and nginx as a reverse proxy.
I also use php-fpm 5.5 with opcache.
(NOTE: This is a server managed by directadmin control panel)
To solve the problem, I increased proxy timeout by adding this line to apache’s
virtualhost config:
ProxySet timeout=300
Full description:
(NOTE: This is a server managed by directadmin control panel)
Piwik produced a lot of “503 Service Unavailable” errors during archiving process and normal page requests.
The following error is from archiving process:
##########################
ERROR CoreConsole[2014-10-08 01:07:59] [939e3] Empty or invalid response ‘’ for website id 14, Time elapsed: 0.159s, skipping
ERROR CoreConsole[2014-10-08 01:07:59] [939e3]
Got invalid response from API request: http://site.com/index.php?module=API&method=API.get&idSi{...}
Response was ’ 503 Service Unavailable
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems.
Please try again later.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
'
ERROR CoreConsole[2014-10-08 01:07:59] [939e3] Empty or invalid response ‘’ for website id 15,
Time elapsed: 0.141s, skipping
ERROR CoreConsole[2014-10-08 01:07:59] [939e3]
Got invalid response from API request:
http://site.com/index.php?module=API&method={....}.
Response was ’ 503 Service Unavailable
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
'
ERROR CoreConsole[2014-10-08 01:07:59] [939e3] 14 total errors during this script execution, please investigate and try and fix these errors.
##########################
To solve this, I looked at the log:
/home/myuser/domains/mydomain.com/logs/Oct-2014.stats.tar.gz
I found this:
AH01075: Error dispatching request to : (polling)
I searched it in google and I found this:
http://forum.directadmin.com/showthread.php?t=49781&p=256300#post256300
I followed its instruction and it did the job
SUMMARY
Copied user_virtual_host.conf from
/usr/local/directadmin/data/templates/user_virtual_host.conf
to
/usr/local/directadmin/data/templates/custom/user_virtual_host.conf
and edited it.
I added this line:
ProxySet timeout=300
below
ProxySet min=0
So the whole block looks like this:
|*if HAVE_PHP1_FPM=“1”|
<Proxy “unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://php-fpm|PHP1_RELEASE|.|USER|/”>
ProxySet min=0
ProxySet timeout=300
|*endif|
====================
Then I executed this command to rewrite configs and apply the solution
cd /usr/local/directadmin/custombuild
./build rewrite_confs
FINISH