Thank You Nick for comprehensive answer. Using VMs I exclude, because of inadequate billing conditions, for such machine simple task as is keeping database connection. Also Beta state of VMs and placing only in US is not suitable.
Using coroutine was experiment if code in it can satisfy GAE rules. It is function, but only on development server. I also tried downgrade PyMongo driver. Here are thle list: http://api.mongodb.org/python/ and changelog http://api.mongodb.org/python/3.1/changelog.html More then 10 versions from 2.2 to 3.0.3 I examine. Version 2.9 contain depricated method pymongo.Connection() which is without threads. Version 2.8.1 also can comunicate with MongoDB >3 and use new authetication mechanism SCRAM-SHA-1. But every versions under 3.0 had some issues. I was testing txmongo and also another drivers mentioned here https://docs.mongodb.org/ecosystem/drivers/python/ and here http://api.mongodb.org/python/current/tools.html?&_ga=1.24363322.1221236293.1446832866#alternative-drivers I was also testing gevent with greenlets as replacement for Threads. Here is nice solution, 2 line code http://api.mongodb.org/python/current/examples/gevent.html but unfortunately I don´t find how use that patch on production server. And I don´t know if greenlets will be non-blocking on GAE. Nick, You don't mention backend module. I can run backend module with open connection, but I don't know, how to deliver handler to frontend. Is the Multitenancy ( https://cloud.google.com/appengine/docs/python/multitenancy/multitenancy ) and shared namespaces the way how to do in frontend something like: DBCONN = backend_process_give_me("DBCONN") ? Or even backend module even with background threads cannot be used for holding open connection? Really, really? https://cloud.google.com/appengine/docs/python/backends/#background_threads Here is writen: Code running on a backend can start a background thread, a thread that can "outlive" the request that spawns it. And what about Pulled Task Queue which can live after request. Can task hold open connection and give it to back to frontend? Can one task, on the end of it life, create a new one task and pass open connection to the new one task? It is possible to transfer handler of open connection from task to frontend? Expect, that exist many solutions, also in GAE, how to keep open MongoDB connection, because it is nonsense to open connection in every request. How this task solve the others? All of them use VMs? Do they hack Pymongo? Where I can find their patch? They are using another driver? Which one? Hope I'am not the only one in such situation. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/258ae6b6-a369-4a2d-83e5-dc22bc134607%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
