You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Scott Harris <sc...@harrisnet.id.au> on 2013/09/06 01:15:59 UTC

Health Check Url from Loadbalancer

I have a multi node cluster with a F5 Loadbalancer providing a vip and
balancing requests across the cluster, as part of the F5 config a
healthcheck is required to validate each node is alive and ready to take
requests.

Is there any light weight healthcheck urls ats provides for this?

I found an internal url test url using a remap mappping to http://{test}
but the response is about 63KB.

Im currently using /stat/proxy.node.proxy_running and matching on response
proxy.node.proxy_running=1,  is this the best practise?

Re: Health Check Url from Loadbalancer

Posted by Leif Hedstrom <zw...@apache.org>.
On Sep 8, 2013, at 8:33 PM, Scott Harris <sc...@harrisnet.id.au> wrote:

> Just been doing some tests and finding using this plugin is causing seg faults when the client requests a uri of / or null.  I guess that is why its still experimental.
> 
> I have not done much coding for a while but in health_check_origin after :
> const char* path = TSUrlPathGet(reqp, url_loc, &path_len);
> 
> I added :
> if (!path)
>         goto cleanup;
> 

Can you file a bug on it please?

I'm not sure why this happens yet, but I'll take a look at it tomorrow. I would have imagined that path_len would be 0, so it shouldn't try to access the empty string.

Cheers,

-- leif



Re: Health Check Url from Loadbalancer

Posted by Scott Harris <sc...@harrisnet.id.au>.
Just been doing some tests and finding using this plugin is causing seg
faults when the client requests a uri of / or null.  I guess that is why
its still experimental.

I have not done much coding for a while but in health_check_origin after :
const char* path = TSUrlPathGet(reqp, url_loc, &path_len);

I added :
if (!path)
        goto cleanup;







On Sat, Sep 7, 2013 at 12:35 AM, Williamson, Brad <
Brad.Williamson@disney.com> wrote:

> We use this on the BigIP's as a lightweight healthcheck:
> Send String:  GET /__HC__ \r\n\r\n
> Receive String: abcdefghijklmnopqrstuvwxyz
>
> Which uses this in the remap.config, complete with extra paranoia:
> map http://myservername01.domain.com/__HC__
> http://myservername01.domain.com:8083/synthetic.txt
> map http://myservername01/__HC__
> http://myservername01.domain.com:8083/synthetic.txt
> map /__HC__ http://myservername01.domain.com:8083/synthetic.txt
>
>
> We have a few layers of health checks that check end-to-end operation of
> the ATS boxes:
> - Check a piece of non-cachable media from external site
> - Check a piece of cachable media from external site
> - TCP Port monitors from internal
> - /__HC__ healthchecks from all places that need connectivity
> - different pieces of media that are obtained through different remap rules
> - composite monitors that fire when 3 out of 5 pieces of media are not
> status 200's
>
> I'll have to look at the plugin and see if it adds anything that we don't
> already have. The synthetic is nice in that it is very quick to respond to
> a failure, but we once it is up, we try to test on what it is really
> supposed to be doing (i.e. delivering media!). And, BTW, the ATS boxes have
> been extremely reliable (knocks on wood) and extremely fast.
>
> Brad
>
>
>
> -----Original Message-----
> From: Leif Hedstrom [mailto:zwoop@apache.org]
> Sent: Thursday, September 05, 2013 7:23 PM
> To: users@trafficserver.apache.org; Scott Harris
> Subject: Re: Health Check Url from Loadbalancer
>
> On Sep 5, 2013, at 5:15 PM, Scott Harris <sc...@harrisnet.id.au> wrote:
>
> > I have a multi node cluster with a F5 Loadbalancer providing a vip and
> balancing requests across the cluster, as part of the F5 config a
> healthcheck is required to validate each node is alive and ready to take
> requests.
> >
> > Is there any light weight healthcheck urls ats provides for this?
> >
> > I found an internal url test url using a remap mappping to http://{test}
> but the response is about 63KB.
>
> There's a plugin in experimental, that's intended for this purpose. It'll
> watch a file (or files) on your file system, and return the content of that
> upon request. The idea is that if you remove that file, the plugin will
> return e.g. a 404 (configurable), telling the load balancer to take the box
> out of rotation.
>
> This allows you to check both the health of the server, and manage its
> participation in the rotation.
>
> -- Leif
>
> E.g.
>
> loki (15:53) 580/1 $ cat plugins/experimental/healthchecks/README
> This is a simple plugin, to provide basic (but configurable) health checks.
> This is a server intercept plugin, and it takes one single  configuration
> option in plugin.config, the configuration file name.
>
> This configuration contains one, or several, lines of the format
>
>    <URI-path> <file-path> <mime> <file-exists-code> <file-missing-code>
>
>
> For example,
>
>    /__hc  /var/run/ts-alive  text/plain 200  403
>
>
> The content of the file, if any, is sent as the body of the response.
>
>

RE: Health Check Url from Loadbalancer

Posted by "Williamson, Brad" <Br...@disney.com>.
We use this on the BigIP's as a lightweight healthcheck:
Send String:  GET /__HC__ \r\n\r\n
Receive String: abcdefghijklmnopqrstuvwxyz

Which uses this in the remap.config, complete with extra paranoia:
map http://myservername01.domain.com/__HC__ http://myservername01.domain.com:8083/synthetic.txt
map http://myservername01/__HC__ http://myservername01.domain.com:8083/synthetic.txt
map /__HC__ http://myservername01.domain.com:8083/synthetic.txt


We have a few layers of health checks that check end-to-end operation of the ATS boxes:
- Check a piece of non-cachable media from external site
- Check a piece of cachable media from external site
- TCP Port monitors from internal
- /__HC__ healthchecks from all places that need connectivity
- different pieces of media that are obtained through different remap rules
- composite monitors that fire when 3 out of 5 pieces of media are not status 200's

I'll have to look at the plugin and see if it adds anything that we don't already have. The synthetic is nice in that it is very quick to respond to a failure, but we once it is up, we try to test on what it is really supposed to be doing (i.e. delivering media!). And, BTW, the ATS boxes have been extremely reliable (knocks on wood) and extremely fast.

Brad



-----Original Message-----
From: Leif Hedstrom [mailto:zwoop@apache.org] 
Sent: Thursday, September 05, 2013 7:23 PM
To: users@trafficserver.apache.org; Scott Harris
Subject: Re: Health Check Url from Loadbalancer

On Sep 5, 2013, at 5:15 PM, Scott Harris <sc...@harrisnet.id.au> wrote:

> I have a multi node cluster with a F5 Loadbalancer providing a vip and balancing requests across the cluster, as part of the F5 config a healthcheck is required to validate each node is alive and ready to take requests.
> 
> Is there any light weight healthcheck urls ats provides for this?
> 
> I found an internal url test url using a remap mappping to http://{test} but the response is about 63KB.

There's a plugin in experimental, that's intended for this purpose. It'll watch a file (or files) on your file system, and return the content of that upon request. The idea is that if you remove that file, the plugin will return e.g. a 404 (configurable), telling the load balancer to take the box out of rotation.

This allows you to check both the health of the server, and manage its participation in the rotation.

-- Leif

E.g.

loki (15:53) 580/1 $ cat plugins/experimental/healthchecks/README
This is a simple plugin, to provide basic (but configurable) health checks.
This is a server intercept plugin, and it takes one single  configuration option in plugin.config, the configuration file name. 

This configuration contains one, or several, lines of the format

   <URI-path> <file-path> <mime> <file-exists-code> <file-missing-code>


For example,

   /__hc  /var/run/ts-alive  text/plain 200  403


The content of the file, if any, is sent as the body of the response.


Re: Health Check Url from Loadbalancer

Posted by Scott Harris <sc...@harrisnet.id.au>.
we are running on redhat so thats not a problem,  I have it running now and
working.

thanks again.


On Fri, Sep 6, 2013 at 11:04 AM, Leif Hedstrom <zw...@apache.org> wrote:

> On Sep 5, 2013, at 5:54 PM, Scott Harris <sc...@harrisnet.id.au> wrote:
>
> > excellent,  exactly what I need.
> >
> > thankyou
>
> Note that it it only builds on Linux. The slacker who wrote it didn't care
> about other systems ;). It ought to be fairly easy to port to other
> platforms, or rewrite it such that it doesn't depend on system specific
> things (those might be premature optimizations anyways as it is now …).
>
> Cheers,
>
> -- Leif
>
>

Re: Health Check Url from Loadbalancer

Posted by Leif Hedstrom <zw...@apache.org>.
On Sep 5, 2013, at 5:54 PM, Scott Harris <sc...@harrisnet.id.au> wrote:

> excellent,  exactly what I need.
> 
> thankyou

Note that it it only builds on Linux. The slacker who wrote it didn't care about other systems ;). It ought to be fairly easy to port to other platforms, or rewrite it such that it doesn't depend on system specific things (those might be premature optimizations anyways as it is now …).

Cheers,

-- Leif


Re: Health Check Url from Loadbalancer

Posted by Scott Harris <sc...@harrisnet.id.au>.
excellent,  exactly what I need.

thankyou


On Fri, Sep 6, 2013 at 9:22 AM, Leif Hedstrom <zw...@apache.org> wrote:

> On Sep 5, 2013, at 5:15 PM, Scott Harris <sc...@harrisnet.id.au> wrote:
>
> > I have a multi node cluster with a F5 Loadbalancer providing a vip and
> balancing requests across the cluster, as part of the F5 config a
> healthcheck is required to validate each node is alive and ready to take
> requests.
> >
> > Is there any light weight healthcheck urls ats provides for this?
> >
> > I found an internal url test url using a remap mappping to http://{test}
> but the response is about 63KB.
>
> There's a plugin in experimental, that's intended for this purpose. It'll
> watch a file (or files) on your file system, and return the content of that
> upon request. The idea is that if you remove that file, the plugin will
> return e.g. a 404 (configurable), telling the load balancer to take the box
> out of rotation.
>
> This allows you to check both the health of the server, and manage its
> participation in the rotation.
>
> -- Leif
>
> E.g.
>
> loki (15:53) 580/1 $ cat plugins/experimental/healthchecks/README
> This is a simple plugin, to provide basic (but configurable) health checks.
> This is a server intercept plugin, and it takes one single  configuration
> option in plugin.config, the configuration file name.
>
> This configuration contains one, or several, lines of the format
>
>    <URI-path> <file-path> <mime> <file-exists-code> <file-missing-code>
>
>
> For example,
>
>    /__hc  /var/run/ts-alive  text/plain 200  403
>
>
> The content of the file, if any, is sent as the body of the response.
>
>

Re: Health Check Url from Loadbalancer

Posted by Leif Hedstrom <zw...@apache.org>.
On Sep 5, 2013, at 5:15 PM, Scott Harris <sc...@harrisnet.id.au> wrote:

> I have a multi node cluster with a F5 Loadbalancer providing a vip and balancing requests across the cluster, as part of the F5 config a healthcheck is required to validate each node is alive and ready to take requests.
> 
> Is there any light weight healthcheck urls ats provides for this?
> 
> I found an internal url test url using a remap mappping to http://{test} but the response is about 63KB.

There's a plugin in experimental, that's intended for this purpose. It'll watch a file (or files) on your file system, and return the content of that upon request. The idea is that if you remove that file, the plugin will return e.g. a 404 (configurable), telling the load balancer to take the box out of rotation.

This allows you to check both the health of the server, and manage its participation in the rotation.

-- Leif

E.g.

loki (15:53) 580/1 $ cat plugins/experimental/healthchecks/README 
This is a simple plugin, to provide basic (but configurable) health checks.
This is a server intercept plugin, and it takes one single  configuration
option in plugin.config, the configuration file name. 

This configuration contains one, or several, lines of the format

   <URI-path> <file-path> <mime> <file-exists-code> <file-missing-code>


For example,

   /__hc  /var/run/ts-alive  text/plain 200  403


The content of the file, if any, is sent as the body of the response.