Service-runner is a library that provides generalized runtime facilities for Node.js services, including:
- a standard worker cluster setup with restarts,
- a generalized yaml config format with support for running multiple services in a single process,
- runtime facilities for
- metrics reporting
- rate limiting.
It is used in basically all Wikimedia node.js services.
The main documentation can be found in the README document. This page is intended to augment this documentation with a FAQ, and possibly tutorial-style content.
Frequently Asked Questions
Why are you using a server.js stub in the root of the repository, rather than using `npm start` directly?
The method of passing parameters to an npm-start script with
-- is somewhat awkward (
npm start -- -n 1), and only introduced in npm 2. (Debian is still at 1.4, even with node 4.6).
Even after npm is upgraded in Debian, we might still want to use a server.js script in production. Currently, most nodes (except for Parsoid) don't even have npm installed, and it is not clear if we would want to change this. One point of view is that npm is a package manager that we don't use in production (deployed via git). We want control what processes get started and how. Another potential source of issues could be firejail.