[google-appengine] Re: How to store open connection to external MongoDB

2016-06-30 Thread 'Nick (Cloud Platform Support)' via Google App Engine
Hey Prasanga, I'm unsure what you meant by your last post. Do you think you could clarify in more precise language what behaviour you're referring to? Do you mean the fact that "Sockets may be reclaimed after 2 minutes of inactivity; any socket operation keeps the socket alive for a further 2

[google-appengine] Re: How to store open connection to external MongoDB

2016-06-28 Thread Prasanga Siripala
I believe to keep the connection alive, SOCKET API requires a new request. Therefore after the request is finished, you can't reuse connection. On Wednesday, November 4, 2015 at 6:39:17 PM UTC+11, Minie Takalova wrote: > > Hello > > I'am trying to build application on GAE which use MongoDB

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-07 Thread tetsujin1979
If you're using MongoLab as a backend, is using the API an option - http://docs.mongolab.com/data-api/ I've used this with Java apps on GAE without any problems On Wednesday, 4 November 2015 07:39:17 UTC, Minie Takalova wrote: > > Hello > > I'am trying to build application on GAE which use

Re: [google-appengine] Re: How to store open connection to external MongoDB

2015-11-07 Thread Jeff Schnitzer
On Fri, Nov 6, 2015 at 10:52 AM, Minie Takalova wrote: > Hope I'am not the only one in such situation. > You appear to have some conceptual misunderstandings of how computers work. Or possibly there is a language/miscommunication issue: * A socket is not a thread and a

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-07 Thread Minie Takalova
RE. *Jeff Schnitzer*: I like your pragmatic open-eye mindset. You are right, I have some conceptual misunderstandings of GAE environment. Probably because I’m old school dinosaur programming since 1986, I have another side of view. In my "world" open socket connections can be handled between

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-06 Thread Minie Takalova
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

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-06 Thread Nick (Cloud Platform Support)
Hey Minie, As Jeff Schnitzer has pointed out, the issue stems from the fact that the PyMongo driver is wanting to use threads (via thread.open() ) to manage the connection pool. The thread opened in

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-05 Thread timh
This just won't work on a front end request. Any thread you create will be destroyed at the end of the request. The appengine front end is not designed for this type of capabiltiy. You could consider running your mongo interface on a managed vm, and then use some sort of simple rpc mechanism

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-05 Thread Minie Takalova
Hi Re. timh: OK, I understand that keep open connection which is based on threads, in frontend is prohibited. So, what is the easiest and clearest way how to solve it? What I tried: * convinced PyMongo to work without threads. Tried many parameters (from here

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-05 Thread Minie Takalova
Can be used, *Task Queue *as separate, non request dependent, process for storing open database connection? https://cloud.google.com/appengine/docs/python/taskqueue/ Cite:... *With the Task Queue API, applications can perform work outside of a user request, initiated by a user request. If an

Re: [google-appengine] Re: How to store open connection to external MongoDB

2015-11-05 Thread Jeff Schnitzer
Due to the nature of classic google app engine, you can't leave threads running. This doesn't mean you can't have sockets open between requests, but the MongoDB driver wants to use threads to manage those sockets for you and that's a no-no. This leaves you pretty much two choices if you want to

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-05 Thread Minie Takalova
Re. Jeff Schnitzer: Thank you for advice. Also it mean, that without Managed VMs or hacking DB driver is no way how to keep open connection between requests? Not GAE Backend process, not Task Queue, not Backend Threads, not Multitenancy, not Non-Blocking Sockets can be used ? -- You

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-04 Thread Minie Takalova
Thank you for your responses. Re. Jeff Schnitze: Nice mind-shift to change behaviour of driver. This way solution doesn't occured me. On the other side it is sad. Instead of 5 lines code to rebuild driver. I keep this solution as last chance if I find nothing easier. Maybe it eventually

[google-appengine] Re: How to store open connection to external MongoDB

2015-11-04 Thread Nick (Cloud Platform Support)
Speaking at a high level, I don't see any reason why a background thread holding a persistent connection object in memory shouldn't work. In fact, I'm a little curious why the globals lookup is failing you with a timeout at all - it doesn't seem clear how or why this would happen. What kind of