Re: Appropriate use of HTTP status codes for application health checks

Willy Tarreau <w@1wt.eu> Thu, 23 February 2017 10:27 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DD1D01296A1 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 23 Feb 2017 02:27:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.902
X-Spam-Level:
X-Spam-Status: No, score=-6.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7pYIP2s7_CbP for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 23 Feb 2017 02:27:40 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7963412969B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 23 Feb 2017 02:27:40 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cgqaQ-0004RE-7B for ietf-http-wg-dist@listhub.w3.org; Thu, 23 Feb 2017 10:25:22 +0000
Resent-Date: Thu, 23 Feb 2017 10:25:22 +0000
Resent-Message-Id: <E1cgqaQ-0004RE-7B@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <w@1wt.eu>) id 1cgqaM-0004QA-Kj for ietf-http-wg@listhub.w3.org; Thu, 23 Feb 2017 10:25:18 +0000
Received: from wtarreau.pck.nerim.net ([62.212.114.60] helo=1wt.eu) by titan.w3.org with esmtp (Exim 4.84_2) (envelope-from <w@1wt.eu>) id 1cgqaF-00053p-P0 for ietf-http-wg@w3.org; Thu, 23 Feb 2017 10:25:13 +0000
Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id v1NAOVmp031067; Thu, 23 Feb 2017 11:24:31 +0100
Date: Thu, 23 Feb 2017 11:24:31 +0100
From: Willy Tarreau <w@1wt.eu>
To: Amos Jeffries <squid3@treenet.co.nz>
Cc: ietf-http-wg@w3.org
Message-ID: <20170223102431.GC30956@1wt.eu>
References: <CADfyV-Pa0fu2SDwLYzMrUe4D0Tv0wu27pmHpLjCxQXR3ev4mmA@mail.gmail.com> <119d9b4e-8587-0d8b-d292-3be61cd1ea72@treenet.co.nz>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <119d9b4e-8587-0d8b-d292-3be61cd1ea72@treenet.co.nz>
User-Agent: Mutt/1.6.1 (2016-04-27)
Received-SPF: pass client-ip=62.212.114.60; envelope-from=w@1wt.eu; helo=1wt.eu
X-W3C-Hub-Spam-Status: No, score=-7.0
X-W3C-Hub-Spam-Report: AWL=0.943, BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1cgqaF-00053p-P0 f40f9ab473889eb3290fc0a210b40918
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Appropriate use of HTTP status codes for application health checks
Archived-At: <http://www.w3.org/mid/20170223102431.GC30956@1wt.eu>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33594
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Amos,

On Thu, Feb 23, 2017 at 10:53:07PM +1300, Amos Jeffries wrote:
> IMHO a better efficient way for a polling system is to use 204 as "All
> okay", and 200 as "some problem(s)". No bandwidth wasted with payload on
> the common Up status, and ability to deliver details about the outage on
> the Down status.

In fact it's common to see health check applications return 5xx for a
very simple reason, the front equipment performing the check (often a
load balancer) has to deal with these situations anyway, and most use
cases just want to return "completely up" or "completely dead". But I
agree that when you want to support the gray area in between, it's much
better to support intermediary codes. FWIW haproxy also supports a
special case of 404 to mean "closing soon, no more requests please" so
that admins can simply touch/rm a file in a docroot. That's just to say
that there are many valid use cases and tha common sense adapted to what
components *reliably* support is often the best here.

Cheers,
Willy