Hey Tim, That will (probably) just stop your module being cached, making it respond more slowly to requests, increasing the number of instances needed to service concurrent requests. I think you're still better off to try to make instance startup and request servicing as efficient as possible.
An API to request instance death is a potentially interesting idea though. Robert On Fri, May 13, 2011 at 09:28, Tim <meer...@gmail.com> wrote: > > Currently all my python scripts use the script-or-module mechanism as > recommended by the docs > > application = webapp.WSGIApplication([('/somepage', > SomeHandler), ('/anotherpage', AnotherHandler)], debug=True) > # GAE will look for a main() with no args and, if found, caches this script > # so we supply one to make the requests more efficient > def main(): > run_wsgi_app(application) > # How a file can be both a script and an imprtable module... > if __name__ == "__main__": > main() > > I'm wondering if I rename that function to not be "main", hence making the > page just a script and no longer an importable module, will that effectively > kill the instance after the script runs (my load time is minimal - most of > my pages simply do datatore-query -> JSON or the reverse) and so minimise my > instance hours ?? > Would it be possible to add something to the GAE API's so that an instance > can suggest how long it would like to hang around for, or an ability to > explicitly request to kill itself ? > -- > T > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appengine@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.