On Thu, Aug 27, 2009 at 9:12 PM, Jaap Taal <[email protected]> wrote: > Hi Nick, > > You say: "The same Python runtime environment can be used by multiple > handlers - in which case they will share the same loaded modules." > Is this always the case? Or do you need to programmatically do this? If so, > how do you achieve that?
It happens automatically. The runtime pays no attention to whether an app has multiple entry points or only one. -Nick Johnson > > > Jaap > > > > On Thu, Aug 27, 2009 at 1:47 PM, Nick Johnson (Google) < > [email protected]> wrote: > >> On Wed, Aug 26, 2009 at 6:39 PM, Andy Freeman <[email protected]>wrote: >> >>> >>> Is there any reason to prefer multiple app.yaml entries over few? >>> >>> That is, one can match /pages/.*, /users/.*, /tasks/.*, /foo/.*, etc >>> with separate app.yaml entries, followed by a catch-all app.yaml >>> entry, each with its own handler file, each file with its own wsgi >>> application, or with a single app.yaml entry (/.*) and a handler file >>> with a wsgi application that has a clause for each of those cases. >>> (Assume that each handler file defines main() so it will be cached.) >>> >>> Is there any difference between these two approachs wrt reuse or other >>> implementation issues? >> >> >> If your handlers are mostly distinct - that is, they have large codebases >> that they don't share in common with each other - using separate app.yaml >> handlers can reduce initial startup time by only loading the modules the >> particular request handler requires. >> >> If, like most apps, your handlers need to load most of the app in order to >> serve a request, however, this effect is minimal. >> >> >>> >>> For example, if an instance is created for one handler, will it be >>> used for another? (The documentation says that handler files can be >>> cached like any other module, but doesn't say how that interacts with >>> instance reuse.) >> >> >> The same Python runtime environment can be used by multiple handlers - in >> which case they will share the same loaded modules. >> >> -Nick Johnson >> >> >>> >>> Thanks, >>> -andy >>> >>> On Aug 26, 4:31 am, "Nick Johnson (Google)" <[email protected]> >>> wrote: >>> > Hi PubliusX, >>> > >>> > On Tue, Aug 25, 2009 at 8:38 PM, PubliusX <[email protected]> >>> wrote: >>> > >>> > > Hey, thanks.. but I figured out the problem. Apparently if there are >>> > > too many requesthandlers (referenced in the handler script), then >>> > > appengine doesn't cache the handler script.. At least thats what I >>> > > think.. because I reduced the number by removing an arbitrary 5-6 >>> > > classes and its back to the old time. >>> > >>> > That's definitely not the case. App Engine doesn't even know how many >>> > RequestHandlers you're using, or even check what framework you're >>> using. You >>> > were probably just getting a new instance on each request. >>> > >>> > -Nick Johnson >>> > >>> > >>> > >>> > -- >>> > Nick Johnson, Developer Programs Engineer, App Engine >>> >>> >>> >> >> >> -- >> Nick Johnson, Developer Programs Engineer, App Engine >> >> >> > > > > -- Nick Johnson, Developer Programs Engineer, App Engine --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
