I'm considering using JRuby on App Engine but have heard that Juby app on App Engine have a long startup lag versus a Python app. Why is this?
Is it because the JRuby jar files are so large that a cold startup requires them to be loaded into memory before the app can start serving? That would be my guess but I'm not sure if that's a precise technical explanation. And, if so, why is Python different?
That's basically it. When your app hasn't been used in a while, App Engine swaps it out until another request comes in.
When that happens, it loads all the JARs your app requires, which may take a very long time, upwards of 10-15+ seconds in some cases.
I don't have any experience with JRuby in particular, but this page has some tips on how to reduce your app's cold start time. The tips should be useful even if you're not strictly writing vanilla Java.
Basically, just don't include any JARs that your app doesn't rely heavily upon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With