# HTTP health check behaviour

**URL:** <https://forums.suse.com/t/http-health-check-behaviour/826>\
**Category:** Rancher 1.x\
**Created:** [October 30, 2015, 2:27pm UTC](https://forums.suse.com/t/http-health-check-behaviour/826 "2015-10-30T14:27:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manadagr](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@manadagr](https://forums.suse.com/u/manadagr)\
**Post date:** [October 30, 2015, 2:27pm UTC](https://forums.suse.com/t/http-health-check-behaviour/826/1 "2015-10-30T14:27:11Z")

</div>

Hi

I’ve got a web service with a scale of 2 and I’m setting up an HTTP health check via the UI. The radio button has a label of ‘HTTP Responds 2xx/3xx’ - from this I inferred that if the health endpoint responds with anything other than 2xx or 3xx then the health check should fail? This doesn’t appear to be so as I’ve set the health endpoint up to respond with a 404 and a 500 and the health check seems to pass, i.e., the container remains up and status is green. I’ve also fired up the web service in one of the containers to listen on a different HTTP port to the one specified in the Health Check options, and, though there are no health checks going on in the container logs - the container is still green.

What would be the expected behaviour here? Also, the docs are great, but it would be quite handy to have a short explanation of each of the health check fields in the UI.  
Thanks

---

<div class="post-metadata">

**Author:** ![manadagr](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@manadagr](https://forums.suse.com/u/manadagr)\
**Post date:** [November 2, 2015, 3:43pm UTC](https://forums.suse.com/t/http-health-check-behaviour/826/2 "2015-11-02T15:43:49Z")

</div>

I’ve just been through [this thread 1877][1] in rancher issues and seen this quote from @ibuildthecloud

> There is one caveat you have to be careful of, don’t know if this applies, but I’ll just give you a heads up. When we schedule the health check clients we never put in the same host as the container. The health check client is the component that does the port/http ping check. If we put it on the same host, we can never know the health check failed. We schedule up to 3 clients if we can (this requires at least 4 hosts).

We have 2 hosts set up so I’m guessing that this is affecting what I am seeing?  
[1]: [Dealing with Host failures · Issue #1877 · rancher/rancher · GitHub](https://github.com/rancher/rancher/issues/1877)

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [November 5, 2015, 9:34pm UTC](https://forums.suse.com/t/http-health-check-behaviour/826/3 "2015-11-05T21:34:39Z")

</div>

FYI, we just added more docs on the explanation of the fields. Thanks to @etlweather for the PR. [http://docs.rancher.com/rancher/concepts/health-checks/](http://docs.rancher.com/rancher/concepts/health-checks/)

I think @ibuildthecloud comment is old. We’ve fixed the fact that if the healthcheck is on the same host of the containers it’s fixed. And there should be no issues with 2 hosts.

> <https://github.com/rancher/rancher/issues/1917>
>
> Server version - Build from master - Aug 28
> Steps to reproduce the problem:
> Setup had 3 hosts:
> Had a service with scale 3...

Can you provide the `healthState` in the API for the containers of your service that have the healthcheck?

Can you also confirm that you are able to ping containers across hosts just to rule that out?

---

<div class="post-metadata">

**Author:** ![manadagr](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@manadagr](https://forums.suse.com/u/manadagr)\
**Post date:** [November 13, 2015, 9:55am UTC](https://forums.suse.com/t/http-health-check-behaviour/826/4 "2015-11-13T09:55:53Z")

</div>

Thanks Denise for the updated documentation - that adds clarity to those fields. I’ve unsuccessfully tried to recreate the issue I was having but healthchecks now work as I expect them to so I take it that it was something with my set-up.  
Thanks again.

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [November 13, 2015, 6:33pm UTC](https://forums.suse.com/t/http-health-check-behaviour/826/5 "2015-11-13T18:33:38Z")

</div>

Closed on November 13, 2015, 6:33pm UTC


