Comments (7)
See inline
On Nov 26, 2013, at 12:59 PM, Benjamin Ooghe-Tabanou [email protected] wrote:
Hi,
I'm using txmongo in an environment with a lot of running parallel tasks (twitter and rss collection mostly) and was wondering which best practice would be recommended to use txmongo :
• sometimes my connexion just seem to hang, how do I check whether it's still up?
Hard to say. I had similar problems back in 2009-2010 when I gave up using MongoDB.
• if I want to briefly open a new connexion before closing it again, should I close my conenxion afterwards? How? (conn[db].Database_factory.doStop() seems to do the trick but does it really?)
You can open as many new connections as you need without closing existing ones. To terminate a connection (or pool) there's the disconnect()
method.
• which one of the lazyMongoConnexionPool or MongoConnectionPool should I use? Looking at the code I'm not sure to get the difference here
MongoConnectionPool()
blocks until the connection is established. If your script is a batch type of thing it's safe to use it because you don't want to execute any operations before the connection is made.
The lazy
and friends return the handler immediately and are suitable for having persistent connections to Mongo within web servers and daemons in general. Basically, you don't want to wait for the connection to be established during the program startup and expect it to do so in background.
—
Reply to this email directly or view it on GitHub.
from txmongo.
Thanks a lot, I understand better the Lazy part now. I saw the other issue regarding Auth with Lazy and Pools though and since I'm using auth it looks like I'm limited to the classic connexion.
Tryouts showed that the amount of opened connections is likely to cause the hangs after some time, so I will try and make a wrapper for single connections that would be closed right after. I will keep this issue updated in case it can help others.
If I understand correctly you're not using mongodb anymore and therefore don't maintain this lib anymore, would you by any chance know of any more maintained fork?
from txmongo.
I still don't understand why you want to close the connection and reconnecting later. And yes, I'm no longer using mongo and thus not actively maintaining this lib for about 2-3 years.
On Nov 27, 2013, at 10:08 AM, Benjamin Ooghe-Tabanou [email protected] wrote:
Thanks a lot, I understand better the Lazy part now. I saw the other issue regarding Auth with Lazy and Pools though and since I'm using auth it looks like I'm limited to the classic connexion.
Tryouts showed that the amount of opened connections is likely to cause the hangs after some time, so I will try and make a wrapper for single connections that would be closed right after. I will keep this issue updated in case it can help others.
If I understand correctly you're not using mongodb anymore and therefore don't maintain this lib anymore, would you by any chance know of any more maintained fork?—
Reply to this email directly or view it on GitHub.
from txmongo.
This is the fork that I have been using: https://github.com/chergert/txmongo. I have been contributing here and there, and might be able to help with some issues.
from txmongo.
And thanks @fiorix for getting it all started ;)
from txmongo.
My pleasure. I really enjoyed working on it back in the days.
On Nov 27, 2013, at 11:07 AM, Trenton Broughton [email protected] wrote:
And thanks @fiorix for getting it all started ;)
—
Reply to this email directly or view it on GitHub.
from txmongo.
@fiorix: Since I'm using Auth I apparently have no choice but to use the regular connexion instead of a pool. Which means I need to open multiple ones if I want multiple db operations to happen simultaneously, which means I need to make sure I'm not opening too many and therefore need to close some of them. And in any case the closing of my daemon should use the disconnect at least for clean exit.
@trenton42: Great thanks, I'll take a look at the commits history to see what you improved. Any chance you worked on the auth issue with the other connexion types maybe?
from txmongo.
Related Issues (20)
- In disconnect: RuntimeError: dictionary changed size during iteration HOT 2
- When txmongo fails to connect mongodb, there is a memory leak HOT 8
- latest txmongo does not work with pymongo 3.7 HOT 3
- do not connect to mongodb+srv:// scheme HOT 1
- Does txmongo support compressors option? HOT 1
- builtins.AttributeError: '_CaseInsensitiveDictionary' object has no attribute 'copy' HOT 3
- Crash create_index: pymongo.errors.OperationFailure: cannot write to 'remains.system.indexes' HOT 2
- AssertionError: Tried to stop a LoopingCall that was not running. HOT 3
- txmongo not working with azure cosmos db HOT 19
- There should be a limit on the number of retries HOT 1
- insert_many does not work properly HOT 6
- maxIdleTimeMS support HOT 4
- does txmongo support transaction? HOT 2
- Proposing a PR to fix a few small typos HOT 1
- insert_many: unexpected keyword argument 'bypass_document_validation' in calling pymongo `_Bulk` HOT 2
- Import error with PyMongo==4.1.1. HOT 3
- Incompatible with mongodb >= 5.1 due to usage of deprecated `OP_QUERY` commands HOT 2
- txmongo with DocumentDB
- Incompatible with any version of DocumentDB HOT 3
- pymongo.errors.OperationFailure: TxMongo: not authorized for query on foo.test HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from txmongo.