rave icon indicating copy to clipboard operation
rave copied to clipboard

Robot takes long time to initialize

Open bil-bas opened this issue 16 years ago • 4 comments

  • When a robot is first deployed, it takes about 30 seconds after the first request it receives to make any responses. I assume that the java appengine is loading jruby in this time? Presumably this doesn't occur with java or python bots?
  • When a robot is first used after not being used for an extended period (seen this happen with as little as 24 hours without requests), it also fails to respond for 30 seconds. I surmise that appengine is powering down if a robot isn't being used.

Although this might not be fixable, if we can't improve this, I think that appengine/jruby might be a bit of a non-starter compared to the native appengine solutions!

bil-bas avatar Dec 15 '09 13:12 bil-bas

Took the 0.2 label off of this issue - this is really an ongoing thing.

I did some super unscientific benchmarking, and found that it takes about 17 seconds to initialize a Rave robot, and it takes about 5 seconds to initialize a Java robot. I'm not sure if we can do anything about it - JRuby has a slow startup time. The JRuby team is constantly working on it, so hopefully it will get better from their end. I'm not sure what else we can do from our end, but I'll leave the issue open so it's always in the back of our minds... If anyone's got any ideas, I'm all ears...

diminish7 avatar Dec 30 '09 06:12 diminish7

Hmm, that certainly doesn't seem an unreasonable comparison of times, since JRuby is obviously forcing a massive amount of startup work compared to native Java. The problem is more about the time that a robot is not used after a period of time where any use for that first few seconds times out. Perhaps there is a way to at least prevent the timeout before JRuby can start up (so timeout for us after something like 30 seconds, rather than whatever the default is, say 10 or 15 seconds) would make all the difference for us. I haven't got a clue how the appengine system works, so wouldn't know if that sort of thing would be possible.

Thanks for taking a look at this nevertheless. Perhaps we should contact the JRuby people to see if they have any advice for such a situation. Must be affecting all of their projects just as much as ours...

bil-bas avatar Dec 30 '09 19:12 bil-bas

Yeah, I'll look into changing the timeout. Seems like it might be possible. The JRuby team is definitely aware of the slow startup times. It came up about 100 times at JRubyConf last month :) And they say they're working on it.

diminish7 avatar Dec 30 '09 21:12 diminish7

One thought on this is that we can hit their capabilities.xml from the appengine_deploy rake task. That will initialize the robot, so then when they actually invite it to a conversation for the first time, it will already be up and running. Not sure if that's a great idea, just something to consider...

diminish7 avatar Jan 31 '10 01:01 diminish7