On Thu, Oct 15, 2009 at 3:53 PM, Matt Feifarek <matt.feifa...@gmail.com> wrote: >> It takes a long time (from 5 to 10 sec) to serve the first request if >> the instance is not hot. >> Is some body else experiencing this the problem? > > Yeah, I noticed that too. I can't explain it, but if you Google for it, > you'll see others complaining. My guess is that the AppEngine infrastructure > clears your app out of The Memory of The Google when it hasn't been used. > Once it's used, it comes up instantly (the second time). > > I've noticed this also if I come back in a few hours (nobody else has hit my > testing app, so I bet it gets garbage collected). Not sure what we can do > about it. Perhaps if it's running some long-running tasks? > > I have to admit, as much as the high-availability of GAE is attractive, if > hits are going to take 10s to come back, that's a pretty big negative.
The only way to really fix this is to make the startup time of the app faster. I'm a little surprised with 10s, though if it was down to 3-5 seconds I probably would decide to not care, since the warmup is going to be a small percentage of requests (especially the requests people care about). Other warmup costs can be substantial too, like getting all the Javascript and CSS cached on the user's browser. Imports are probably slower on GAE because it doesn't use .pyc files. (Though why not, I'm not sure -- it should be able to generate its own .pyc files that it can trust on app upload.) Depending on your code layout, searching for packages might be slow (.egg directories will slow it down). I'm not sure if .egg directories will be significant, but they could be. Lazy importing will help, especially if some modules won't need to be loaded for the life of the process. Lazy loading alone might actually just spread the latency over multiple requests, perhaps leading to a worse speed perception than a single initial hit. -- Ian Bicking | http://blog.ianbicking.org | http://topplabs.org/civichacker --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---