Lifespan of Launchpad-Launched Exterrnal Runtime Processes
-
09-10-2020 - |
Question
When SQL Server uses SQL Launchpad to launch an external runtime (e.g. R or Python) when sp_execute_external_script
is used, what's the lifespan of the external runtime process?
Does each sp_execute_external_script
script execution get its own external process instance or does the external process stay around until it's been inactive for a certain amount of time (e.g. the existing process might be reused if I execute another script written in the same language using the same SQL session)?
Solution
For security reasons, Python processes are not reused. Each call to sp_execute_external_script
uses its own process instance(s), at least as far as Python goes.
Since Microsoft SQL Server's Python and R integrations are very similar, I'd suspect the same holds true with R, as well, but I can't say that with 100% certainty.
Reference: reddit comment made by SQL Server engineering team program manager Tobias Ternström