PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 27th of August, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:07:50] <Aleross> Afternoon!
[00:08:33] <ryanair> is there any way to control the output format of mapreduce?
[00:09:31] <ryanair> for example, all of the documents that I see are formatted like this {"_id": 1, "values":{...}}
[00:10:40] <ryanair> why can't I have {"_id":1, "value1": ..., "value2": ..., "value3": ..., ...} in the output from a mapreduce job?
[00:13:45] <ryanair> thanks jmikola, btw, for posting that link earlier
[00:21:31] <Aleross> ryanair:
[00:21:58] <Aleross> not really sure the validity of this because I haven't used Mongo's map reduce myself, but have you looked into the finalize function?
[00:22:14] <Aleross> not sure when you're trying to access the output either
[00:22:32] <Aleross> but finalize is called on the last reduce's output before it's saved to a temporary collection
[00:22:52] <Aleross> good place to manipulate the output
[00:27:52] <jtomasrl> is it possible to restrict the params allowed by a collection?
[00:35:19] <vsmatck> I don't know what "params allowed by a collection" means.
[00:39:46] <Aleross> as in enforce a schema
[00:40:26] <Aleross> jtomasrl: not sure if you can do it on the MongoDB level… doubt it, kind of goes against the whole idea of it, but you could (and should) do it at an application-level if necessary
[00:40:36] <Aleross> that is, if I'm interpreting "params" correctly
[00:42:47] <jtomasrl> Aleross, thats what i need to know, ty
[00:43:51] <Aleross> jtomasrl: np! gl
[00:44:53] <jtomasrl> so if i see a collection like a { key: value } i cant get all the keys?
[00:46:09] <Aleross> jtomasrl: you'd have to use map reduce I believe
[00:46:16] <Aleross> there's no easy way to get all the keys
[00:46:36] <Aleross> I think that's a pretty common requirement though, somebody else may want to chime in about how they do it
[00:48:52] <jtomasrl> ok ill google about it
[00:59:04] <ryanair> Aleross, I'm talking about *after* reduce's output is saved. I'm seeing documents formatted like this {"_id": 1, "values":{...}} when what I want is this: {"_id":1, "value1": ..., "value2": ..., "value3": ..., ...}. It doesn't seem like finalize would help me do this.
[01:07:15] <Aleross> ryanair: my understanding is that you can do basically anything with finalize, so what I would do is *before* saving the temporary collection just run finalize and break value1, value2, and value3 out of "values", creating a new collection that will ultimately be saved in the format you want
[01:07:39] <Aleross> ryanair: there's no point in saving it as _id:, values: if that's not what you want… might as well manipulate it before saving
[02:34:57] <emocakes> ok, so im dropping one step back in my yearning for new things, still gonna use mongo, but coupling it with something I know, node
[02:35:08] <emocakes> play framework is just wtf messy
[05:49:22] <gigo1980> hi all, how is it posible to deactivate sharding for one database ?
[05:51:27] <gigo1980> so the reversal of db.adminCommand({enablesharding:"mydatabase"})
[06:44:35] <zykes-> can one do master-master repl with mongo ?
[07:37:00] <[AD]Turbo> hi there
[07:48:19] <emocakes> hai [AD]Turbo
[08:12:55] <firejocker> hi all,
[08:14:37] <firejocker> i'm starting using django-mongo, but following the run of a User.objects.get(username=username), i saw that all database values are in QuerySet of query.py
[08:16:03] <firejocker> am i right to think there is a problem there, i mean, to see all the users in memory is bad for performancties
[08:21:13] <IAD> firejocker: find where 1=1 ?
[08:26:31] <firejocker> IAD nop, i mean, to select one user, i can see all in self.QuerySelf of django/model/sql/query
[08:26:47] <firejocker> found it quite strange
[08:37:17] <mdupont> hi there, i have some app using the mongohq server, is there an api compatible server i can install? the rest api?
[09:24:05] <topriddy> hi good people
[09:25:44] <topriddy> trying to find previous version of mongo on my cent os server, delete it and do a fresh reinstall from some other repos=> 10gen
[09:57:47] <zeus_> hey, i've build cluster with 9 machines. At first i got 12000 ins/sec now its down to 400 ins/sec - what happend ? Whole indexes fit into RAM, its sharded properly.
[10:03:11] <zeus_> here is a part of my mongostat log http://pastie.org/4596421
[10:11:21] <zeus_> I have no idea what to do next, please help
[10:16:50] <Bartzy> Hi
[10:16:58] <Bartzy> Besides cursor timeout - there are no other timeouts for a connection in itself ? For example, I have a long running PHP worker. It creates a MongoCollection object when it starts, and when it gets a job - it calls update() on that MongoCollection object.
[10:17:09] <Bartzy> Can that MongoCollection object time out ? meaning the connection itself will timeout ? And if it can - the drivers handle it internally, or I need to do something ?
[10:34:59] <Bartzy> Anyone....?
[10:37:27] <NodeX> why would you hold a PHP connection open dude?
[10:37:37] <NodeX> that's such a waste of ram and CPU
[10:39:34] <emocakes> lol
[10:39:38] <emocakes> thats php :D
[10:41:15] <NodeX> has nothing to do with the language, it's bad programming practice
[10:41:20] <NodeX> this is what message queues are for
[10:42:48] <Bartzy> NodeX: It's a long-running worker
[10:43:39] <NodeX> and?
[10:43:41] <Bartzy> NodeX: Instead of each worker disconnecting and connecting on every job, I want to save the connection
[10:43:48] <Bartzy> so the same connection will be used
[10:43:54] <NodeX> let the driver take care of that for you
[10:43:59] <NodeX> it's in the connection pools
[10:44:03] <Bartzy> It's PHP CLI
[10:44:05] <NodeX> (read the driver docs)
[10:44:07] <Bartzy> There are no connection pools for that
[10:44:13] <Bartzy> Since there is no shared memory between them
[10:44:18] <NodeX> read the driver docs
[10:46:48] <Bartzy> NodeX: So on each job the workers get - they should do a $mongo = new Mongo... ?
[10:47:02] <Bartzy> And let the driver handle the rest with its pool ?
[10:47:06] <Bartzy> (I read the docs)
[10:47:15] <emocakes> which brand of computer is best for mongodb? I like HP but people have told me that Gateway works better
[10:47:25] <NodeX> "The new framework no longer has the concept of a connection
[10:47:25] <NodeX> pool, but instead make sure there is only one connect per
[10:47:25] <NodeX> host/port/db/username combination. "
[10:47:32] <NodeX> oops - one line
[10:47:39] <Bartzy> Where do you see that ?
[10:47:46] <NodeX> https://groups.google.com/forum/?fromgroups=#!topic/mongodb-announce/bcehXiVfQpE <----
[10:47:54] <Bartzy> ah, I was looking at the php docs
[10:48:05] <kali> emocakes: oO
[10:48:40] <Bartzy> NodeX: What does that mean? How can there be only 1 connect per that combination ? What about multiple processes ?
[10:48:49] <NodeX> ask Derick
[10:48:57] <Bartzy> Derick: ! Are you here? :)
[10:49:05] <Bartzy> Daniel also told me to nag you :)
[10:49:09] <NodeX> he'll be able to explain it better
[10:49:24] <Bartzy> Thanks NodeX, I'll wait for him.
[10:49:37] <NodeX> :)
[10:49:38] <emocakes> kali?
[10:50:21] <Bartzy> NodeX: But for the current one (not the new 1.3 version) - If I do $mongo = new Mongo(..) on each job the workers get - that would not create a connection for each job ?
[10:53:13] <NodeX> yes, but you can persist thm
[10:53:15] <NodeX> them *
[10:53:32] <NodeX> you can make them use an old or share a connection
[10:55:30] <NodeX> http://us2.php.net/manual/en/mongo.connecting.php <--- read down on connection pooling
[10:56:06] <NodeX> "This section is not relevant for 1.2.0+. In 1.2.0+, connections are always persistent and managed automatically by the driver. See MongoPool for more information on pooling. "
[11:00:12] <kali> emocakes: mongodb does not give a damn who integrated the hardware
[11:00:29] <emocakes> ok, so I can use my HP?
[11:01:02] <kali> as long as it's a PC
[11:01:56] <emocakes> can i use a mac?
[11:01:56] <Bartzy> NodeX: OK - so why not just keep $mongo in the __construct of the worker ?
[11:02:01] <Bartzy> NodeX: So it's always there?
[11:02:04] <emocakes> also kali
[11:02:04] <Bartzy> For that little memory usage ?
[11:02:10] <emocakes> for scala, do you use a web framework?
[11:02:12] <Bartzy> The memory is used anyway by the connection in the pool
[11:02:18] <emocakes> if yes, which? play or lift or <blank>
[11:03:23] <emocakes> kali, ignore my pc / mac questions
[11:03:23] <NodeX> because it's holding a resource it doesn't need to
[11:03:34] <kali> emocakes: i actually use scala and unfiltered as a http framework, but just for webservice-like endpoints
[11:03:41] <NodeX> Bartzy : if you think you're right then do it your way ;)
[11:03:55] <emocakes> ok, so not for anything heavier kali
[11:04:13] <kali> emocakes: i use it to bypass a rails stack that is too slow and resource greedy for the most critical endpoints of our app
[11:04:14] <emocakes> i.e: like a corporate application?
[11:04:18] <emocakes> ok
[11:04:19] <emocakes> :)
[11:04:32] <emocakes> mmm, rails, im growing tired of php
[11:04:45] <emocakes> i looked at scala, played with Play!, the documentation really sucks
[11:05:15] <kali> emocakes: rails is great for smallish apps
[11:05:30] <NodeX> not much performance difference from what I've read
[11:05:35] <NodeX> (rails and php)
[11:05:36] <kali> emocakes: smallish in size, and smallish in trafic
[11:05:47] <emocakes> well the project I want to apply this too NodeX is an online text based rpg
[11:06:00] <emocakes> i currently have some code written in php and using postgres
[11:06:07] <emocakes> but I already know that and it's too easy
[11:06:16] <emocakes> hence me being in #mongodb
[11:06:33] <NodeX> oh right, I forgot that making fast efficient code -had- to be difficult LOL
[11:06:35] <emocakes> im thinking of node.js
[11:07:45] <NodeX> languages are not mutualy exclusive
[11:08:15] <emocakes> what do you mean NodeX?
[11:08:25] <emocakes> i'm not thinking node.js because mongodb is json :p
[11:08:33] <NodeX> you dont -have- to write an App in just one language
[11:08:42] <emocakes> oh, that
[11:08:44] <emocakes> well true
[11:08:57] <NodeX> I use Node + PHP + others in most of my apps
[11:09:22] <emocakes> well the company im currently working for is rather stock standard (read boring stack)
[11:09:28] <emocakes> as in its php, and a rbdms
[11:09:36] <NodeX> :/
[11:09:37] <emocakes> i make an extension for it
[11:09:46] <emocakes> and omfg, if only I could have used mongo
[11:09:56] <emocakes> its a permissions system
[11:10:12] <emocakes> and mongo would have fitted(?) like a glove
[11:10:16] <emocakes> fitted or fat
[11:10:22] <kali> emocakes: i think it's not a good idea to use node.js as your main framework, but rather as a way to handle endpoints with special features, like comet like features, or file upload, etc
[11:10:25] <emocakes> i dont want to say fat as i might offend some people
[11:11:19] <NodeX> +1 kali
[11:11:23] <NodeX> ;)
[11:11:40] <emocakes> yah
[11:12:23] <emocakes> i agree with that, i just need to decide on the core part :p
[11:12:44] <emocakes> i could use cakephp like i've been using
[11:12:57] <emocakes> but i think its kinda heavy
[11:13:03] <emocakes> and doesnt support namespacing
[11:13:26] <kali> same way we use scala and unfiltered here, actualy. if rails + cache is enough, then fine. if the endpoint is not cacheable and performance critical -> scala.
[11:13:57] <emocakes> this is how I feel
[11:13:58] <emocakes> http://i.imgur.com/XHQ8B.jpg
[11:14:06] <emocakes> whenever i look for somethign new to try
[11:14:36] <NodeX> there is nothing wrong with normal php, just avoid bloated frameworks - they are what drag the performance to a crawl
[11:14:45] <emocakes> would you ever build something fully with scala kali?
[11:15:14] <emocakes> which frameworks do you use NodeX? (if applicable)
[11:15:21] <emocakes> i was looking at lithium and fule
[11:15:22] <emocakes> *fuel
[11:15:31] <NodeX> none
[11:15:40] <NodeX> I avoid them like the plague
[11:15:42] <emocakes> do you have an ORM?
[11:15:43] <emocakes> :\
[11:15:47] <emocakes> erm
[11:15:49] <emocakes> lol
[11:15:50] <emocakes> sorry
[11:15:53] <emocakes> im in mongodb
[11:15:53] <kali> emocakes: I think I could give Play! a try.
[11:15:56] <emocakes> haha
[11:15:59] <kali> emocakes: but cautiously
[11:16:12] <emocakes> kali, play seems nice, but its lacking documentation seriously
[11:16:17] <emocakes> or im just not finding it
[11:16:28] <emocakes> i mean you come from this level of doc's
[11:16:28] <emocakes> book.cakephp.org/2.0/en/
[11:16:31] <kali> emocakes: yeah, I am aware of than
[11:16:33] <kali> that
[11:16:36] <emocakes> to the play docs, which are just api and its wtf
[11:17:24] <kali> emocakes: but it's not a showstopper as far as I'm concerned. just something to think about
[11:20:00] <emocakes> i'll stick with it for now
[11:20:09] <emocakes> hey, at least i'll be learning something
[11:20:10] <emocakes> :p
[11:20:23] <emocakes> what got me into all this wanting change
[11:20:35] <emocakes> is looking at go-wan webserver
[11:20:38] <emocakes> *g-wan
[11:20:53] <emocakes> the guy behind it was blasting everyone for not writing web apps in ANSI-C
[11:21:04] <emocakes> and now its made me feel small and worthless
[11:21:13] <emocakes> because I can't write apps in C
[11:21:16] <emocakes> *web
[11:23:04] <NodeX> very fast webserver
[11:23:49] <NodeX> not sure about the benchmarks... I know for a fact lighty is not faster than nginx
[11:24:50] <emocakes> lighttpd is slow, at least last time i used it
[11:29:17] <algernon> go-wan is silly.
[11:29:25] <algernon> or g-wan or w/e it is.
[11:29:49] <emocakes> yah I got that feeling as well algernon after a night of reading the forums etc
[11:30:00] <emocakes> like, wow, its amazing, but wheres the code?
[11:30:12] <emocakes> and pierre seems like an arrogant pierre
[11:30:20] <kali> yeah, sure, ansi C
[11:30:28] <kali> why not asembly
[11:30:39] <kali> that's nonsense
[11:30:54] <algernon> emocakes: it's not open source. that wouldn't be such a big problem if the thing actually delivered, and its author wasn't a nut
[11:31:26] <algernon> but it's all talk and well engineered benchmarks :P
[11:31:39] <emocakes> yup
[11:31:44] <emocakes> thats what annoyed me about it
[11:31:51] <emocakes> the author is very mouthy
[11:32:04] <emocakes> and its closed source, but free
[11:32:20] <emocakes> seems like a 'wank' as you young kids would say these days
[11:33:02] <kali> close source is a definite show stopper as far as i am concerned
[11:33:20] <kali> algernon: yeah, me too. I like that, though
[11:33:43] <emocakes> btw rip buzz lightyear
[11:33:54] <emocakes> erm, neil armstrong or something
[11:34:10] <emocakes> haha
[11:37:01] <NodeX> that G-wan guy is up his own ass
[11:37:41] <NodeX> saying that single server performance is better than horizintal scaling .. yeh dude what happens when your single server dies IDIOT!
[11:39:23] <algernon> but g-wan never dies. only crap free software do that, didn't you know? :P
[11:39:51] <NodeX> g-wan may not die but hardware does!!
[11:40:39] <NodeX> give me 90 euro 16gb RAM + 2tb servers (plus replica sets) any day over a single server wiht no fault tollerance
[11:55:38] <zeus_> how to debug why writes to mongo cluster are so slow ? is there a better tool than mongostat ?
[13:43:14] <solars> hey, quick question - how do user restrictions work? I've added an admin user and user on a different db, but can still access the db without password from a rails app - how exactly does this work?
[13:46:42] <Derick> solars: did you start mongod with auth enabled?
[13:52:44] <solars> good question
[13:53:09] <solars> looks like it is disabled :)
[13:53:48] <solars> hm but I can still access the db
[13:53:58] <solars> I've set the admin user on an admin collection
[13:54:05] <solars> and an additional user on the database I'm accessing
[13:54:24] <solars> is this also used when accessing through localhost?
[14:02:13] <jiffe98> can I start with a single shard consisting of one replica set and add more shards later?
[14:08:40] <dgottlieb> jiffe98: yep
[14:10:44] <bjori> solars: yes
[14:10:56] <solars> hmm somehow it doesn't work
[14:11:00] <bjori> solars: you need to startup mongodb with --auth / --keyfile (for replicasets)
[14:11:00] <solars> i can still access normally
[14:11:20] <solars> I've set the param auth = true in /etc/mongod.conf
[14:11:26] <solars> which should be the same
[14:11:38] <bjori> solars: if you authenticate against the admin db you can browse all other dbs. otherwise you have to authenticate against the individual dbs
[14:13:28] <solars> I've not specified any credentials in the rails app
[14:13:49] <solars> if I do a $ mongo localhost/mydb - should I also get access denied?
[14:21:07] <solars> bjori, now it seems to work, weird
[14:21:21] <solars> if a db does not have a user, I can access it without I guess?
[14:30:40] <SpanishMagician> hello
[14:30:57] <SpanishMagician> A question if someone can help me
[14:31:05] <SpanishMagician> I have 2 collections in my database
[14:31:08] <SpanishMagician> users and clients
[14:31:17] <SpanishMagician> how do I create references?
[14:31:48] <SpanishMagician> create a ref for each client document and insert it in users or the other way around?
[14:32:06] <SpanishMagician> each user has a list of references to their clients
[14:32:07] <SpanishMagician> ?
[14:36:29] <SpanishMagician> very quiet today...
[14:36:56] <Derick> Bank holiday in the UK, and Labor day in the US
[14:58:30] <SpanishMagician> if anyone here is available please let me know
[15:02:36] <NodeX> FOr what ?
[15:02:46] <NodeX> Just ask the question and someone will answer if and when they can
[15:08:19] <SpanishMagician> thanks nodex
[15:08:25] <SpanishMagician> did that, will try again :)
[15:08:52] <SpanishMagician> I have 2 collections in my database, users and clients, how do I create references?
[15:08:59] <SpanishMagician> create a ref for each client document and insert it in users or the other way around?
[15:09:09] <SpanishMagician> each user has a list of references to their clients?
[15:09:16] <Derick> "yes"
[15:09:31] <Derick> It's impossible to answer this, as it all depends on how you want to do queries, and how updates work in your app
[15:10:02] <SpanishMagician> the app will update the clients collection
[15:10:28] <SpanishMagician> however I want a security mechanism so that a user cannot modify someone else's clients
[15:10:32] <SpanishMagician> makes sense?
[15:10:49] <Derick> yeah, so make sure that you only have to update one document at any time
[15:11:13] <Derick> which, in this case, probably means storing the user ID in the clients' collection's document
[15:11:43] <bjori> solars: you can access it with the admin user, but not otherwise
[15:11:50] <SpanishMagician> just store the id right? I don't need to create a ref
[15:12:21] <Derick> no you don't have to create a ref
[15:12:33] <Derick> a ref is not much more than array(collection, _id) anyway
[15:12:43] <SpanishMagician> have a field in the clients collection user_id
[15:14:17] <SpanishMagician> so an update would be sth like db.clients.update({{'_id': id},{'user_id': userid}}, blablabla)
[15:14:25] <SpanishMagician> is that right?
[15:14:51] <Derick> that will replace the document with "id" with just { _id: id, 'user_id' : userid }
[15:14:57] <Derick> you might want to look at $set
[15:16:40] <SpanishMagician> yes, i just wrote the first part
[15:17:30] <SpanishMagician> i want to replace the document with _id id and user_id userid with whatever
[15:18:48] <SpanishMagician> update the email for example would be update({{_id: id}, {user_id: userid}}, {$set:{email: 'blabla@blabla.com'}})
[15:18:54] <SpanishMagician> is that correct?
[15:19:05] <Derick> looks like it
[15:20:03] <SpanishMagician> thanks derick
[15:23:41] <geoffeg> hmm, creating a capped collection blocks all other operations while the collection is being created?
[15:51:12] <jgornick> Hey guys, I created a collection that contains documents with one field that mapped to another document using a DBRef. If the driver support dbrefs, I should be able to make queries on that collection that allow me to sort or filter the resultset? Something like db.tempCollection.find({ ref.someField: 'test' }).sort({ ref.anotherField: -1 });
[15:52:21] <NodeX> mongo is not an rdmbs
[15:52:27] <NodeX> there is no joins and no references
[15:52:53] <NodeX> you may embedd / nest documents but you cannot reference or join anything inside one query - it MUST be 2 or more queries
[15:53:09] <NodeX> ^^ that should be added to the topic LOL
[15:53:11] <jgornick> NodeX: However, if the driver supports dbrefs, it should follow those right?
[15:53:25] <NodeX> pass
[15:53:29] <NodeX> what driver is it?
[15:53:34] <jgornick> PHP.
[15:53:46] <NodeX> I dont think the PHP driver does support refs
[15:53:56] <Derick> it sortof does
[15:54:03] <Derick> it's not more than a convention though
[15:54:07] <NodeX> I've been using the driver for around 2 years and it's news to me
[15:54:15] <Derick> it's not overly useful :-)
[15:54:35] <Derick> in any case, the PHP driver doesn't follow dbrefs automatically
[15:54:40] <NodeX> learn something new every day!!
[15:55:06] <NodeX> that kinda promotes bad schema design
[15:55:12] <jgornick> Derick: So, sorting and filtering on a collection of dbrefs would be a pain.
[15:55:28] <NodeX> (it implies it creates a join or w/e) </end-rant>
[15:55:31] <Derick> NodeX: yes it does
[15:56:02] <NodeX> jgornick : if you're using alot of refs I should reconsider your schema
[15:56:15] <jgornick> This is a temporary collection where I've aggregated data using map/reduce. Instead of populating the temporary collection with cloned documents, I wanted to populate it with dbrefs to those documents.
[15:56:59] <NodeX> as Derick said it does not auto follow them so it's prolly not useful for you in your case
[15:57:13] <jgornick> Sounds good.
[15:57:26] <NodeX> might aswel save the _id and the little info you do need
[15:57:30] <Derick> yeah
[15:57:42] <NodeX> (as they're only temp collections)
[15:58:48] <jgornick> Derick: Good talks at lone star php this year :) I never did get the chance to meet you. I enjoyed the openstreetmap talk!
[15:59:04] <Derick> thanks!
[15:59:50] <jgornick> Anyways, thanks for the insight.
[16:00:10] <Derick> np
[16:00:18] <jgornick> You too NodeX :)
[16:00:21] <NodeX> yw ;)
[16:03:28] <NodeX> anyone here use relic ot monitor their Mongo based apps?
[16:11:49] <Bartzy> Derick: ?
[16:12:06] <Bartzy> I was wondering about connection pooling on the PHP driver
[16:12:44] <Bartzy> using version 1.2.12 of the driver.
[16:13:11] <Derick> Bartzy: what are you wondering about it?
[16:13:17] <Bartzy> I have a long running worker that is using mongoDB to update documents as it gets job
[16:13:20] <Bartzy> jobs*
[16:13:36] <Bartzy> Should I instanciate a Mongo instance ones and save it in the object
[16:13:40] <Bartzy> my object, that is
[16:13:50] <Bartzy> or just recreate a Mongo instance and let pooling do its job ?
[16:14:30] <Derick> I'd do the first thing, only because it's cleaner
[16:14:36] <Derick> (and a tad faster)
[16:14:45] <Bartzy> And it actually a bit faster, because there is no need to go to the pool ?
[16:14:53] <Derick> yeah
[16:14:54] <Bartzy> go to the pool on each job, that is
[16:15:01] <Bartzy> ok - and the resources taken - that is negligble ?
[16:15:04] <Derick> also, from 1.3, there is ony going to be a pool anymore
[16:15:10] <Bartzy> negligible*
[16:15:19] <Derick> Bartzy: it's fairly much not much different
[16:15:25] <Derick> instantiating a PHP object takes time
[16:15:36] <Bartzy> Derick: Not much different because the resources are in the pool anyway ?
[16:15:42] <Derick> yeah
[16:15:50] <Bartzy> OK - and where is the pool btw ?
[16:15:53] <Derick> the coonnection creation overhead is the slow bit
[16:16:00] <Derick> the pool? it's part of the driver
[16:16:05] <Bartzy> On a CLI php - in the process memory somewhere - and with PHP-FPM - it is shared with all fpm processes ?
[16:16:08] <Derick> just some structures in memory
[16:16:18] <Derick> it's per-worker process/thread
[16:16:26] <Bartzy> ah - so it's not shared between FPM processes ?
[16:16:34] <Derick> you can't share connections between multiple processes (easily)
[16:16:42] <Derick> so no, it's not shared
[16:16:52] <Bartzy> But because FPM processes last more than one request - it is still OK ?
[16:16:56] <Bartzy> yeah, got it.
[16:17:07] <Bartzy> ignore my last question, I know the answer :p
[16:17:10] <Bartzy> OK - last question
[16:17:15] <Bartzy> What should I "cache" in my object
[16:17:17] <Derick> yeah, the pool *is* reused between multiple requests in the same FPM instance
[16:17:19] <Bartzy> Mongo, or MongoCollection ?
[16:17:24] <Derick> either works
[16:17:34] <Bartzy> It's weird to cache only MongoCollection.
[16:17:41] <Bartzy> However I don't really need Mongo.
[16:17:48] <Derick> it has a link to the Mongo object internally anyway
[16:17:48] <Bartzy> (Mongo the object, that is)
[16:18:12] <Bartzy> Ah - so that was my next question - that (the link to the Mongo object) is that reason that the connection doesn't drop?
[16:18:24] <Bartzy> Because otherwise, if I don't "save" the Mongo object, it will go out of scope ?
[16:18:48] <Derick> even if it goes out of scope, the connection doesn't drop as we reference it in the extension itself too
[16:18:59] <Bartzy> extension ?
[16:19:07] <Derick> the php driver is a php extension
[16:19:09] <Bartzy> Yeah
[16:19:13] <Bartzy> So how do I disconnect
[16:19:17] <Derick> you don't
[16:19:24] <Derick> no need for it
[16:19:32] <Bartzy> so the "out of scope" thing in the docs is not really true ?
[16:19:38] <Derick> link please?
[16:20:40] <Bartzy> Sorry - when it goes out of scope - it is returned to the pool
[16:20:42] <Bartzy> http://php.net/manual/en/mongo.connecting.php
[16:21:28] <Bartzy> That is correct I guess? And so it doesn't return to the pool because the MongoCollection object references the Mongo object ?
[16:21:39] <Derick> yes
[16:21:59] <Derick> if it goes out of scope, it goes back to the pool - the pool of established connections
[16:22:02] <Bartzy> OK, cool :)
[16:22:21] <Bartzy> So there is absolutely no way of a Mongo connection timing out , like a MySQL connection for example ?
[16:22:25] <Bartzy> Only a cursor timeout ?
[16:22:31] <Derick> there is
[16:22:48] <Derick> if you sever the connection from the server (or network side) the connection will still break
[16:22:51] <Bartzy> For example, my worker doesn't get jobs for a day. What happens if it gets a job suddenly? The Mongo object is live and well?
[16:22:59] <Bartzy> Yeah, of course.
[16:23:04] <Derick> the server will have terminated the connection by then
[16:23:14] <Bartzy> and how do I check for that ?
[16:23:19] <Derick> iirc, after 10 mins of idling
[16:23:23] <Derick> hmm, I don't remember :S
[16:23:48] <Bartzy> What do you mean 10 mins ?
[16:23:55] <Bartzy> You said if you sever the connection it will break
[16:24:02] <Bartzy> what idling has to do with it? :P
[16:24:48] <Derick> the server might sever the connection if the connection is idle for too long
[16:25:51] <Derick> https://groups.google.com/d/msg/mongodb-user/IdSp7WcA66o/R4zPR2lim7IJ
[16:25:57] <Derick> apparently, mongod will never do that
[16:26:47] <Bartzy> and mongos will? :P
[16:27:51] <Derick> don't think so either
[16:28:13] <Derick> but still, the server *will* break the connection if it steps down from primary to secondary f.e.
[16:28:25] <Derick> got to run - will be back tomorrow
[16:28:55] <Derick> Bartzy: it throws a MongoConnection exception iirc (gone now)
[16:29:21] <Bartzy> Thank you!!
[16:29:24] <Bartzy> very much :)
[17:32:17] <ramsey> I'm a little worried about the "couldn't send query" messages I get intermittently with the PHP driver (1.2.12). They seem to happen a lot on my development VM, but they don't happen at all for another developer. Should I be concerned about the stability of the driver?
[17:42:01] <TheSimkin> it's prett quiet in here isn't it ramsey
[17:42:08] <TheSimkin> starting to wonder if there is a more official channel
[17:42:19] <ramsey> TheSimkin: this is the official channel :-)
[17:42:26] <TheSimkin> i don't have the anwer to your question ramsey, i am a newb.
[17:42:33] <TheSimkin> but i am interseted in working with php too
[17:42:46] <TheSimkin> i just emerged mongodb yesterday.
[17:43:03] <ramsey> TheSimkin: the forums are probably the best place to get answers, but I like IRC. :-) https://groups.google.com/forum/?fromgroups#!forum/mongodb-user
[17:43:17] <TheSimkin> i got couchdb too, but couchdb is producing a piles of errors even with their own test cases on a base install
[17:43:27] <TheSimkin> irc is better for me to
[17:43:46] <TheSimkin> forums are great bt it's not the same as a 'live discussion'
[17:43:49] <TheSimkin> pj w;;we.
[17:44:06] <TheSimkin> i gues it is up to us tobecome masters of mongo and help the chan along :)
[19:17:51] <jgornick> hey guys, are there any statistics related to performance with large collections?
[19:20:57] <jgornick> I guess I'm looking for some sort of a guideline that says, "You should try avoiding n number of documents in a collection as this is where performance degrades."
[19:28:09] <kali> jgornick: it does not work that way. whatever fits in memory is the key.
[19:28:25] <jgornick> kali: Gotcha.
[19:31:53] <BurtyB> if I do a db.collection.count() on a sharded db/collection should it add the counts on all shards shouldn't it?
[19:46:09] <Ahlee> Yes
[19:57:24] <Ahlee> which added together is 163469728, which is ~163470762, no?
[19:57:44] <Ahlee> is your data set static?
[19:59:47] <BurtyB> Ahlee, I've stopped the import now all mongos say 163480979 mongod direct gives 16464257 / 57956572 / 89060150 now
[20:00:38] <Ahlee> BurtyB: great, (16464257+57956572+89060150)-163480979=0
[20:01:02] <Ahlee> Your data set is being spread over your members on the shard key.
[20:01:18] <Ahlee> What do you think is wrong?
[20:01:58] <Ahlee> Are you by chance confusing replica sets and shards?
[20:04:03] <BurtyB> Ahlee, (I don't have replica sets atm) I was failing at noticing the length of the numbers so what's wrong is my eyesite :/ I figured it was me doing something wrong somewhere
[20:04:36] <BurtyB> Ahlee, thanks for fixing the error of my ways :)
[20:04:55] <Ahlee> Glad I could help
[20:16:54] <addisonj> so, I am moving our production mongo to AWS and am using RAID on EBS, currently, we just use mongodump for backups, is the biggest benefit to using EBS snapshots just speed and offloading the work?
[20:26:55] <freezey> you can move away from mongodump if you just snapshot
[20:27:02] <freezey> they are simple fast and easy
[20:27:08] <freezey> and if you code it your good
[20:30:42] <addisonj> right, I just already have code for using mongodump, so was wondering if it was worth the effort
[20:34:10] <freezey> all about preference
[20:34:23] <freezey> would you prefer to manage dump files or snapshots
[20:34:25] <freezey> up to you
[21:19:03] <doxavore> Has anyone had luck getting nginx-gridfs to work in Ubuntu 12.04?
[22:30:35] <Yiq> So I thought nosql and sql databases were basically for different use but a lot of people are saying nosql(couch, mongo) is the way to go for webapps, dynamic applications. Why is it better(or is it? obv there must be stuff where each is better)?
[22:32:06] <sirpengi> those people are wrong (imo)
[22:32:52] <sirpengi> each database has their strenghts and weaknesses
[23:51:41] <bluethundr> hello.. I've installed mongodb on centos 5.8 .. I've added the line extension=mongo.so into my php.ini file but for some reason a phpinfo(); page does not show that it is enabled
[23:52:01] <bluethundr> what do I have to do to enable mongodb for apache 2.2.2 under centos? tx
[23:54:30] <_johnny> if php does not list mongo, then make sure you edit the correct php.ini, or that your php process/daemon uses the ini you expect