sp_execute_external_script can take a while to initialize when not run for a short time. How do I set the idle time on the controller Launchpad process to keep it from shutting down too soon?

Note I am not talking about reusing the same Python session as I know each call uses its own session. What I am referring to is that when you execute sp_execute_external_script for a language it takes a while to start up. If you call sp_execute_external_script again in a short time then it runs immediately. However, if you wait a while and execute it again it takes a while to execute as (I think) the Launchpad controller has reached an idle time and shutdown. See this article about SQL Server using the Launchpad process to created links to Python, R, and soon Java.

Is there a way to increase this idle time?

  • Would love to know this for running R scripts too - they have exactly the same issue here (about ~20 seconds to launch Launchpad when idle, 0 seconds afterwards) - but I've never been able to get anywhere with the problem sadly – Jerb Sep 12 '19 at 13:31
  • I dont think there is a way to increase the idle time. A dirty trick will be to use sp_execute_external_script call a dummy select 1 from Table possibly scheduled using sql agent job or some windows task scheduler every x seconds. – Kin Shah Sep 12 '19 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.