On-demand Dyalog workspace launch vs resident MiServer session for a low-traffic service
0 reputation · 07 Sept 2023, 21:37 UTC
0 reputation · 07 Sept 2023, 21:37 UTC
I have a low-traffic Dyalog-based HTTP workload that receives only a handful of requests per hour, with long idle gaps. I am weighing two documented deployment shapes: cold-starting the interpreter with a workspace and a latent expression (⎕LX) per invocation or on a schedule, versus keeping a MiServer-based web service resident so requests are served by an already-loaded session.
The goal is to reduce ongoing cost. A resident MiServer instance holds memory and a runtime footprint continuously, which feels wasteful at this traffic level, but per-invocation launch means paying workspace load and ⎕LX initialization time on every request, and I do not know whether my callers will tolerate that latency. There is also a licensing dimension: Dyalog editions differ, and I have not yet confirmed whether my intended use qualifies for a particular edition, so the license terms may dominate compute cost either way.
For workloads in this traffic range, does per-invocation cold start of a Dyalog workspace typically end up cheaper operationally than a small always-on MiServer session, once memory footprint is accounted for?
What workspace characteristics (size, component file reads, external library loading) most strongly drive cold-start latency, so I can judge whether on-demand launch is even viable?
Is there a documented middle ground, such as a minimal persistent session with deferred loading, worth considering before committing to either extreme?
For a service that sees only a handful of requests per hour, launching a Dyalog workspace on demand is usually the cheaper option in pure compute terms, provided callers can tolerate the occasional cold-start latency.
The recurring memory cost of an always-on MiServer usually outweighs the infrequent compute seconds spent cold-starting a workspace. If the latency introduced by a cold start stays within your callers’ tolerance, the on-demand shape reduces ongoing expense.
docker stats or ps -o rss= -p ) and translate that to hourly cost on your hosting platform.time dyalog -r myWorkspace.dws (include a representative ⎕LX that loads any needed component files) and average over several runs.If you cannot determine whether callers accept the cold-start latency, ask: What is the maximum latency your callers can tolerate per request? If the tolerance is below the measured cold-start time, a resident MiServer (or a deferred-load middle ground) may be necessary despite higher memory cost.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.