Fork me on GitHub
#boot
<
2019-04-09
>
jeroenvandijk14:04:41

Any boot.pod experts here? I'm wondering what the overhead is of evaluating a script in a pod?

jeroenvandijk14:04:42

When starting a pod it takes 1 or 2 seconds. I'm guessing with a pod-pool this would be less. I didn't figure out how to call a pod from a pod-pool yet

jeroenvandijk14:04:36

I'm asking because i would like to see if boot.pods could be a viable backend for evaluating closh scripts (https://github.com/dundalek/closh/pull/123)

flyboarder15:04:50

@jeroenvandijk Im not sure you would gain anything by using a closh script, however if you are simply trying to evaluate clojure code, then pods are exactly what you want

flyboarder15:04:25

As you mentioned the overhead is a few seconds to start the pod, however you generally keep it running and then reuse it later

jeroenvandijk15:04:58

@flyboarder Thank you, sounds good. Do you happen to know about an example with a pod pool?

flyboarder15:04:34

Generally you shouldn’t need the pool unless you are destroying the pods repeatedly, boot pods are created from an internal pool anyway

jeroenvandijk15:04:00

So the idea is to have one off scripts (closh scripts) that need to be isolated from anything else to prevent conflicts. By using a warmed up pod the script would boot fast. After the execution you probably would want to kill the pod as the goal was to prevent conflicts. Does this make sense?

flyboarder15:04:50

@jeroenvandijk yes, but unless you run into problems a single pod should suffice for that use case, since you are really just trying to isolate the runtime from the boot project

flyboarder15:04:31

would running a script again within the same pod cause some kind of state conflict?

flyboarder15:04:56

even if it did, since the pods come from their own internal pool, you probably dont need to manage that yourself - I think this is an over optimization problem

jeroenvandijk16:04:55

@flyboarder At the moment it is all hypothetical, but I can imagine one script could (re)define a function and another script would use that version instead of it's own. So maybe it would be safe enough to assure different scripts don't use the same pod concurrently

jeroenvandijk16:04:52

Thanks for the feedback. I will need to experiment with it to see how it works

flyboarder16:04:38

@jeroenvandijk I think you are fine just to destroy the pod and create a new one each time the task runs, the internal pool will handle that for you already. If you have serious performance issues then managing your own pool would be the next thing to try

jeroenvandijk17:04:55

@flyboarder Thank you I'll give it a try