Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we be keeping the health check uncommented? #64

Open
Gelmo opened this issue Nov 11, 2022 · 1 comment
Open

Should we be keeping the health check uncommented? #64

Gelmo opened this issue Nov 11, 2022 · 1 comment

Comments

@Gelmo
Copy link
Contributor

Gelmo commented Nov 11, 2022

https://github.com/jetrails/magento2-varnish/blob/master/Helper/VclGenerator.php#L155

Currently, we are commenting out most lines in the backend definition/array. In particular, we may want to consider using the health check:

backend default {
    .host = "localhost";
    .port = "8080";
#     .first_byte_timeout = 600s;
#     .probe = {
#         .url = "/pub/health_check.php";
#         .timeout = 2s;
#         .interval = 5s;
#         .window = 10;
#         .threshold = 5;
#    }
}

I've not yet looked into the health check itself. If we determine that the health check should be used, we need to ensure that we modify this from /pub/health_check.php to /health_check.php, as we have Nginx configured to use /pub as the document root for PHP files.

@Gelmo
Copy link
Contributor Author

Gelmo commented Nov 12, 2022

Some concerns:

  1. What if a client is running Magento AND a non-Magento site with a different hostname, and the non-Magento site is also using Varnish? We'd need to ensure the health check file exists on the other site, and that such a file is actually relevant to that site.
  2. If the defined backend (within the VCL file) is HAProxy, HAProxy will forward that to a "random" server, and Varnish is not aware of that. Varnish would need to be configured with multiple backends instead, otherwise, we risk Varnish thinking the backend is down when it may only be one server. I suppose it would be possible to do away with HAProxy altogether, define multiple backends in the VCL, and update the VCL on an interval instead of the HAProxy config. We'd need to do some testing on the impact of reloading Varnish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant