HTTP Status Code for database is down

荒凉一梦 提交于 2019-11-29 05:24:31

I would suspect that a 500 or 503 would be appropriate. 503 is generally used for overloaded or maintenance conditions, but I don't think it would be unreasonable to use it for your situation.

Tomas

That's exactly what a 503 is.

503 means that the server was relying on connecting some other service, which did not respond in time.

Server Error 5xx

Checked up on Wikipedia and the listing there seems to imply that a 504 would be the one I'm thinking of. Quite possibly the link over is outdated.

So:

504 Gateway Timeout

The server was acting as a gateway or proxy and did not receive a timely request from the downstream server.

It sounds like you should base your monitoring on more than just the status return. You're trying to pass more sophisticated information than the HTTP status codes were designed to communicate.

Or, just pick a code, even make one up, and set up your monitoring to treat it as "db down".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!