I'm currently using an svg conversion library which wraps puppeteer:
https://github.com/etienne-martin/svg-to-img
After each call to its convert function it waits 500 ms and if there aren't any other calls then it closes the browser instance and on the subsequent call it will again call puppeteer.launch.
I'm using this inside of a docker container running in a Kubernetes cluster. I'm wondering how expensive it is to continually call puppeteer.launch versus connecting to an already running instance of headless chrome.
I'm considering instead just always having a docker container running an instance of headless chrome and connect to it from my docker container doing the svg conversion.
Before doing this though I wanted to get a sense of what is going on behind on the scenes of launch vs connect.