tellapart / aurproxy

Load balancer manager with knowledge of Apache Aurora's service discovery mechanism and integration with Aurora's task lifecycle.
Apache License 2.0
71 stars 18 forks source link

Make the healthcheck http verb configurable #11

Closed SEJeff closed 9 years ago

SEJeff commented 9 years ago

HEAD requests use less resources, so they can be executed more frequently.

An example configuration would look like:

                            "share_adjusters": [
                                {   
                                    "healthy_threshold": 2,
                                    "interval": 3,
                                    "port_name": "http",
                                    "route": "/health",
                                    "share_adjuster_class": "tellapart.aurproxy.share.adjusters.HttpHealthCheckShareAdjuster",
                                    "timeout": 5,
                                    "unhealthy_threshold": 2,
                                    "http_method": "HEAD"
                                }   
                            ]

I'd like your thoughts on the best way to write some tests for this before merging it however. There are some very simple tests for the adjusters, but nothing for the healthcheck adjusters. I might have more time to try to dig into writing some tests for this in the evenings, but this certainly works from my testing.

SEJeff commented 9 years ago

FWIW, I setup aurproxy to healthcheck using this patch every 3 seconds, and have put ~600k requests through it with no problems at all. Works like a champ.

ThanosBaskous commented 9 years ago

lgtm. Thanks!