@petergillardmoss opened this Issue on May 1st 2015

Hello,

We have our Piwik instances on an autoscaling group behind an ELB load balancer.

Today our AWS system went into freefall launching and terminating instances in an infinite loop.

On debugging we realised that we'd been using index.php to do a health check. Because the version had been upgraded Piwik was now returning a 302 for index.php to prompt to run the upgrade process. AWS ELB only recognises 200 as healthy.

We've changed the ELB to point to plugins/Diagnostics/DiagnosticReport.php instead, which gave a stable 200 response in both scenarios. However I'm sure this is far from robust.

Is it possible to provide a reliable URL on which load balancers (and other monitoring systems) can health check Piwik from?

Thanks
Peter

@tsteur commented on May 5th 2015 Member

You could probably use http://example.org/config/global.ini.php or http://example.org/config/config.ini.php since it is unlikely that we will remove those files anytime soon. We do have some monitoring running as well but I do not know what we use for our health checks. We do not really have this problem that they could go into freefall launching and terminating.

What exactly did you want to test here? Just whether the webserver is running in general?

@petergillardmoss commented on May 12th 2015

Thanks for the response.

I'll try those pages.

Yes we just want to know if the server is up and running.

The problem is manifest when using health checks with autoscaling. If the health check fails then autoscaling kills the instance and creates a new one. But the health check will always fail if the page doesn't return a 200 (for whatever reason).

@tsteur commented on May 12th 2015 Member

@petergillardmoss I will reopen this issue for now since we probably actually need a file / api for that to prevent issues like this and #7850 in the future. At least we'll have to think about it and see what we can/want to do.

ping @mattab

@mattab commented on May 14th 2015 Member

I forgot about this issue and created another issue in #7904

@petergillardmoss feel free to add your thoughts over there

@ORESoftware commented on September 24th 2019

what URL should we use for a health check if we put matomo behind a load balancer? This thread was unfortunately not useful so far.

GET matomo.ours.co/xyz  

?

and expect http code 200?

@tsteur commented on September 25th 2019 Member

You could for example create a site for ELB and use the tracking API for this like http://yourdomain.com/matomo.php?rec=1&idsite=1&action_name=foo&send_image=1 this will also test DB connection basically.

This Issue was closed on May 14th 2015
Powered by GitHub Issue Mirror