From 09750ce3525129a676dec4f579aea3ad2eca1b19 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 9 Jan 2023 11:09:14 +0000 Subject: Add instances implementation (still needs testing) Signed-off-by: Laurent Bercot --- doc/instances.html | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 doc/instances.html (limited to 'doc/instances.html') diff --git a/doc/instances.html b/doc/instances.html new file mode 100644 index 0000000..0586fdb --- /dev/null +++ b/doc/instances.html @@ -0,0 +1,121 @@ + + + + + + s6: dynamic instantiation + + + + + + +

+s6
+Software
+skarnet.org +

+ +

Dynamic instantiation under s6

+ +

+ A instanced service is a parameterized service that you want to +run several copies of, with only the parameter changing. Each copy of the +service is called an instance. +

+ +

+ With s6, a service directory can only +handle one process at a time. So, if we want instanced services, there +will have to be one service directory per instance, always. +

+ +

+ Static instantiation means that the set of possible instances +is finite and known in advance. With s6, it means that all the service +directories for all possible instances are created, typically by a +preprocessor, and instances are treated like regular services. +

+ +

+ Dynamic instantiation means that instances are created +on demand instead of preallocated. Starting with version 2.11.2.0, s6 +provides a few tools to help users set up and manage dynamically +instanced services. +

+ +

How to make a dynamically instanced service under s6

+ + + +

Internal workings

+ +

+This section is not normative; users should not rely on it. It is only +here for informational purposes. +

+ + + +

Notes

+ +
    +
  • This implementation of dynamic instances may seem expensive: it +creates one s6-svscan process per +instanced service, and one s6-supervise +process per instance. However, remember that these processes use very +little private memory, so having additional copies of them is far less +expensive than it looks. It's really a convenient way to implement the +feature by reusing existing code.
  • +
+ + + -- cgit v1.2.3