InstanceSpawn: Launch and maintain a group of server app instances

InstanceSpawn: An Instance Spawn Engine for stand-alone server apps

A library to launch and maintain a group of command line argument-configured server instances

  • Define command line arguments for each individual instance.
  • Typically, assign each server instance a different listen port.
  • Simultaneously launch the collection of instances as child processes.
  • Set automatic restarts of instances that terminate (crash?)
  • Get notified if an instance is down (run out of auto-restarts)
  • Get notified if all instances terminated.
  • Forcefully Terminate all instances.

A harness application to demonstrate use of InstanceSpawn

  • A GUI application, built and tested on Windows 10 and Linux Debian 12.
  • Source code is the simple tutorial to integrate InstanceSpawn to your solution.
  • Tested with DummyWebApp

Ideas for solutions based on InstanceSpawn

  • Service app that reads a configuration file and spawns server instances at system startup.
  • Mechanism inside each server instance that monitors its own memory usage and auto-terminates instance when above a threshold, knowing that InstanceSpawn will launch a new instance.

6 Likes

xojo web apps (exe) are usually registered as windows service.
does this instancespawn behind scene?

As it stands, no, it’s a GUI app.
The idea is to use the InstanceSpawn library (that the GUI app demonstrates how to use) to make a service app, then register it as a single windows service, and have it spawn 10 server instances (you’d otherwise need to register one by one as a service).
Then have your reverse proxy (nginx, caddy) load-balance across these 10 instances.

That’s the general outline.

2 Likes