PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 26th of June, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:06] <leandroa> @cheeser thank you! (sorry for the delay, busy deployment day!)
[00:03:11] <GothAlice> leandroa: I know the feels. ¬_¬
[00:12:58] <astromaddie> I'm new to learning mongo. can someone help me with a problem I'm having?
[00:15:08] <astromaddie> I'm not even sure if what I'm trying to do is possible, but I'm trying to sum up a few million arrays (to get an average). the arrays all have the same dimensions.
[00:17:06] <astromaddie> I'm also using mongo by proxy of pymongo. I tried doing nested python loops first but after 13 hours, it wasn't finished -- that's a no-go
[00:30:23] <astromaddie> anyone here not idling? heh
[00:34:21] <joannac> astromaddie: aggregation framework?
[00:37:32] <astromaddie> @joannac I've been trying to use the aggregation framework... it doesn't seem to add multiple arrays together
[00:38:32] <astromaddie> eg, if I have array A=[1,1,1] and B=[2,0,1], I'm trying to do an aggregate sum so that my resultant output is [3,1,2]
[00:45:38] <astromaddie> daily.aggregate(pipeline=[{'$group' : {
[00:45:38] <astromaddie> '_id' : {'appid' : '$appid',
[00:45:39] <astromaddie> 'time' : '$time'},
[00:45:39] <astromaddie> 'traffic' : {'$sum' : '$traffic'},
[00:45:39] <astromaddie> 'cnt' : {'$sum' : 1}}},
[00:45:39] <astromaddie> {'$group' :{
[00:45:39] <astromaddie> '_id' : 'null',
[00:45:39] <astromaddie> 'traffic' : {'$sum' : '$traffic'},
[00:45:40] <astromaddie> 'cnt' : {'$sum' : '$cnt'}}}], allowDiskUse=True)
[00:45:49] <astromaddie> whoops, sorry... I was trying to share the query I ran.
[00:47:14] <astromaddie> daily.aggregate(pipeline=[{'$group' : {'_id' : {'appid' : '$appid', 'time' : '$time'}, 'traffic' : {'$sum' : '$traffic'}, 'cnt' : {'$sum' : 1}}}, {'$group' : {'_id' : 'null', 'traffic' : {'$sum' : '$traffic'}, 'cnt' : {'$sum' : '$cnt'}}}], allowDiskUse=True)
[00:47:31] <astromaddie> ^^^ that's the query I tried, but turns out you can't $sum two arrays
[00:47:42] <joannac> astromaddie: $unwind
[00:48:21] <joannac> oh wait
[00:48:29] <astromaddie> joannac: doesn't $unwind just operate on all the individual values, without preserving the array structure?
[00:48:30] <joannac> yeah, do that in python
[00:48:46] <astromaddie> Hmm. The only way I can think to do it in python is painfully slow
[07:58:16] <m3t4lukas> hey guys
[07:58:46] <m3t4lukas> how do I get the ID of a newly created file in libmongoc?
[07:59:04] <m3t4lukas> I create the file with mongoc_gridfs_create_file()
[08:00:00] <m3t4lukas> found it :P
[08:00:32] <m3t4lukas> https://github.com/mongodb/mongo-c-driver/pull/222/files?diff=split#diff-a8dc54c42bee460afe8f133af3220069L771 for anyone who also whishes to do that
[09:32:38] <mtree> why count takes so much longer than same query with sort, skip and limit?
[10:26:05] <PasWhoop> Hello there! anyone knows what the output on the mongod terminal window means?
[10:34:22] <gemtastic> Hello everyone!
[10:52:01] <mark_at_minds> hello! how well does mongodb support frequents deletes/updates, partically on indexes columns?
[10:54:04] <gemtastic> Hmm anyone knows why I get "command not found" in the console when I'm running mongod in one terminal and in the bin directory try to run mongo in OSX?
[10:55:03] <bogn> maybe try ./mongod
[10:55:30] <bogn> if it's not in the $PATH you have to
[10:56:14] <bogn> or if I got you right now and mongod is already running, ./mongo
[10:58:16] <gemtastic> mongod is running and I tried to access mongo. For some reson it wouldn't work
[10:58:43] <gemtastic> But it seems to be now for some reason. Looks like third time new terminal was the charm O.o
[11:05:31] <apoc> using the node drivers(2.0) how do I set continueOnError on a bulk operation?
[11:05:57] <Derick> that's called "unordered" mode I believe
[11:07:12] <apoc> ahh indeed thanks
[12:16:26] <tibyke> moin
[12:19:37] <tibyke> any idea on getting the unique _keys_ of a nested 'array' in a collection? can it be a oneliner or is it possible only with a loop?
[12:20:00] <StephenLynx> hm?
[12:20:23] <StephenLynx> what do you mean by 'array'? why the quotes?
[12:21:33] <tibyke> i have something like { whatever: { foo: 1, bar: 2}}, then { whatever: { foo1: 3, bar1: 53}}, and {whatever: {foo2: 234, bar2: 555}}, and i need foo, foo1, foo2, bar, bar1, bar2
[12:21:59] <tibyke> can it be achieved with an aggregate?
[12:22:08] <StephenLynx> [{wathever:{foo:1,bar:2}}, etc] ?
[12:22:10] <StephenLynx> this?
[12:22:28] <StephenLynx> this is what you have?
[12:22:35] <StephenLynx> why the "whatever" key?
[12:22:52] <StephenLynx> and not just [{foo:1, bar:2}] ?
[12:23:31] <tibyke> thats a good question, i'll convert it to that schema, but im curious if I can get it out from this schema.
[12:23:43] <tibyke> im pretty new to mongo actually :)
[12:24:19] <StephenLynx> all those objects reside in an array of a single document?
[12:25:51] <tibyke> no, they are in several documents, all nested in 'whatever', and i need the distinct collection-wide keys of 'whatever' in the above example: foo, foo1, foo2, bar, bar1, bar2
[12:26:04] <tibyke> every document is nested in 'whatever'
[12:26:44] <StephenLynx> ok
[12:27:03] <StephenLynx> so just perform a find and in the projection block put {foo:1,bar:1}
[12:27:11] <StephenLynx> if you remove the whatever key.
[12:27:24] <StephenLynx> that way every document will return the foo and bar fiels.
[12:27:46] <tibyke> so that will be a loop, and not a oneliner, right?
[12:28:31] <StephenLynx> a loop?
[12:28:32] <StephenLynx> no
[12:28:50] <StephenLynx> find({your match block},{foo:1,bar:1})
[12:30:02] <tibyke> you dont get it. or me :) i need every single key in 'whatever' in every document
[12:31:13] <StephenLynx> didnt you say you would remove "whatever"?
[12:31:24] <StephenLynx> theres no point in having it.
[12:31:26] <gemtastic> Have I understood it right; A key feature in mongo is that if something doesn't exist, it will create it?
[12:31:32] <StephenLynx> yes.
[12:31:40] <StephenLynx> I wouldn't say its "key"
[12:31:55] <StephenLynx> but its how it treats databases and collections
[12:32:07] <tibyke> StephenLynx, sure i will remove, but im courious if it can be achieved this way.
[12:32:14] <StephenLynx> yes
[12:32:20] <StephenLynx> just project whatever
[12:32:26] <StephenLynx> {whatever:1}
[12:32:30] <gemtastic> That explains why it's so fruitless in googling "create database mongodb" :P
[12:32:34] <StephenLynx> :v
[12:34:50] <gemtastic> So, in other words; let's say I have a node.js application interacting with my mongodb and it wants to put stuff into a collection that doesn't exist, will it create it or will it throw an error?
[12:35:08] <StephenLynx> will create it.
[12:35:47] <StephenLynx> because you can't create collections manually either, afaik
[12:36:09] <gemtastic> *nods* well, that settles that problem
[12:36:21] <gemtastic> :)
[12:38:57] <cheeser> http://docs.mongodb.org/manual/reference/method/db.createCollection/
[12:39:00] <Pescis> Heya is it possible to use a object path to update a collection?
[12:39:11] <Pescis> with like path indexes
[12:39:50] <Pescis> maybe I just shouldn't store it all in the same collection?
[12:40:12] <gemtastic> Do you still need to patch Mongodb for windows? If you don't, what will happen?
[12:40:27] <cheeser> what?
[12:40:44] <StephenLynx> yes, its called "install GNU/Linux"
[12:40:53] <gemtastic> When I downloaded mongodb for windows it said I had to download a patch for win7
[12:41:42] <gemtastic> "
[12:41:43] <gemtastic> Important
[12:41:43] <gemtastic> If you are running any edition of Windows Server 2008 R2 or Windows 7, please install a hotfix to resolve an issue with memory mapped files on Windows.
[12:41:43] <gemtastic> "
[12:41:47] <gemtastic> Oops, sorry
[12:41:50] <gemtastic> bad formatting :(
[13:45:52] <StephenLynx> are you going to run a server?
[13:46:00] <StephenLynx> an internet facing server?
[13:47:08] <gemtastic> Me?
[13:47:28] <tibyke> StephenLynx, and how would you get every single field/key from every document without the nesting? so eg. {foo: 1, bar: 2}, {foo1: 0, bar2: 434}.
[13:47:37] <StephenLynx> yes, you, gemstatic.
[13:48:00] <StephenLynx> tibyke you don't nest them in the first place.
[13:48:07] <StephenLynx> just put directly in the document.
[13:48:14] <gemtastic> The idea is to put my mongo in a cloud, but right now I'm just trying to learn how to get it set up at all :P
[13:48:24] <StephenLynx> insert({foo:1,bar:2})
[13:48:40] <gemtastic> I only really started playing around with it today
[13:48:42] <StephenLynx> that creates a new document with the fields directly in the document, no nesting.
[13:49:02] <StephenLynx> so don't bother with windows. you don't run a windows server.
[13:51:24] <gemtastic> StephenLynx: I really don't think it matters when you're jsut n00bing around.
[13:51:58] <gemtastic> But don't worry, my work environments are in Unix
[13:52:01] <danijoo> I want to move a huge database (400gb) to another server while in production (cant take it down). what do you think is the best way to do so. db.copyDatabase() ?
[13:52:43] <StephenLynx> I have never did anything like that, but putting the new server as a replica and waiting for it sync is a valid option?
[13:52:56] <vagelis> Hello, I have to make a query in MongoDB and then return the results in an aggregation style :| I am not good with Mongo and I dont know if its possible to combine aggregation with query. Does $match has to do with that? :S
[13:53:01] <danijoo> i had that idea too. not sure whats better though
[13:53:14] <StephenLynx> vagelis, yes. use $match to filter documents.
[13:53:28] <tibyke> StephenLynx, i dont nest them :)
[13:53:34] <danijoo> data loss is not a problem. its more of a giant cache so if entries get lost thats ok
[13:53:36] <vagelis> Cool. Well i tried and i think i dont do something corectly
[13:53:53] <tibyke> StephenLynx, thats right, and now i need ['foo', 'bar']. how?
[13:53:58] <danijoo> also both servers are in the same data center so data transfer rate is also high
[13:54:07] <StephenLynx> why you need them in an array instead of an object?
[13:55:01] <tibyke> StephenLynx, its something like a counter for every field, and i need to loop thru every "field" (counter) to get the top5 of them.
[13:55:26] <StephenLynx> you need to sort it according to one of the fields?
[13:55:39] <vagelis> StephenLynx I want it to be like this: { 'Separated_by_a_Field': '$Field', 'My_Results': [... , ... , ...] }
[13:55:42] <tibyke> eg {apples: 5, tables: 8}, {whatever: 15, baskets: 885}. and i need every TOP5 of every article.
[13:55:53] <tibyke> StephenLynx, EVERY field, separately
[13:55:59] <tibyke> but how do i get EVERY field?
[13:56:09] <StephenLynx> so you need the sum of each field across all documents?
[13:56:34] <tibyke> yeah, the sum/min/max/avg/whichever
[13:56:40] <vagelis> Actually let me go back to the code to examine something and ill be back StephenLynx
[13:56:43] <StephenLynx> use $group in aggregation
[13:56:57] <StephenLynx> http://docs.mongodb.org/manual/reference/operator/aggregation/group/
[13:57:26] <tibyke> StephenLynx, thats what im trying, but still pretty confused :) is it push? or is it addToSet?
[13:57:34] <StephenLynx> $sum
[13:57:56] <gemtastic> Would you say that ElasticSearch has a similar way of storing the data as MongoDB? Feels like everything's called pretty much the same
[13:58:27] <tibyke> hmmm
[13:58:42] <whaley> gemtastic: no, because elasticsearch stores data in lucene index files... I'm reasonably certain mongos underlying storage engine is not lucene
[14:01:08] <gemtastic> whaley: well, it may not code-wise work in the same way, but it looks like they're trying to follow the same logical pattern on the interface end
[14:01:46] <gemtastic> I mean; ElasticSearch IS a java application after all, I'm guessing Mongo is far from it?
[14:03:17] <whaley> gemtastic: correct
[14:03:54] <whaley> gemtastic: what logical pattern are you referring to btw? (I think this is largely irrelevant, but I'm in the mood for conversing)
[14:05:54] <gemtastic> I was thinking the whole Collections>index>document
[14:07:18] <gemtastic> I've been working kinda much in ElasticSearch (still a n00b there too though, but I've worked a bit with it and gotten the hang of it) and I can't help but to notice that they seem to try to follow the same noSQL pattern, but maybe that just IS the noSQL pattern..
[14:07:32] <gemtastic> I haven't worked with NoSQL apart from what ES does before.
[14:07:43] <mike_edmr> there is no single way to do nosql
[14:08:14] <gemtastic> That's what I thought, but ES seems to be following the same logical pattern for the user and references as Mongo
[14:08:32] <whaley> both mongo and elastic store documents often represented to clients as some json-like structure, but that's where I think the similarities end
[14:08:33] <gemtastic> And I don't know much about NoSQL apart from that it's anything that isn't SQL :P
[14:08:39] <mike_edmr> yeah they have been used in a complimentary fashion a lot
[14:08:49] <mike_edmr> you can hook them up with mongo connector or whathaveyou
[14:09:15] <mike_edmr> right, the internals are substantially different
[14:10:13] <gemtastic> Yeah, the internals are nothing alike, but there's benefits to making the UX (can you call it that when we're talking about developers?) consistent is beneficial since it decreases the learning curve
[14:10:24] <vagelis> StephenLynx if I use $match only, returns the results that I want but not grouped. When i insert $group.. it returns only the groups. So I guess I have to make a new field and put inside the results but how to define the results $what?
[14:10:32] <mike_edmr> lets coin DX. developer experience :)
[14:10:32] <gemtastic> *there are
[14:10:47] <gemtastic> Sounds like a great idea XD
[14:11:54] <gemtastic> Mongo is a lot easier to query though >_>
[14:52:25] <vagelis> Hello, I am trying to groupby some query results using $match but I cant succeed. I use it like this:
[14:53:09] <vagelis> [{$match: QUERY}, {$group: {_id: "$FIELD"}}]
[14:53:23] <vagelis> The problem is that returns only the _ids
[14:53:41] <Derick> yes, your group stages only includes _id, all other fields you need to add yourself too
[14:54:15] <vagelis> I want: [{$match: QUERY}, {$group: {_id: "$FIELD", "RESULTS_from_match": ??? }}]
[14:54:33] <Derick> i don't know the fields from your documents
[14:54:37] <vagelis> I thought of that Derick but for some reason doesnt work
[14:55:00] <vagelis> I mean it was obvious i did it but a problem is raised or something
[14:55:08] <Derick> [{$match: QUERY}, {$group: {_id: "$FIELD", 'average' : { '$avg' : '$age' }}}]
[14:55:14] <Derick> for example...
[14:55:21] <Derick> you need to tell us the errors
[14:55:21] <vagelis> no w8
[14:55:26] <Derick> don't say "it doesn't work"
[14:55:45] <vagelis> I dont want to make avg or something I just want to show the results from the Match grouped by 1 field thats all
[14:56:12] <Derick> but how would you fix the case where you have multiple documents for each group'ed field?
[14:57:00] <Derick> I mean, if you have three docs: { a: 4, b: 5 }, { a: 4, b : 7 }, and { a: 8, b: 7 } - you do [{$group: { _id: '$a' }} ]
[14:57:06] <Derick> what should the value of 'b' be?
[14:59:15] <vagelis> sry i had to go to toilet
[14:59:22] <Derick> i didn't need to know that
[14:59:42] <vagelis> In ur last example I want to show it like this:
[15:00:18] <vagelis> { '_id': 4, results: {b:5}, ....
[15:00:36] <Derick> so you want an array
[15:00:47] <vagelis> hmm no?
[15:00:48] <Derick> give me a sec, need to try something
[15:00:53] <Derick> no?
[15:01:01] <vagelis> what has the array to do with that?
[15:01:04] <Derick> but there are two matches for a=4
[15:01:21] <Derick> where do you want the b=7 document result?
[15:01:35] <vagelis> god damn im so confused man
[15:02:02] <vagelis> Look i get 10 docs from a find. I have to group them by 1 field
[15:02:21] <Derick> okay, make a pastebin, and in there: show those 10 documents, and what you'd like as result
[15:02:29] <vagelis> ok
[15:02:35] <Derick> and I'll have a look
[15:04:37] <leev> Derick: don't suppose you know how to fix "Primary for rs1/mongodb02:10001,mongodb03:10002 was down before, bypassing setShardVersion. The local replica set view and targeting may be stale."?
[15:04:40] <leev> in mongos logs
[15:05:25] <Derick> leev: uh, no - not a clue :)
[15:05:31] <leev> damn :/
[15:08:03] <vagelis> Derick: https://bpaste.net/show/3884b95dd10e
[15:08:17] <Derick> vagelis: gimme a few mins
[15:08:35] <vagelis> sure
[15:11:03] <Derick> okay
[15:11:11] <Derick> Results is an array here ;-)
[15:11:16] <vagelis> yes
[15:14:42] <Derick> db.ex.aggregate( { $group: { _id: '$city', 'Results' : { '$push' : { city: '$city', population: '$population', country : '$country' } } } } )
[15:15:02] <vagelis> w8
[15:15:17] <vagelis> I have to use match in order to get those documents!
[15:15:56] <Derick> sure, the match stage is before that
[15:16:02] <vagelis> oh
[15:16:05] <Derick> actually, you can shorten it to:
[15:16:16] <Derick> db.ex.aggregate( { $group: { _id: '$city', 'Results' : { '$push' : '$$CURRENT' } } } );
[15:16:22] <Derick> so, with a match, it could be:
[15:16:30] <vagelis> its ok i got it
[15:16:40] <Derick> db.ex.aggregate( { $match: { 'city' : 'Paris' } }, { $group: { _id: '$city', 'Results' : { '$push' : '$$CURRENT' } } } );
[15:16:46] <vagelis> oh actually whats the current? first time i see this
[15:17:05] <vagelis> its like push whatever i have now?
[15:17:11] <Derick> docs say "CURRENT is a system variable that defaults to the root of the current object"
[15:17:13] <vagelis> anyway ill search it thanks man
[15:17:37] <vagelis> Look now to my second question
[15:17:44] <vagelis> I use python(and pymongo)
[15:17:51] <Derick> http://docs.mongodb.org/manual/reference/aggregation-variables/#variable.ROOT
[15:17:59] <Derick> ROOT is I suppose better than CURRENT
[15:18:17] <vagelis> Should I use the way u just showed me OR get the docs and then loop them and hardcode the way i want them to be?
[15:18:31] <Derick> loop and hardcode? why would you want that?
[15:18:56] <vagelis> Dont know maybe faster? Maybe i am pushing Mongo too much i dont know :S
[15:19:29] <vagelis> Hardcode would be crap cause more lines etc but I am just saying
[15:19:40] <Derick> sorry, what do you want to hardcode?
[15:20:06] <vagelis> to group the results by city BUT use python
[15:20:28] <vagelis> anyway ill do ur way
[15:20:53] <vagelis> Thank u very much my friend for ur help
[15:21:06] <vagelis> Have a nice weekend!
[17:07:40] <und1sk0> that's better
[17:08:46] <und1sk0> i'm a community user and i've had mongodb segfault, should i open a JIRA with mongodb?
[17:09:31] <StephenLynx> can you reproduce it?
[17:10:28] <und1sk0> i think we tried yesterday but weren't able to, but we crashed the db last month (using an older rev of mongodb) under similar circumstances...background reindexing
[17:10:58] <und1sk0> 2.6.7 for the former, 2.6.10 for the latter
[17:11:37] <und1sk0> here's the pre-segfault error: Invalid access at address: 0x38#012
[17:13:37] <und1sk0> the secondary also had a fatal assertion after i recovered the downed primary
[18:00:07] <greyTEO> if a failure occurs in a bulk operation does the entire bulk fail?
[18:00:37] <greyTEO> such as a unique index exception, would all other 999 operations fail..
[18:04:25] <StephenLynx> <und1sk0> Maybe it was fixed in a newer version.
[18:04:36] <StephenLynx> its been a while since 2.6
[18:06:36] <cheeser> greyTEO: i think you send an option with the right to determine whether to fail or not
[18:09:26] <greyTEO> I found this deep in the docs: http://docs.mongodb.org/manual/reference/method/db.collection.initializeUnorderedBulkOp/#error-handling
[18:09:45] <greyTEO> I guess it depends on the drier cheeser ...
[18:25:53] <chairmanmow> I am trying to perform an update operation on a record where the values of the subdocument array will be replaced with the array contents of the incoming query. Not getting an error, figured I'd paste a link to a bit of code here in case anyone might see where I might be missing something http://pastebin.com/r0Bdyaev
[18:27:17] <StephenLynx> >mongoose
[18:27:31] <StephenLynx> I would put a bux or two that your problem is right there.
[18:28:44] <chairmanmow> are you saying mongoose isn't that great?
[18:30:23] <StephenLynx> that great? mongoose must be the worst middleware I have ever seen.
[18:30:56] <StephenLynx> almost everyone that comes here with issues using node/io its because of mongo.
[18:31:04] <StephenLynx> it is inconsistent, slow
[18:31:21] <StephenLynx> messes up _id
[18:31:49] <chairmanmow> interesting, I'm junior so I don't make these kinda calls, any reading material you might know of on alternatives/comparisons/etc to mongoose?
[18:33:34] <akoustik> chairmanmow: mongoskin is a possible alternative, if you don't actually need the DBMS sorta stuff.
[18:33:41] <StephenLynx> I got a person that benchmarked and got mongoose running 600% slower.
[18:33:48] <StephenLynx> is that useful for you?
[18:33:50] <StephenLynx> to you*
[18:34:14] <akoustik> (talking to me, StephenLynx?)
[18:34:18] <StephenLynx> no
[18:34:21] <StephenLynx> chair
[18:34:24] <akoustik> ha gotcha
[18:34:26] <StephenLynx> he asked for some material
[18:35:02] <StephenLynx> besides, you don't have to use mongoose, if there is enough people on the project.
[18:35:15] <StephenLynx> just use the official driver and of you go :^)
[18:35:23] <StephenLynx> when anyone notices, it will be too late to change.
[18:35:32] <StephenLynx> off you go*
[18:36:19] <akoustik> hahahaa the man has a point.
[18:36:40] <chairmanmow> Yeah, I'll have to look into the criticisms and alternatives. I'll research it a bit and see if I can bring anything to my boss's attention when he's back in the office
[18:37:25] <StephenLynx> the best alternative is the regular driver, IMO.
[18:37:31] <StephenLynx> official support, great documentation, performance.
[18:37:39] <chairmanmow> Is that a node package?
[18:37:43] <StephenLynx> mongodb
[18:37:46] <StephenLynx> yes, its on npm.
[18:42:12] <akoustik> anyone here get mongo 3.0 running on centos 6.6? the repo on the mongo site has a libstdc++ dependency that apparently is not provided in c6.6
[18:42:38] <akoustik> i have a feeling this is going to be frustrating
[18:42:54] <StephenLynx> only ran on centOS 7.
[18:43:05] <chairmanmow> Ahh, that looks like it might be useful, thanks StephenLynx for the tip. Now I need to see what I can do to keep myself busy today if it is indeed a mongoose issue
[18:43:36] <StephenLynx> do w/e you have to do, but with the regular driver :v
[18:44:00] <akoustik> StephenLynx: sorry - do you mean that's what you've run it on, or that's all it *can* run on?
[18:44:21] <StephenLynx> former.
[18:44:43] <StephenLynx> ran it on ubuntu 14 and centOS 7. never experienced with other distros.
[18:44:58] <StephenLynx> I ran on debian 7, maybe. don't remember clearly.
[18:45:06] <akoustik> gotcha, thanks. now why we're running c6 is only known by a guy who's on vacation. haha
[18:45:11] <StephenLynx> lol
[18:45:19] <StephenLynx> maybe he doesn't like systemD
[18:45:42] <StephenLynx> if the server is running nothing but mongo, upgrade it and w/e
[18:46:51] <akoustik> yeah, i can't think of a reason not to... we shall see. so, i'm right in thinking that SSL is not supported pre-3.0, yeah?
[18:47:38] <StephenLynx> it was.
[18:47:47] <StephenLynx> it just had an issue with cross-compiling for a while, if I am not mistaken
[18:48:00] <StephenLynx> so it is missing on some versions of the packaged binaries.
[18:48:20] <StephenLynx> nothing that keeps one from building these older versions with SSL
[18:49:15] <akoustik> ah, maybe that's the way to go. now... i don't wanna push it, but... is there any chance i can expect to get a replica set running with members running different versions of mongo?
[18:49:47] <akoustik> i guess i can just start googling this crap. haha
[19:00:52] <StephenLynx> probably not, but I have never ran replicas.
[19:11:28] <akoustik> yeah i see no evidence that it's possible.
[19:22:26] <jfhbrook> What kind of things can cause mongo to peg the cpu? Mine's at 600% and getting <10 writes per second
[19:24:16] <cheeser> http://docs.mongodb.org/manual/reference/method/db.currentOp/
[19:24:21] <cheeser> run that and see what's running on the cluster
[19:24:27] <cheeser> at least that machine
[19:27:35] <jfhbrook> https://gist.github.com/jfhbrook/796246d74bfcea3f9853 How do I read this?
[19:31:31] <deathanchor> jfhbrook: what are you looking for?
[19:31:41] <deathanchor> oh pegged cpu
[19:31:46] <deathanchor> do a mongostat
[19:31:47] <jfhbrook> deathanchor: any reason why my cpu is pegged and I'm getting <10 writes a second
[19:31:49] <deathanchor> or mongotop
[19:31:51] <jfhbrook> I'm running mongostat
[19:31:56] <jfhbrook> I just don't know what to look for
[19:32:14] <jfhbrook> mostly looks like https://gist.github.com/jfhbrook/06426d4b2509b5c8c7d7
[19:32:44] <deathanchor> ar = active reads
[19:32:53] <jfhbrook> to clarify, this is a single CI instance being used by multiple APIs so the amount of connections is sane
[19:33:14] <deathanchor> 369 connections isn't insane
[19:33:16] <jfhbrook> but when I started writing to this collection I was getting 100+ inserts a second
[19:33:29] <jfhbrook> and it fell exponentially
[19:33:45] <jfhbrook> with short intermittent bursts of 100+ inserts/sec every few minutes
[19:34:44] <akoustik> not sure, but maybe you're using a bad index? or no index? (i don't know exactly how much that impacts write performance)
[19:34:59] <deathanchor> what about your mongotop? the only thing on your mongostat is line 6 had a bit of a lock.
[19:35:12] <jfhbrook> wouldn't indexing mostly slow down reads?
[19:35:31] <jfhbrook> yeah deathanchor I saw the locks but 3% lock doesn't seem too crazy
[19:36:13] <akoustik> jfhbrook: well, that's what i don't know. sorry, i'm not useful :)
[19:36:31] <jfhbrook> https://gist.github.com/jfhbrook/8ce7f9dfeea1de2fd52f output from mongotop
[19:36:41] <jfhbrook> those are really big numbers for the collection I'm writing to
[19:37:04] <deathanchor> jfhbrook: those are terrible reads
[19:37:32] <deathanchor> are you storing files in the documents?
[19:37:37] <jfhbrook> nooooo
[19:37:43] <jfhbrook> documents are relatively small
[19:37:51] <deathanchor> I'd check the iostat on your disks
[19:37:52] <jfhbrook> actually really small, only a few fields
[19:38:55] <deathanchor> what does your db.serverStatus()
[19:38:58] <jfhbrook> not sure what I'm looking for either here https://gist.github.com/jfhbrook/e37d636e0558c9929028
[19:39:10] <jfhbrook> uhh, let's see what it says now
[19:39:13] <deathanchor> iostat looks fine
[19:42:14] <jfhbrook> serverStatus looks like this https://gist.github.com/jfhbrook/d6a1886c119ee3845a94
[19:42:32] <jfhbrook> there are a shitload of dbs on it (multiple apps) so I cut those out
[19:43:19] <deathanchor> recordStats
[19:43:48] <deathanchor> whole lot of pagefaults and reads not from memory
[19:43:52] <deathanchor> is your memory ok?
[19:44:19] <jfhbrook> uhh, let's see what top says
[19:44:29] <jfhbrook> 15136 mongod 20 0 0.449t 0.042t 0.042t S 615.4 72.0 11668:44 mongod
[19:45:01] <jfhbrook> orite and column headers:
[19:45:02] <jfhbrook> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
[19:45:16] <jfhbrook> seeing 't' at the end of those is a new one for me
[19:45:21] <deathanchor> I'd say your mongod is memory deprived.
[19:45:44] <jfhbrook> so why wouldn't it be at 100% memory usage?
[19:45:55] <deathanchor> system processes?
[19:46:06] <deathanchor> how much free mem you have?
[19:46:06] <jfhbrook> nothing worth writing home about
[19:47:51] <deathanchor> jfhbrook: if you used mms, you'd have nice graphs of all the data in that db.serverStatus()
[19:48:01] <jfhbrook> I do have mms
[19:48:05] <jfhbrook> I just don't know how to read it
[19:48:18] <deathanchor> look for things that "high"
[19:48:44] <jfhbrook> also
[19:48:46] <jfhbrook> 457372 free,
[19:48:48] <deathanchor> check the page faults and notinmemoryaccess graphes
[19:49:40] <jfhbrook> This graph shows page faults near 0
[19:50:37] <jfhbrook> in fact, *at* 0
[19:51:43] <deathanchor> well any graph looks elevated or sunken?
[19:52:01] <deathanchor> you can increase the time range to before your issue and after
[19:53:52] <jfhbrook> I see a few things which track with the exponential decay I saw in write perf
[19:54:04] <jfhbrook> network and btree
[19:54:09] <jfhbrook> opcounters
[19:55:41] <jfhbrook> which makes sense given that my writes are limited by how many I can push through---I'm hitting an API and have like 8 in-flight requests at any given time, so low write perf means low throughput
[19:55:47] <morenoh149> anyone working with meteorjs?
[19:56:11] <StephenLynx> hm?
[19:56:18] <StephenLynx> I think they have their own channel.
[19:56:21] <StephenLynx> this isn for mongo.
[19:56:24] <StephenLynx> is*
[19:56:35] <jfhbrook> anyways, nothing in here screams major screwup
[19:57:50] <jfhbrook> I had a few page fault spikes, biggest one at 0.23 (units?) but those are spikes and don't particularly correlate with overall trends
[20:08:58] <morenoh149> I wanted to chat from a mongo pov
[20:09:15] <morenoh149> since mongo is such a critical part of meteor
[20:22:34] <deathanchor> what's the fast way to get the time out of an ObjectId?
[20:23:15] <jfhbrook> okay, so what I know is that my cpu is pegged, my write throughput is outrageously low, mms doesn't think anything is alarming and the disk looks healthy
[20:23:16] <mike_edmr> http://docs.mongodb.org/manual/reference/method/ObjectId.getTimestamp/
[20:23:18] <jfhbrook> what's next?
[20:24:00] <akoustik> jfhbrook: whiskey.
[20:24:22] <mike_edmr> jfhbrook: did you do db.currentOp()
[20:24:26] <mike_edmr> to see whats running
[20:24:32] <mike_edmr> any long running table scans or anything?
[20:25:48] <jfhbrook> hold on
[20:25:53] <jfhbrook> I ran all these things
[20:26:25] <jfhbrook> currentOp https://gist.github.com/jfhbrook/796246d74bfcea3f9853
[20:26:40] <jfhbrook> mongostat https://gist.github.com/jfhbrook/06426d4b2509b5c8c7d7
[20:26:52] <jfhbrook> mongotop https://gist.github.com/jfhbrook/8ce7f9dfeea1de2fd52f
[20:27:05] <jfhbrook> serverStatus https://gist.github.com/jfhbrook/d6a1886c119ee3845a94
[20:51:56] <akoustik> jfhbrook: maybe you already mentioned - are you seeing similar behavior with other collections? did you say that writes used to be fast with this collection, then you started seeing this?
[20:53:46] <jfhbrook> no, no similar behavior with other collections afaik but this is also the only one I'm writing to
[20:53:52] <jfhbrook> when I first started to write to it things were fine
[20:54:05] <jfhbrook> then I got an exponential decay in averaged writes throughput
[20:54:27] <jfhbrook> periods of 100-200 writes per second, then periods of high cpu usage and <10 writes per second
[20:54:41] <jfhbrook> and the latter regime became more and more common until it became entirely dominant
[20:54:51] <akoustik> yeah... so, are there a number of indexes on the collection?
[20:55:21] <akoustik> i'm sure you've seen this, but just in case: http://docs.mongodb.org/manual/core/write-performance/
[20:56:06] <akoustik> the burst behavior you're talking about is pretty weird though, obviously
[20:57:18] <akoustik> you might not be able to, but i'd be curious to see what happens with other interactions. say you remove some or all of the docs in that collection, how does that perform? does it affect performance of subsequent writes?
[21:01:37] <jfhbrook> I have some indices but not an outrageous amount---I believe I index id/revision and maybe mtime
[21:02:43] <akoustik> yeah i wouldn't expect that to be the problem then...
[21:06:45] <akoustik> i wish i had the experience to give better suggestions, but honestly it sounds like you've gone through a pretty good number of tests. at this point, i would just be banging on it until i notice a change of behavior. drop the whole collection, insert a whole bunch of records again, update them, whatever. maybe clone the DB onto a VM or some other host, try it there.
[21:34:21] <greyTEO> has anyone had any issues with the mongo-connector being slow?
[21:54:39] <greyTEO> I think the oplog capped colelction started to pop operations off before mong-connector could process them.
[21:56:28] <ricardodani> a
[21:56:45] <ricardodani> sorry, accident.
[22:11:04] <lxsameer> guys, which one has better performance generally, embeds documents vs references
[22:36:00] <greyTEO> lxsameer, it depends on what type of performance you are looking for. Embeds usually tend to be more write heavy as it will produce duplicate data. References are read heavy requiring more lookups to produce the end result
[22:36:44] <greyTEO> referneces are necessary supported by mongo, that all depends on , im guessing odm, for that performance
[22:36:52] <greyTEO> are not*
[22:37:20] <lxsameer> greyTEO: cloning a document with embeded data should be much easier, right?
[22:39:30] <greyTEO> To me, it would be the best use of mongo.
[22:40:11] <greyTEO> it is a bit harder to maintain and needs proper planning but shoehorning a reference feels wrong
[22:40:23] <greyTEO> my 2 cents
[22:43:34] <StephenLynx> depends on the refernce.
[22:43:59] <StephenLynx> it can be done properly, but depends on how you query, can become a huge clusterfuck and kills your performance.
[22:44:06] <StephenLynx> because you will hit the database like a pinata.
[22:44:14] <StephenLynx> depending on how*
[22:45:02] <StephenLynx> if you hit the database once per collection per operation, is not so bad.
[22:45:43] <StephenLynx> if you have to join data on the application, its awful
[22:53:12] <greyTEO> im a big fan of easy read, heavy writes.
[22:53:46] <greyTEO> makes the application feel much faster usually.
[22:53:54] <StephenLynx> what happens
[22:54:01] <StephenLynx> is that mongo doesn't so much.
[22:54:26] <StephenLynx> from what I understand, its better to make your software read heavy instead of write heavy with mongo.
[22:54:34] <StephenLynx> document locks and such
[22:54:51] <greyTEO> I thought most of that was addressed in 3.0?
[22:55:13] <StephenLynx> hm, my info could be outdated.
[22:55:20] <greyTEO> or that was collection/db locks I might be thinging of
[22:55:21] <Boomtime> "StephenLynx: if you have to join data on the application, its awful" <- this seems to be greyTEO is referring to
[22:56:24] <greyTEO> Boomtime, correct
[22:57:44] <greyTEO> im out. everyone enjoy the weekend.
[22:57:46] <Boomtime> right, doing more work to structure your documents in a way that makes reading eacy is a good idea because you almost always read more often than you write
[22:58:28] <greyTEO> Boomtime, yessir.
[23:45:08] <jfhbrook> so for those of you following at home, I'm an idiot
[23:45:13] <jfhbrook> the reason my perf was so shitty
[23:45:29] <jfhbrook> was due to some idiosyncrasies in how we do search indexing, each write requires at least one get
[23:45:52] <jfhbrook> and due to me not thinking, when I wanted to reset the database so I could try to run my migration script from scratch, I did db.dropDatabase()
[23:45:58] <jfhbrook> guess what happened to my indexes?
[23:46:09] <jfhbrook> the service ensures indexes but only on start
[23:46:17] <jfhbrook> so I kicked one of the nodes and *bam*
[23:46:26] <jfhbrook> it only took me ALL DAY to figure that out
[23:47:27] <StephenLynx> lo
[23:47:28] <StephenLynx> l