Watchdog

    The watchdog becomes an "init process" with an embedded HTTP server written in Golang, it can support concurrent requests, timeouts and healthchecks. The newer of-watchdog mentioned below is similar, but ideal for streaming use-cases or when an expensive resource needs to be maintained between requests such as a database connection, ML model or other data.

    The classic watchdog has historically been used for all of the official OpenFaaS templates, but the of-watchdog (mentioned below) is now becoming more popular and templates exist for both watchdogs for the common programming languages in the default and community template store.

    Pictured: technical conceptual diagram of the OpenFaaS watchdog during an invocation

    Technical documentation on the classic watchdog is available along with a table with all configuration options.

    Status: this component is suitable for use in production and is part of the GitHub organisation.

    This version of the of-watchdog brings new features for high-throughput and enables re-use of expensive resources such as database connection pools or machine-learning models. The primary difference is the ability to keep the function process warm between invocations. The classic watchdog forks one process per request giving the highest level of portability, but the newer version enables a mode where that same process can be re-used repeatedly to offset the latency of forking.