PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 4th of October, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:25] <retran> you're welcome
[02:09:16] <iYLee> join #linux
[02:48:41] <bzittlau> I wonder if someone could help shed some light on an issue I'm trying to debug against our Mongo server.
[02:49:17] <bzittlau> We're getting cursor timeouts from the PHP driver which is causing some of our long lived processes to die. We have MMS setup, but I can't seem to connect the dots and figure out what's causing the timeouts to happen.
[02:50:32] <cheeser> maybe mongostat can help?
[02:55:05] <bzittlau> @cheeser any suggestions for particular things I should be watching for
[02:55:06] <bzittlau> ?
[02:55:24] <cheeser> number of connections. lock percentages, etc.
[02:55:29] <bzittlau> unfortunately these drops tend to happen in clumps, not on a consistent basis
[02:55:45] <bzittlau> connection counts are stable, the lock is higher than I'd like to see it (typically around 5%), but it's stable
[02:56:44] <bzittlau> actually right now lock is sitting a bit lower, ranging between 1 and 3%
[02:57:14] <bzittlau> one of the things that's confusing me is the resident memory is sitting at about 25% of the system memory
[02:57:25] <bzittlau> there's nothing else on this server competing for memory
[03:42:52] <platzhirsch> Is it possible to auto-generate _id in $group?
[03:45:17] <cheeser> not afaik
[04:44:19] <platzhirsch> Counting the length of sub arrays is really hard, I want to compute the avg, max, min, etc. pretty hard without $size: $field shipped yet
[06:25:35] <Aric> I have a large JSON array (3+MB) and want to insert it into MongoDB but it does not have any keys and such? though there is an easy pattern to do so? should I manually edit the JSON to add them or is there some tools to insert into MongoDB with rules I specify?
[06:28:15] <Aric> [ [1, 1, "Text here"], [1, 2, "Text here again"], ? [100, 1000, "More text"] ]
[06:28:46] <Aric> I want to insert as chapter: 1, paragraph: 1, text: "text"
[07:15:34] <jeznet1> Hello,
[07:15:34] <jeznet1> I have the following error which I could not find on Google:
[07:15:34] <jeznet1> "[replslave] replication update of non-mod failed:"
[07:15:34] <jeznet1> What does it mean?
[07:28:59] <kosbra> what is differences between sql and nosql?
[07:29:15] <kosbra> what is nosql? why nosql?
[07:31:27] <kali> kosbra: http://en.wikipedia.org/wiki/NoSQL
[07:39:44] <mark____> {"user" : username, "readOnly" : true, "pwd" : password hash}. please explain me this thing readonly:true ???
[07:47:30] <kosbra> what is document database?
[07:50:16] <kali> kosbra: http://en.wikipedia.org/wiki/Document-oriented_database
[07:51:08] <kosbra> kali: thanks
[07:55:23] <alexandernst_> Since I'm able to store 2 files with the same name in GridFS, I'm wondering how can I delete just one of them via it's _id instead by name, as the docs say here: http://mongodb.github.io/node-mongodb-native/api-generated/gridstore.html#gridstore-unlink
[07:55:33] <alvesjnr> hi all; basic question about licensing: may I use mongo-db in a comercial closed source project?
[08:18:32] <mark____> http://pastebin.com/GmCPLMug
[08:21:02] <kali> alvesjnr: http://www.mongodb.org/about/licensing/
[08:34:18] <joannac> malladi: db.addUser(...) on the database youwant to give them access to; whatever role(s) from here: http://docs.mongodb.org/manual/reference/user-privileges/ depending on what you want them to be able to do
[08:34:28] <joannac> oops, mark____: ^^
[08:39:35] <mark____> joannac:???
[08:39:57] <joannac> mark____: look up a couple of lines
[08:40:14] <joannac> the line immediately above the one where I said your name
[08:40:53] <Derick> kali: does that mean you google my things too? :)
[08:41:42] <mark____> joannac:yes but can you please tell me should i have to add user in particular database for giving permission
[08:42:49] <joannac> mark____: Yes, if you want a user to have access in only one database, add that user only in that database
[08:51:39] <mark____> joannac:ok cool
[08:55:12] <mark____> joannac: sometimes i got stuck in small things
[08:58:46] <mark____> joannac: can u explain me mean of thes "readOnly" : false
[09:24:06] <kali> Derick: depends what you ask :)
[09:26:19] <quattr8> I created a sharded collection with a shardkey on _id (hashed), i only store sessions here and only need a key on _id, my insert/findOne queires are slow but my update queries are fast
[09:26:48] <quattr8> update 0.0833ms, insert 3.69ms, fineOne 10.1ms
[09:29:40] <quattr8> this is an explain of the findOne http://pastebin.com/CcdLUvpA
[09:45:11] <mark____> where to find mongodb.conf in ubuntu any idea???
[09:45:33] <Derick> /etc
[09:46:07] <mark____> if unable to find that there?? any idea
[09:47:49] <Derick> you can check with dpkg which files it installed
[09:48:02] <Derick> dpkg -L mongodb
[09:48:08] <Derick> (or in my case dpkg -L mongodb-10gen)
[09:48:26] <mark____> find / -name mongodb.conf done with that
[09:48:27] <mark____> thanks
[09:50:18] <Mastine> Hello!
[09:50:35] <joannac> hey Mastine
[09:51:14] <Mastine> Can someone give me a hand with an aggregation thing ? :)
[09:52:40] <Mastine> http://pastebin.com/MxqinGVF
[09:53:40] <Mastine> I have this collection, and I try to authenticate a client. My aggregation works fine, but returns only the "login" array. I would like to retrieve the _id / company of the root object. But I can't find how =/
[09:55:18] <joannac> Add them in your $project step?
[10:03:17] <mark____> http://pastebin.com/s2qvZz3h#! the error is after starting making connections with database,iwithin seconds,it closes automatically.with that my browser page contents which have to come from database doesnt come
[10:04:03] <joannac> mark____: show us your code?
[10:04:32] <Mastine> Someone got an idea for my aggregate thing? :)
[10:04:47] <joannac> Mastine: Add them in your $project step?
[10:05:10] <Mastine> I thought about this, but I didn't managed to =/
[10:05:34] <joannac> mark____: there are no errors in your mongod.log
[10:12:12] <remonvv> \o
[10:12:18] <Mastine> o/
[10:12:19] <ron> o/
[10:13:05] <remonvv> I have to wonder which 10gen engineer was in charge of the bit that calculates write lock %
[10:13:09] <remonvv> Hey ron, how are you?
[10:13:19] <ron> remonvv: crappy, you?
[10:13:29] <ron> remonvv: what's 10gen?
[10:13:29] <remonvv> "I'll have you know the write lock was taken a full 267% of the time"
[10:13:38] <remonvv> Oh right "MongoDB Inc."
[10:13:42] <ron> :p
[10:13:48] <remonvv> Although, probably at the time of coding that, 10gen.
[10:13:56] <remonvv> Well, I'm not crappy.
[10:14:53] <ron> well, good for you.
[10:15:06] <remonvv> Mhm, still haven't settled on a career path then?
[10:15:36] <ron> nope
[11:03:22] <Mastine> This aggregate thing is driving me crazy :(
[11:20:50] <kali> Mastine: what about that: http://pastebin.com/SicVfhgs
[11:23:14] <Mastine> Oh
[11:24:04] <Mastine> Thanks kali! I tried this one before, but I didn't put the $_id on the project. So that was the way to do it..
[11:48:24] <platzhirsch> I am having a hard time with the aggregate framework. Is it even possible to compute the average length of an array field over a collection?
[11:58:54] <mark____> joannac: are you there?
[12:11:14] <themapplz> Kali u dere?
[12:17:34] <kali> yes
[12:22:37] <themapplz> Hi all - I'm in need of some help with map/reduce.
[12:22:38] <mark____> hey kali can you help me out to solvee my problem
[12:23:22] <themapplz> thanks for the code yesterday - i tried to elaborate further, but it's still a bit confusing to me
[12:23:43] <themapplz> function() {
[12:23:43] <themapplz> emit(1, { count: 1} );
[12:23:43] <themapplz> }
[12:23:54] <themapplz> reduce:
[12:23:58] <themapplz> function (key, values) {
[12:23:58] <themapplz> var result = {count: 0, length: 0};
[12:23:58] <themapplz> for (var i = 0; i < values.length; i++) {
[12:23:59] <themapplz> result.count += values[i].count;
[12:24:01] <themapplz> }
[12:24:03] <themapplz> result.length = values.length;
[12:24:05] <themapplz> return result
[12:24:07] <themapplz> }
[12:24:40] <themapplz> why is it that result.count turns out to be 42874 and result.length is only 784
[12:25:34] <kali> a few ground rules on IRC guys: 1/ never paste more than two lines of codes on the #. 2/ don't adresse somebody in particular, many people can help
[12:26:31] <themapplz> ok - got it
[12:26:33] <themapplz> sorry
[12:27:17] <kali> themapplz: that's because you haven't listen to me yesterday: your data can go through reduce() 0 to N times
[12:28:03] <themapplz> can or will ?
[12:28:10] <kali> can and will
[12:28:32] <kali> mongo decides
[12:29:19] <themapplz> emit emits once, but reduce reduces valaues.length times?
[12:30:24] <kali> themapplz: http://docs.mongodb.org/manual/reference/command/mapReduce/#requirements-for-the-reduce-function
[12:31:32] <mark____> http://pastebin.com/s2qvZz3h#! the error is after starting making connections with database,iwithin seconds,it closes automatically.with that my browser page contents which have to come from database doesnt come
[12:31:53] <kali> mark____: i have no idea what you're talking about.
[12:31:56] <kali> mark____: wait.
[12:32:10] <kali> mark____: are you trying to access mongodb with your brower ?
[12:32:41] <mark____> Kali:yes,actually the dynmically data to be loaded from the mongodb on browser
[12:34:15] <mark____> Kali: why in the end it refuses the connection? the content to be loaded in browser is to be come from mongodb,but suddenly mongodb ends the connection ?
[12:36:47] <kali> mongodb is not meant to be acces from a browser
[12:37:46] <themapplz> thanks for the link but damn i find it so confusing. does it mean that it will rerun the reduce function if the output is the same as the previous input?
[12:38:50] <mark____> kali:then that means i am not been able to dynamically load data from the database.
[12:40:01] <mark____> kali:can i ask you why?
[13:00:50] <remonvv> mark____: What he's saying is there should be some sort of tech stack between mongo and your browser.
[13:01:15] <mark____> remonvv:means
[13:09:16] <Takumo> Should the mongod binary be 314M if compiled from source?
[13:09:21] <Takumo> seems oddly large for a binary
[13:10:08] <cheeser> on windows?
[13:10:19] <Takumo> Linux
[13:11:06] <cheeser> it's nowhere near that big on OS X
[13:11:23] <cheeser> you probably built it with debug symbols
[13:11:27] <Takumo> probably did
[13:49:22] <platzhirsch> Is there an alternative to map reduce when it comes to counting the array lengths of documents?
[13:49:32] <themapplz> I'm trying to wrap my head around map and reduce as a very constrained query returns 40000+ records. now in order to grab only every 5th record i'm told i should use map/reduce. is there a better way?
[13:52:52] <platzhirsch> themapplz: I wish I knew, but I don't see how this would work in the aggregate framework
[13:56:09] <themapplz> platzhirsch: thx.. are ppl here only pm'ing? thought people were here to discuss (and help)
[13:56:24] <cheeser> if you want every 5th you'll have to use m/r or get a cursor and iterate it manually
[13:56:40] <platzhirsch> themapplz: that's often the case, depends on the time :)
[13:56:54] <cheeser> traffic varies during the day
[13:57:00] <themapplz> thx cheeser .. which is faster?
[13:57:18] <cheeser> depends on the size of your data. it may not matter.
[13:57:31] <themapplz> my db has ~400M docs and might need to iterate through a whole lot
[13:57:40] <cheeser> iterating the cursor will pulling *all* the data over the query returns only to discard 80% of it.
[13:57:52] <themapplz> exactly
[13:57:52] <ekarlso> 7win 50
[13:58:09] <cheeser> on the other hand, i don't think m/r supports cursor based output so you'll be limited to 16MB responses, iirc.
[13:59:41] <themapplz> im at a standstill here.. the db is huge and querying all data, however constrained, is not suitable for graphic visualisation. i need to reduce, and figured every Nth value by map reduce is the way to go.is that correct? anbd if so
[13:59:48] <themapplz> how do I move on?
[13:59:59] <cheeser> use m/r and move on would be my advice
[14:00:13] <cheeser> i mean, if m/r works for you why not?
[14:00:20] <themapplz> i am
[14:00:29] <themapplz> but i'm a beginner here with this
[14:01:00] <themapplz> and even though i thought i knew js quite well my m/r function rerturns only bullshit
[14:05:48] <Mastine> To retrieve, for each document, the latest inspection from this DB : http://pastebin.com/kU0Ct9sJ
[14:05:59] <Mastine> From this DB: http://pastebin.com/X00PuAi1 **sorry
[14:06:15] <Mastine> Is this aggregate good enough (it works), or can I do better? http://pastebin.com/kU0Ct9sJ
[14:08:03] <themapplz> here is the so far simple code i'm working with:
[14:08:03] <themapplz> http://pastebin.com/jJmuWbBR
[14:09:25] <themapplz> just to try and make an average on val
[14:09:51] <themapplz> still don't see what it is i'm doing wrong
[14:15:57] <platzhirsch> For map-reduce to count array lengths, do I need to loop over the array and emit 1 in the map function or can I invoke count() somehow?
[14:16:26] <cheeser> i thought there was a count function for arrays
[14:17:05] <platzhirsch> cheeser: where? There is a new aggregation upcoming $size, which can read the size of an array, but apparently we won't see that before 2.6
[14:24:47] <cheeser> on the Array "object" (not a js guy...)
[14:25:06] <platzhirsch> Oh, yes. That's true, you can call length()
[14:26:02] <platzhirsch> well, rather a propery
[15:15:15] <platzhirsch> okay, lesson learned. If I want to gather sophisticated statistics about my data, I better start to manage some extra variables that get incremented
[15:15:33] <tomasso> getting to explore an mongodb.. is there any gui tool for linux?
[15:18:15] <cheeser> tomasso: there's this list: http://docs.mongodb.org/ecosystem/tools/administration-interfaces/ and my own ophelia http://www.antwerkz.com/ophelia
[15:18:32] <tomasso> wow xD
[16:24:58] <slava> does 10gen make special builds of MongoDB for anyone?
[16:28:09] <cheeser> what'd you have in mind?
[16:29:41] <slava> cheeser: complaining about possibly having to support weird things that might not be documented. :P
[16:32:00] <slava> turns out dbHash is a bad way to get non-system non-hidden collection names ... when your DB is ~30GB
[17:10:26] <knownasilya> what's the best way to handle opening the db connection? open once and do everyting? open multiple times? open and close multiple times?
[17:12:03] <kali> let the client do its thing
[17:12:41] <knownasilya> kali: are you talking to me?
[17:12:47] <kali> yes :)
[17:13:00] <knownasilya> can you expound on what you said..
[17:13:33] <kali> what language are you using ?
[17:13:40] <knownasilya> JS with Node
[17:15:39] <kali> well, with normal stuff, you create an instance of MongoClient once and for all, and it manages connection pooling behind the scences
[17:15:47] <kali> with the node clients, i have no idea
[17:16:19] <knownasilya> kali, do you have any links to examples with that format? I mainly see using Db(..., Server), and db.open()
[17:19:31] <kali> i don't
[17:21:01] <knownasilya> kali, found this one http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html it says you can use MongoClient.db afterwards? (is the mongoClient.close() in the callback just for example?)
[17:28:55] <venturecommunist> if i have a collection where there's a field 'color' that could be red, green or blue, and red, green and blue entries are all timestamped with a 'timestamp' field, is there a query i could do that would return a single cursor populated with the latest red, the lastest green and the latest blue?
[17:33:25] <doxavore> is there a way to tokenize the values out of system.profile documents to get an idea of how many times (and total/avg time) a query with a particular shape took, even when its exact arguments don't match?
[17:34:36] <doxavore> that is, not for a particular query, but some way to get a list of "spent Nms over M calls querying by name and age"
[17:38:00] <venturecommunist> might aggregation framework operators be the answer to my question?
[17:39:15] <kali> venturecommunist: you'd better run three queries
[17:39:57] <kali> venturecommunist: but, yes, i think you may be able to do it with aggregation (but it will probably less efficient)
[17:40:33] <venturecommunist> what's the difference running with three queries? and will i still get a single mongo cursor at the end?
[17:41:19] <kali> if you have the right indexes (color, timestamp, in this order), it's jsut three lookup. with aggregation, you will access the whole collection
[17:41:40] <kali> s/indexes/index/
[17:43:52] <venturecommunist> if i had 10,000 colors i suppose aggregation would become important?
[19:17:42] <platzhirsch> So I want to access my documents over another field, rather than directly through the identifier. So I add a single field index to speed up the queries, have I got that right?
[19:18:53] <cheeser> you want to query your collection using an arbitrary field rather than the _id, yes?
[19:19:03] <cheeser> so, yes, you'll want an index on that field
[19:20:24] <platzhirsch> thanks :)
[19:20:29] <cheeser> np
[19:20:53] <platzhirsch> really wonder if it makes so much sense to not use a custom identifier key anymore
[19:21:28] <cheeser> i've never understood the attraction. except for xref'ing to external systems, you shouldn't care what your PK is.
[19:23:33] <platzhirsch> I would say it's about getting the model right and a sound domain modelling
[19:26:28] <cheeser> the id is rarely part of the model
[19:27:21] <platzhirsch> For rel. databases I learned that having a natural key is a good thing
[19:27:40] <cheeser> i've never needed one.
[19:27:46] <cheeser> the id has never, ever mattered.
[19:29:11] <cheeser> off to a meeting.
[19:50:30] <tylere> Are non-short key names still an issue in newer mongos?
[19:50:56] <tylere> I know that with older versions they could waste a LOT of space on larger collections
[19:53:20] <leifw> still an issue in mongo
[19:53:45] <leifw> is that a problem for you?
[19:57:10] <leifw> http://www.tokutek.com/2013/08/tokumx-tip-create-any-field-name-you-want/
[20:53:56] <rafaelhbarros> hello guys... out of the blue, one of my mongodb instances went insane and started consuming all my cpu
[20:53:59] <rafaelhbarros> what the hell?
[20:54:04] <rafaelhbarros> how do I debug this?
[20:54:20] <dmizzle> Hey all, I'm using mongodb/pymongo in a project. Which ORM-type layer do you recommend?
[20:54:46] <rafaelhbarros> dmizzle: none =)
[21:17:17] <cha0ticz> Having an issue with sharded replica sets. I've setup the entire cluster but I saw that all of my data is still going to just one shard. Looking into it further I see the following error in my mongo log: [Balancer] moveChunk result: { errmsg: "exception: no primary shard configured for db: config", code: 8041, ok: 0.0 }
[21:17:44] <cha0ticz> everything i've searched so far says it may be due to all shards being able to reach all others and the config servers but I just went through each one and was able to connect to everything via the mongo shell
[21:17:53] <cha0ticz> running out of ideas what may be going wrong =/
[21:39:43] <Zeeraw> Anyone around?
[21:40:16] <Zeeraw> I'm still experiencing major issues with DataFileSync
[21:40:44] <Zeeraw> It takes me between 10 to 45 seconds to flush the mmaps to disk
[21:41:19] <Zeeraw> Is there any way I can diagnose this?
[21:44:06] <dfarm> Hey guys, looking for a little update help say I have a bunch of documents like: {'a': 2.2, 'b': 1.3, 'c': 5.3} and I want to add a total field. I know it's pretty basic but I'd appreciate any help.
[21:44:46] <dfarm> I've tried doing an update with something like {'total':{'$add': blah} but that doesn't work apparently because the result isn't a document
[22:22:47] <Zeeraw> https://gist.github.com/Zeeraw/1cd34d955b405f4c0278
[22:23:39] <Zeeraw> I honestly don't get what's wrong...
[22:36:48] <JFrame> Hi guys :D
[22:40:15] <JFrame> Is it possible to get all values of a key, like an array? (I'd like to search if there's more than one value of that key)
[22:58:11] <neeky> JFrame, well documents can store arrays but i'm not sure that's what you are asking
[22:58:22] <JFrame> for example
[22:58:29] <JFrame> i have 10 entries
[22:58:35] <neeky> are you looking for docs in a collection based on a key?
[22:59:04] <JFrame> {a:2} {a:2} {a:3} {a:4} {a:6} {a:4}
[22:59:16] <JFrame> and I'd like to get, 2 is repeated 2 times, and 4 is repeated 2 times too
[22:59:30] <neeky> you need an aggregation operator
[22:59:52] <neeky> that will group by the 2's and 4's and give you a count of how many, etc
[23:00:13] <JFrame> could you link an example or something?
[23:00:55] <neeky> http://docs.mongodb.org/manual/core/single-purpose-aggregation/
[23:01:12] <neeky> righ on the mongo do page for aggregation is your example
[23:01:47] <neeky> and SO has a ton of questions and answers on aggregation, grouping, etc
[23:03:01] <JFrame> yep, thanks, i didnt know where to start searching!
[23:03:26] <neeky> yeah, it took me a bit too, especially when i had just come from the sql world
[23:04:58] <JFrame> me too, i started yesterday with mongo
[23:30:13] <rafaelhbarros> I need help, quickly if possible
[23:30:21] <rafaelhbarros> I have 3 nodes mongo replica
[23:30:27] <rafaelhbarros> with barely any content
[23:30:35] <rafaelhbarros> about 160k documents, all of them small
[23:30:46] <rafaelhbarros> and pymongo is taking forever to connect to the mongo replica
[23:35:29] <rafaelhbarros> 1 minute