PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 10th of January, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:09:23] <sahat> Hi, we have a Mongoose collection that has a field of type array which references another collection. If we are going to remove an item from that array, will it also delete a reference from another collection like SQL and ForeignKey ?
[00:09:34] <sahat> E.G. Game collection has comments array field which references Comment schema. If I delete an item from comments array, will it also delete that object from Comments collection?
[00:37:56] <pottersky> hello ppl :)
[00:38:03] <pottersky> whats best, CouchDB or MongoDB? :D
[00:38:29] <Zelest> whatever suits your needs the most.
[00:38:37] <Zelest> try both and decide for yourself.
[00:38:46] <pottersky> oh maan, so many things to try :P
[00:38:58] <Zelest> "so much fun, so little time" :-)
[00:40:10] <pottersky> ahahah yeah
[00:41:21] <pottersky> just watched a video on CouchDB App (CouchApp)... looks a bit of an overstretching to me
[00:41:39] <pottersky> u know if theres something similar on MongoDB landscape?
[01:15:43] <thelinuxkid> Shameless HN plug: I created a Python project called Gumjabi that ties the Ping API with Kajabi and it's mentioned in the article. Please upvote. http://news.ycombinator.com/item?id=5033820. Thanks!
[03:24:18] <wereHamster> no.
[03:35:37] <gjaldon> hi there! i'm following the guide on "getting started with mongodb javascript shell" here:http://docs.mongodb.org/manual/tutorial/getting-started/#create-a-collection-and-insert-documents
[03:36:24] <gjaldon> but I'm getting an error when trying to do the 'Insert multiple docs using a for loop'
[03:36:38] <gjaldon> for (var i = 1; i <= 20; i++) db.things.insert( { x : 4 , j : i } )
[03:37:02] <gjaldon> the error I get: SyntaxError: invalid XML name (shell):1
[03:38:21] <gjaldon> nvm, looks like the spaces matter..lol
[03:48:37] <Guest_1448> is it safe to run repairDatabase() on a "live" database?
[03:59:42] <Kane`> having some troubles with compound indexes. http://codepad.org/yJFtIPJV - the output of .explain() shows they're not being used in the query :/
[04:05:16] <IAD> Kane`: try an {mac, site, metadata.date} or {site, mac, metadata.date} index
[04:08:07] <Kane`> IAD, {mac, site, metadata.date}? not {metadata.mac, metadata.site, metadata.date}?
[04:14:47] <IAD> Kane`: you are right {metadata.mac, metadata.site, metadata.date}
[04:14:52] <Kane`> http://codepad.org/5FDyOgKM
[04:15:05] <Kane`> same thing. no indexes being used
[04:15:08] <Kane`> (tried both suggestions)
[04:17:31] <Kane`> it seems if i run the same query within mongo's shell, indexes are used perfectly http://codepad.org/8ScHBsHk
[04:17:32] <Kane`> ._.
[04:24:46] <Kane`> ah. i see where i dun goofed
[04:25:09] <Kane`> was querying with: find({'metadata': {'date': , 'site': , 'mac': }})
[04:25:31] <Kane`> instead of find({'metadata.date': , 'metadata.site': , 'metadata.mac': })
[04:36:04] <Guest_1448> so if I do a lot of .inserts() (with write concern 0) then .count() afterwards, it seems my count() waits until all the inserts are done
[04:36:23] <Guest_1448> can I rely on this?
[04:36:29] <Guest_1448> and where can I read about this?
[04:36:45] <Guest_1448> I can't really find much info about it in all the 'fire and forget' talks
[04:41:51] <limpc> im getting an "unauthorized" error when I try to execute db.printShardingStatus() -- what am I missing?
[04:42:13] <limpc> I setup shards with keys and start instances with --auth
[04:42:20] <limpc> im connecting to localhost
[05:24:02] <limpc> mongos> show collections;
[05:24:02] <limpc> Wed Jan 9 23:22:52 uncaught exception: error: { "$err" : "socket exception", "code" : 11002 }
[05:24:05] <limpc> why do i get that?
[05:40:09] <jrule> hello... I have a question anyone out there?
[05:52:49] <nemothekid> .
[05:54:08] <nemothekid> I was wondering are there any performance issues to worry about when dealing with large documents, with many indexes, or would it be wiser to simply split them into several collections
[05:54:36] <nemothekid> From a mongo perspective, transfer speed isn't important
[06:07:01] <crudson> nemothekid: that's hard to answer without knowing specifics, but normally I'd say unless index sizes are becoming a real problem keep the data logically connected
[06:10:48] <josh-k> hi guys, i need some help fixing an issue with mongodb on Travis CI (i am from the Travis team)
[06:11:21] <josh-k> we are changing to a new VM setup, and since moving to it mongodb won't start and we get this error in the logs https://gist.github.com/0c5491a1f24f83316db6
[06:12:39] <nemothekid> crudson: Thanks, I thought so. the data I have is often queried together and is hardly ever updated, however I'm expecting the collection size to eventually grow to the 10s of millions, and we have other collections like this but they are relatively small. All in all we just don't want to effect query time
[06:14:06] <crudson> josh-k: does /var/lib/mongodb exist with correct permissions? That's ignoring the glaring warnings above regarding 32bit and using OpenVZ.
[06:14:56] <josh-k> /var/lib/mongodb exists, with one file in it: -rwxr-xr-x 1 mongodb nogroup 6 Jan 5 03:37 mongod.lock*
[06:15:57] <crudson> nemothekid: indexes on 10s of millions are fine.
[06:16:04] <crudson> josh-k: did you remove the old lock file?
[06:16:06] <josh-k> it seems like this lock file is old and has been around since the template was created
[06:16:17] <josh-k> we use chef to provision mongodb
[06:16:23] <josh-k> and it should have shut it down gracefully
[06:22:04] <josh-k> crudson: so i am not sure why either the lock file persists or the service is not shutdown gracefully
[06:29:48] <josh-k> crudson: does this chef recipe look correct to you? https://github.com/travis-ci/travis-cookbooks/blob/master/ci_environment/mongodb/recipes/server.rb#L37
[06:30:25] <josh-k> crudson: we just confirmed that stopping the mongo service does not remove the lockfile
[06:31:07] <crudson> josh-k: does the process go away from ps and no longer shown in netstat?
[06:31:12] <crudson> brb
[06:31:16] <josh-k> i'll check
[06:32:44] <josh-k> crudson: not in ps, not in netstat
[06:40:39] <sent-hil> does dropping a table drop the indexes?
[06:59:38] <jrule> loading simple 1 column file with a header line using mongoimport tsv format into a new collection. every row except the first throws an error complaining aobut a duplicate _id_. insert local.huh keyUpdates:0 exception: E11000 duplicate key error index: local.huh.$_id_ dup key: { : null } code:11000 locks(micros) w:68 0ms How do I get mongo to generate a new ID for each row loaded.
[07:00:46] <jrule> the file looks like my-id\n1\n2\n3\n etc... the \n are real line feeds just used for examplehere.
[07:01:30] <crudson> jrule: are you using 1) --drop or 2) --upsert?
[07:03:37] <jrule> it was a new empty collection. I get the same results for -drop and for -upsert options
[07:04:00] <jrule> sorry --drop and --upsert
[07:06:02] <jrule> the result is the first record inserts all the rest of considered dups b/c the ID column is being loaded as null
[07:07:58] <crudson> if the id col isn't unique then strip it out first or exclude it
[07:08:42] <jrule> there is only one column in the table and that is unique there are 10 rows and the values are 1.10
[07:08:47] <jrule> 1 to 10
[07:09:09] <jrule> sorry 1 column in the input file, not the table. don't mean to be confusing.
[07:10:18] <jrule> It looks like mongoimport is generating a null internal id for each row from the log .. The column with the null value is not my column name I am giving
[07:16:11] <crudson> can you create a paste of the first 5 lines or so - I am running a db update so my server is locked now but can try it when this completes (whenever that will be!)
[07:32:10] <jrule> here is the example: http://pastebin.com/CuCV41Jv
[07:32:33] <jrule> mongo version 2.2.2
[07:32:56] <jrule> I have the same problem on osx and Centos running this version
[07:37:19] <jrule> you only see the error above when running the server with the --verbose option turned on w/o it the loads say the all succeeded but only one record is actually loaded.
[07:53:52] <bigmeow> hi all:)
[08:06:03] <remonvv> \
[08:06:05] <remonvv> o
[08:09:14] <NodeX> \\o//
[08:10:54] <jrule> crudson... I just fired up an older version of mongo 2.0.6 on amazon and tried the example, works fine
[08:11:31] <jrule> I think upgraded that test instance to the latest 2.2.2 does not work. I think I need to open a bug with the for this... Do you know how to do that. Never done a bug.
[08:11:51] <jrule> I think = I then..
[08:11:56] <NodeX> goto mongodb jira and report it, it's fairly easy
[08:12:21] <jrule> thanks NodeX
[08:12:29] <NodeX> https://jira.mongodb.org/secure/Dashboard.jspa
[08:12:31] <crudson> it's straightforward jira.mongodb.org
[08:12:54] <crudson> don't be shy :) but search first for any existing matching issues
[08:13:12] <jrule> ok... will do a quick serch.
[08:13:17] <jrule> search.
[08:29:27] <remonvv> Issues, issues everywhere..
[08:47:04] <chrisq> NodeX: remember my tracks/albums in mongodb? now i need to store playlists as well, any ideas?
[08:48:49] <[AD]Turbo> hola
[08:49:39] <NodeX> chrisq : a new collection I would suggest
[08:54:37] <chrisq> NodeX: that collection would hold documents with id's from the albums/tracks collection though?
[08:55:23] <chrisq> as rights and such keeps getting updated, i' prefer not copying the tracks into the playlist documents
[08:55:35] <chrisq> or would that in fact be easier/better?
[09:25:29] <NodeX> chrisq : it depends on your access patterns
[09:25:38] <NodeX> again track names and album names dont change
[09:25:58] <NodeX> therefore there would be no renaming updates which makes referenced id's pointless
[09:46:35] <kali> "therefore"
[09:46:38] <kali> il like this one
[09:46:43] <kali> "furthermore" too
[09:52:28] <jwilliams_> i execute map reduce js with the command `mongo mydb my.js` where contains statement db.collection_name.mapReduce(m,r,{out:"tmp_output", sharded: true}); but mongo throws exception saying "unknown m/r field for sharding: sharded"
[09:53:03] <jwilliams_> what should i passed in so that mapreduce can dump to sharded output ?
[09:53:29] <jwilliams_> checking doc (http://docs.mongodb.org/manual/reference/method/db.collection.mapReduce/#db.collection.mapReduce) sharded:true should be the right syntax.
[09:59:50] <chrisq> NodeX: tracks and albums dont change, but our rights to play them do. So i need to do a lookup somewhere to find if we're currently allowed to play each track in a playlist
[10:29:09] <Gargoyle> With the aggregation framework, is it possible to get the "top x" in a group? For example, lets say scores groupped by category and there are 20+ scores in each category, can you get it to limit to the top 5 in each category grouping?
[10:31:51] <kali> Gargoyle: yes. group, then sort, then limit
[10:32:02] <Gargoyle> sweet!
[10:35:50] <kali> Gargoyle: well, thinking of it, i'm not 100% sure it will work. try it, and tell me :)
[10:36:20] <Gargoyle> kali: I thought that might limit the whole result to 5. Just coding it up now! :)
[11:06:33] <NodeX> Gargoyle : you can sort it then chop off the top X results with your langauge
[11:06:44] <NodeX> not sure you can limit individual groups or nt]
[11:06:46] <NodeX> not*
[12:27:21] <rawler> hi..
[12:28:21] <NodeX> ..hi
[12:28:28] <rawler> could someone please explain why the upper bound of my search criteria isn't used? http://pastebin.com/z8EAwucG
[12:29:11] <kali> rawler: ho, yes, i can :)
[12:29:33] <kali> haaa, oups, not the bug i thought
[12:29:35] <kali> lemme see
[12:29:40] <rawler> kali: please do.. :)
[12:29:49] <NodeX> did you hint it?
[12:30:01] <NodeX> it could be getting confused with the flipped index at the bottom
[12:30:08] <NodeX> flipped/inverse
[12:30:18] <rawler> NodeX: I've tried with the other index not present..
[12:30:19] <kali> NodeX: that won't change it... it picks the right index, but choose not to set an upper bound
[12:31:08] <kali> rawler: it's certainly because part of the index is multiple, i had a similar case but the value that was unbounded was the source of the multiplicity, so it's not exactly the same
[12:31:12] <kali> rawler: lemme find the jira
[12:32:22] <rawler> kali: I've seen something like that, but IIRC, that was an ancient bug?
[12:32:27] <kali> https://jira.mongodb.org/browse/SERVER-4180
[12:32:36] <rawler> don't recall if it was supposedly closed though..
[12:32:45] <kali> rawler: they "closed" it, but it's not actually resolved
[12:33:05] <NodeX> blame ron
[12:33:47] <kali> rawler: so i have a ugly patch to force the optimizer to setup the up bound on this specific index
[12:34:31] <rawler> oh, that's just not gonna fly here.. :S I highly doubt operations will accept that kind of monkey-patching on the DB-level..
[12:35:21] <kali> rawler: yeah, i am "operations" here too, so i at least i can do whatever the fuck i need :)
[12:35:37] <rawler> just for my understanding, is the problem that there are multiple _keys_ in the index, or that 'pricings.parent_id' is kindof an array?
[12:36:35] <kali> rawler: yes, in that case, the index is tagged as "multikeys", and the optimizer have to ignore some boundaries not to break some requests
[12:37:19] <kali> rawler: it would be better if the metadata info was in the form of "pricings.parent_id is multi" instead of a single boolean for the whole index
[12:37:30] <kali> rawler: but that was too big a patch for me
[12:38:02] <rawler> *ahh* it considers the _entire_ index as multi? that's just wrong.. :)
[12:38:39] <kali> rawler: feel free to open a new jira, link mine for references and give me the id so that i can vote on it ;)
[12:39:48] <kali> rawler: i hate to say this, but i am not happy with the way 10gen has deal with this issue
[12:40:16] <rawler> why not just reopen the one that is there? it's clearly a serious issue, and it's really unresolved?
[12:41:29] <kali> because i can't :)
[12:42:27] <rawler> the ability for embedded documents and indexes of them were the whole reason for us to evaluate mongodb for this application.. if the functionality is broken in this way, I guess I'll have to keep fighting with the current MySQL setup.. :S
[12:44:51] <kali> i can't blame you if you don't but i think it could help me a lot if you wrote that to a jire
[12:44:54] <kali> jira
[12:54:15] <HDroid> Will a DBCursor load each document entirely or is it lazily fetched? Trying to iterate over all keys, but at that stage I don't need the documents' contents yet.
[12:54:18] <HDroid> (java lib)
[12:56:54] <NodeX> http://www.mongodb.org/display/DOCS/Queries+and+Cursors
[12:58:00] <Derick> HDroid: from the PHP side, we do this: http://derickrethans.nl/cursors-in-mongodb.html
[12:58:07] <NodeX> The default batch size to a cursor is 101
[12:58:51] <Zelest> Derick, might be a bit random thing to ask, but when is 2.4 estimated to be released? :o
[12:59:03] <NodeX> oo batchSize() is pretty sweet
[12:59:15] <NodeX> same some memory and overhead
[13:00:43] <Derick> Zelest: I can't comment on that, sorry
[13:00:54] <Derick> (mostly because I don't know myself)
[13:01:23] <HDroid> Ok, so the cursor itself is lazy, but is there a way to get the keys without loading entire documents?
[13:01:28] <Zelest> I'm very curious about how the "search for phrases" thing works.
[13:01:31] <Zelest> As I believe it doesn't.
[13:01:47] <Derick> HDroid: no
[13:01:59] <Derick> HDroid: you can do two queries though
[13:02:15] <Derick> one with just a projection to get just the fields you want, and then another one for the full docs
[13:02:24] <Derick> you'll have to beanchmark what's faster though for your case
[13:03:13] <rawler> kali: here you go; https://jira.mongodb.org/browse/SERVER-8135
[13:04:01] <Zelest> Derick, If I setup a single MongoDB server and do nightly dumps of it.. is that enough for production use?
[13:04:34] <Derick> Zelest: I'd say so - I think the next version to come out (soonish) is 2.4.0rc0
[13:05:41] <NodeX> Zelest is horny for 2.4 lol
[13:05:47] <Zelest> oh yes!
[13:05:52] <geekie> o/
[13:05:58] <geekie> Zelest: ;) (Michelle)
[13:06:11] <Zelest> ooh!
[13:06:12] <Zelest> o/ geekie
[13:06:46] <NodeX> we're overrun by Scandinavians!
[13:06:50] <NodeX> hide ! :P
[13:07:03] <geekie> lol
[13:07:21] <HDroid> Derick: thanks, I'll play with that.
[13:07:47] <Derick> geekie: started to use mongodb now?
[13:08:12] <Zelest> Derick, I'm trying to convert her! :)
[13:08:15] <rawler> NodeX: don't worry.. we're not axe-wielding invaders in longboats anymore.. *REALLY*
[13:08:17] <Derick> yay
[13:08:25] <NodeX> \o/
[13:08:33] <geekie> Derick: Well, I'm going to! :)
[13:08:48] <geekie> Not for my dayjob tho would never work but I can see the advantage for other projects I'm working on! :)
[13:08:52] <NodeX> I have a few friends in Sweden, all met on Irc, very strange how life is!
[13:09:27] <kali> rawler: thanks
[13:09:28] <geekie> NodeX: we're quite found of irc :>
[13:09:50] <NodeX> tbh I am not surprised, Sweden is cold what?
[13:10:11] <rawler> NodeX: compared to hell, yes..
[13:10:33] <rawler> NodeX: compared to pluto, noope.. :D
[13:10:50] <geekie> Plus Derick, they will most likely include MongoDB in a unicourse, I might take it for fun and let you know how they screw up ;)
[13:11:38] <Derick> ah, cool
[13:11:48] <rawler> geekie; great idea.. :)
[13:11:55] <rawler> KTH?
[13:12:19] <NodeX> Mongodb in university?
[13:12:25] <geekie> BTH
[13:13:26] <rawler> geekie: oh, then they'll REALLY screw it up.. :)
[13:13:50] <geekie> haha
[13:13:53] <NodeX> javascript is so dumb sometimes
[13:14:01] <geekie> actually, their latest courses are quite good
[13:14:12] <geekie> Studying some for points now, their phpmvc is decent
[13:14:37] <geekie> I mean, not perfect
[13:14:40] <geekie> http://dbwebb.se/
[13:14:56] <geekie> But more than you expect :)
[13:15:00] <NodeX> var fb='someFunctionName'; fb.call(); <--- works .... var fb='some.dotted.function.name'; fb.call(); <---- fail
[13:15:08] <rawler> oh? about time.. last year I spent there were mostly a waste of time, and from what I heard at least the next few years wasn't much better..
[13:15:41] <rawler> oh, well.. ah bit OT for the channel, I guess.. :)
[13:15:52] <geekie> (I don't know how OT chat is in here, are you in other chans?)
[13:15:57] <NodeX> the trouble with learning to programme at uni is you get some other person's idea on how programming should be done
[13:16:33] <geekie> NodeX: Yeah, in this case, I teached my teacher some told him "Ok this is how I wanna do it" and he said "Fine, do it."
[13:16:35] <NodeX> which generaly makes for BAD design choices and even worse security/performance
[13:17:39] <rawler> NodeX: well, the main problem at BTH at the time was that they spent an ABSOLUTE minimum on paying teachers.. so they only got people that really would not qualify for a real programming job.. *tm*
[13:17:45] <rawler> (dunno about today though)
[13:18:29] <geekie> rawler: Now the ONLY thing that makes the course is the teacher Mikael Ros, he's dedicated in what he does and he loves to discuss solutions on irc and a great ballplank for my ideas.
[13:19:14] <rawler> oh, I think he was there while I were there too.. I remember his name, but not much more..
[13:19:51] <rawler> is betty still there?
[13:20:19] <geekie> Who? No.
[13:20:28] <geekie> Anyway rawler this is too OT for this channel I think.
[13:21:06] <rawler> agreed
[13:21:40] <Zelest> OT is perfectly fine as long as they don't include flamewars :)
[13:46:51] <NodeX> this chan is generaly relaxed about Off topic stuff
[13:47:06] <NodeX> as long as people dont come in asking how to do stuff in XYZ database
[13:47:34] <kali> yeah.
[13:47:45] <kali> that kind of OT would be intolerable
[13:48:09] <NodeX> ron is also OT too
[13:48:20] <Zelest> ron?
[13:48:37] <NodeX> yeh
[13:48:55] <NodeX> the annoying one who loves java
[13:48:58] <NodeX> lulz
[13:49:06] <Derick> and dislikes PHP?
[13:49:07] <Zelest> java should be OT as well tbh. :(
[13:49:12] <NodeX> yes that one!! :P
[13:49:27] <NodeX> here comes another code flame war
[13:49:37] <NodeX> I can't get motivated today
[13:49:41] <Zelest> Haha
[13:49:50] <NodeX> need some inspiration
[13:49:55] <Derick> NodeX: read some of php-internals, but don't forget the popcorn
[13:49:55] <Zelest> I just dislike the whole "it runs on everything!" argument..
[13:50:01] <rawler> what's not wrong with Java? 0:-)
[13:50:17] <NodeX> Derick : I would cry if I read the internals lol
[13:50:34] <Zelest> Let's all run WordPress for everything instead!
[13:50:37] <NodeX> I avoid the PHP bugs which allows me to do my thing using it
[13:50:54] <Zelest> me too!
[13:51:02] <Zelest> or.. I did a month ago..
[13:51:04] <Gues_____> hey guys, im using mongodb in a production enviornment and my collection is about to hit it's 16MB limit. What should I do? Im using the PHP driver
[13:51:06] <Zelest> havn't touched my book since.
[13:51:21] <NodeX> 16mb per doc?
[13:51:26] <Zelest> skram, 16MB collection limit?
[13:51:41] <NodeX> collections are not limited lol
[13:51:47] <NodeX> documents are!
[13:52:00] <Zelest> About 2.4 btw..
[13:52:11] <NodeX> it;s out tomorrow Zelest :P
[13:52:13] <Zelest> Will there any a per-collection write-lock? Or is it still on a per database level?
[13:52:14] <skram> oh so i shouldn't worry. i thought it was the collection's limit
[13:52:24] <NodeX> skram : no ;)
[13:52:34] <Zelest> skram, That would be fairly crap. :-D
[13:52:35] <NodeX> I hope it's a per collection lock
[13:52:49] <NodeX> a per doc lock would be best
[13:52:52] <skram> Zelest: It would right.
[13:52:56] <Zelest> NodeX, Mhm.
[13:53:01] <Derick> NodeX: but expensive to maintain...
[13:53:02] <skram> I got scared :)
[13:53:04] <NodeX> I can't see why we can't have one
[13:53:11] <NodeX> Derick : fair point
[13:53:26] <Zelest> no locks at all!
[13:53:29] <Zelest> free for all :D
[13:53:29] <NodeX> can the lock not reside in memory ?
[13:53:35] <Zelest> *watch the database die*
[13:53:39] <NodeX> a long side the oid or somehting?
[13:54:09] <NodeX> surely 1 byte per document would not be to much overhead
[13:54:30] <NodeX> (just spitballing ideas)
[13:55:34] <Derick> NodeX: https://jira.mongodb.org/browse/SERVER-1240
[13:56:59] <NodeX> locks are the most latency in my apps atm
[13:57:12] <NodeX> gonna have to put everything in a queue pretty soon
[13:57:12] <Zelest> "Valery, I'm getting sick of your trolling - shut up."
[13:57:23] <Zelest> what a nice atmosphere in the jira :D
[13:57:32] <NodeX> lol
[13:57:42] <NodeX> try #css or ##php
[13:57:53] <NodeX> there are some idiots in there
[13:58:18] <Zelest> try #web for that matter
[13:58:28] <Zelest> or #apache or #bind :D
[13:58:37] <Zelest> <3 arrogant elitist jerks on freenode
[13:58:44] <NodeX> :/
[13:59:46] <Derick> #perl on efnet used to be fun
[14:00:19] <Zelest> efnet in general is full of those people tbh.
[14:02:08] <Zelest> there we go, signed up to the mailinglist for when new releases come out
[14:02:09] <ron> NodeX: yes?
[14:02:18] <Zelest> might be good now without twitter
[14:03:36] <NodeX> ron : \o/
[14:04:03] <Zelest> NodeX, stop talking off-topic please.
[14:13:33] <NodeX> lol
[14:34:53] <oskie> according to mongodb, there's a lot of read on a secondary (>=100MB/s), but no client connection. what does that read come from?
[14:36:57] <oskie> according to mongotop I mean
[15:16:36] <emperorcezar> Recommendations on the best way to serve up files from gridfs out to the internet?
[15:18:53] <kali> emperorcezar: some people use the nginx module
[15:20:10] <emperorcezar> kali: Yea. I was looking at that. Seems weird to have to recompile nginx. I try to avoid that. I'd rather have a package.
[15:20:40] <NodeX> nginx is by far the best way should you not want to talk to a scripting language
[15:20:54] <NodeX> plus recompile takes about 15 seconds lol
[15:21:31] <kali> emperorcezar: yeah, compiling nginx is really ok. it's designed for that
[15:21:50] <NodeX> you can even update it wihtout dropping connection
[15:22:03] <NodeX> "make update" instead of makle install iirc
[15:27:33] <emperorcezar> Yea, I don't mind compiling, but then it's really harder to keep up with minor releases, security fixes especially.
[15:28:44] <NodeX> there isn't many if ever for nginx
[15:29:23] <NodeX> even so, it's a small price to pay to have fast file serving
[15:31:01] <marqu3z> Hi guys, do you know some benchmark page about intersection query with mongodb? I'm dealing with that and i'm not sure about performance with big collections.
[15:31:52] <NodeX> perhaps explain the query and we can advise if/when it will bottleneck
[15:32:54] <JoeyJoeJo> I'm using pymongo and I have a list of strings to search for in one field. I use MyQuery['field'] = {"$in":MyList} which only works for exact matches. So I changed my list to be python re objects instead of strings, but it returns nothing. Any suggestions on what I can try?
[15:43:53] <marqu3z> it's not about a specific query. I have all the users logged with a social network (fb for example) so i store their fb id on mongo. Then another user login, and i take his social graph from Facebook, so i have an array with a list of friend ids, and i need to query against that array and find out if the there are users on my database that are friends with the new one. So i need to make this query very often and don't know how well performs mongo with this
[15:43:53] <marqu3z> type of intersection query.
[15:45:21] <marqu3z> i think the "$in" operator is the only one i could use
[15:45:33] <NodeX> you'll need a graphing DB to scale that
[15:45:40] <NodeX> it wont scale well at all in mongo
[15:48:27] <marqu3z> i suspected about that, right know i can't switch to another db, if you know some benchmark about that will be very helpful! Thank you for the help!
[15:49:16] <NodeX> I dont sorry
[15:50:30] <marqu3z> no prob, thanks anyway :)
[16:57:10] <nonent> question about shard-autobalancer. i've got 64 chunks, and after initial data import, 32 shards with shardKey 0-5 are on shard1, while 32 shards with shardkey 6-10 are on shard2. issue is, higher values are more likely to be accessed. will it rebalance these automatically as use continues? a strategy with 0-2, 6-8 being on shard1 and 3-5,9-10 being on shard2 would work much better.
[16:58:35] <nonent> i assumed chunks would be added to shards in an alternating fashion. but somehow they've ended up this way where the first half are all on shard1 and second half on shard2
[17:00:26] <kali> AFAIK the autobalancer only balance on size, not on traffic
[17:01:04] <kali> that's why it is recommended to use shard keys that gives a good, nice spread, but of course, it's not always possible
[17:01:45] <kali> it might be possible to manually rebalance some chunks to get a few chunks with higher value on the other shard
[17:06:27] <nonent> kali: yeah, i've read those notes, but since most of my queries are based on id for this collection, and inserts are few while updates are many, it seemed like the appropriate choice anyways.... well, except for the tendency for newer ids to be accessed more commonly.
[17:08:45] <nonent> i'll look into possibility of manually rebalancing. i don't know why i assumed distribution of chunks would alternate between shards instead of choosing a pivot point and splitting chunks between that.
[17:12:07] <kali> nonent: well, it make sense: first chunk grows, grows, grows, is splitted, one of the half is migrated, and then both side grow at more or less the same rate, are splitted but as the shards are even balanced, there's no reason to waste energy migrating data between shards...
[17:13:32] <bean> split*
[17:13:34] <bean> not splitted
[17:13:41] <bean> </petpeeve>
[17:14:19] <nonent> i'll see what the access distribution looks like after this is all done before deciding what to do about it. i guess i also have to eval whether the savings i achieve from not needing to query both shards for _id is worth the possible uneven access.
[17:15:11] <nonent> thanks for the help/running me through it mentally.
[17:15:18] <nonent> i prefer besplit
[17:29:35] <owen1> I start my mongo with /home/t/bin/mongod --fork --logpath /usr/local/nextgen/push/shared/logs/mongodb.log --logappend --config /etc/mongodb.conf my mongodb.conf is: port = 27017 bind_ip = 10.1.72.132 dbpath = /data/db fork = true replSet = push I can't connect to the console to initiate my replica set - "exception: connect failed". looking the log i see: "couldn't connect to localhost:27017:
[17:29:37] <owen1> couldn't connect to server localhost:27017" and "replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)"
[17:30:49] <owen1> any clues? (btw, it's the primary instance. i plan to have replica set of 2 hosts, for dev only)
[17:33:44] <kali> localhost is 127.0.0.1 and bind_ip is 10.1.72.132
[17:34:30] <owen1> kali: my bind_ip is whatever ifgonfig gave me.
[17:34:36] <owen1> kali: should it be something else?
[17:35:01] <owen1> or should i try to connect with mongo --host 10.1.72.132 . let me try
[17:35:26] <kali> owen1: why do you even bother with a bind_ip on a dev machine ? :)
[17:35:48] <owen1> kali: i am not sure what does it do. let me read it again
[17:35:50] <owen1> (:
[17:36:13] <kali> owen1: it restricts the interface (as in network interface) on which you can connect to your mongo
[17:36:36] <kali> owen1: if you don't mention it, you'll be able to use any interface (localhost or your 10. ip)
[17:36:59] <kali> owen1: but if you set it to 10. you can no longer use localhost, as localhost is 127.0.0.1
[17:37:10] <owen1> kali: i am not sure i understand the practical aspect of what u'r saying.
[17:38:11] <kali> owen1: practical aspect is: on a dev environment, if you don't understand what bind_ip does, you don't need it.
[17:38:36] <kali> just kill this line from your config file
[17:38:37] <bean> owen1: it makes it only bind to one interface, instead of all
[17:39:01] <owen1> bean: does it mean i will not be able to access my mongo from outside machines with mongo --host <ip> command?
[17:39:10] <bean> ... no
[17:39:17] <owen1> bean: i appologize for not understanding it guys
[17:39:25] <bean> how many ip addresses are on your machine
[17:39:29] <bean> one>?
[17:39:46] <owen1> bean: i guess i can find it by running ifconfig? let me se
[17:39:58] <bean> you should have at a minimum an lo and an eth0
[17:40:29] <kali> or lo0 instead of lo
[17:41:00] <owen1> yes i got eth0 lo
[17:41:11] <bean> okay, so, bindip is worthless anyways.
[17:41:23] <bean> bind IP is really only usefull with more than 1 IP
[17:41:43] <owen1> bean: oh. so i can ommit that in my dev and prod?
[17:41:53] <owen1> assuming i only have 1 ip in my prod.
[17:41:54] <bean> lets say you have 2 IPs, one on an external interface, and one on an internal, and you only want your mongo to listen internally
[17:42:07] <owen1> what does it mean 'listen internaly'?
[17:42:36] <owen1> bean: appolagize again
[17:42:47] <bean> you may want to learn more about networking before you worry about it.
[17:43:34] <owen1> bean: ok. i'll ommit it for now. thanks
[17:43:59] <bean> cuz i can't really explain if you don't understand the difference between internal networks and external networks
[17:45:00] <owen1> bean: at least i can start googling for something!
[17:47:37] <owen1> i am running rs.initiate() and i never get the cursur back. it's still holding or something. in the log i see: "[rsStart] DBClientCursor::init call() failed"
[17:47:53] <kali> owen1: how long have you waited ?
[17:48:27] <owen1> kali: until i saw the messege? about 1 minute
[17:48:51] <kali> ha. you need to look at what mongod logs
[17:50:38] <owen1> kali: this is the log for starting mongo - http://pastebin.ca/2301085 [rsStart] couldn't connect to localhost:27017: couldn't connect to server localhost:27017
[17:50:47] <owen1> and couldn't unlink socket file /tmp/mongodb-27017.sockerrno:1 Operation not permitted skipping
[17:52:55] <owen1> i assume that my issue is somewhere in starting mongo, and not in rs.initiate()
[17:53:40] <kali> is there a chance there is already a mongo running on this machine (i think the message would be "socket already in use" in that case, but...)
[17:53:51] <owen1> kali: i killall mongod
[17:53:58] <owen1> and run ps xf to make sure
[17:54:04] <kali> or something like apparmor or some other paranoid shit restricting port opening
[17:54:29] <owen1> kali: i don't know. let me ps it
[17:55:03] <owen1> now i get error with the lock file. can i delete that?
[17:56:11] <kali> if not mongod are running, yeah
[17:57:02] <ron> kali: was that english?
[17:57:34] <owen1> kali: ok. looks ok. now i'll try rs.add
[17:57:46] <owen1> i assume it's ("host:port")
[17:58:09] <kali> ron: that is the second comment on that sort today...
[17:58:31] <ron> kali: of that sort?
[17:59:00] <kali> 3.
[17:59:05] <ron> :)
[18:41:20] <jaimef> anything special need to be done before cloning a mongodb to another server to bring up replicas?
[18:43:17] <Auz> jaimef, just did that myself, and there was nothing special required
[18:44:20] <jaimef> db.fsyncLock was not required?
[18:44:39] <jaimef> saw a local.me error last time
[18:44:41] <Auz> are you running as a replicaset now?
[18:44:50] <jaimef> yes
[18:45:07] <Auz> and you want to add more servers to the set?
[18:45:10] <Auz> or move the whole thing?
[18:45:11] <jaimef> yes
[18:45:15] <jaimef> add
[18:46:29] <jaimef> previously an rsync and bringup of a new mongodb yielded errors.
[18:46:30] <Auz> we just brought up a new mongod instance with the replicaset name, then from the primary did rs.add('server...')
[18:46:41] <Auz> ya, dont bother copying the data by hand
[18:46:45] <Auz> mongo will do that for you
[18:47:03] <Auz> (it will put some load on the servers though, depending on your data use)
[18:47:09] <jaimef> is there any overheard to mongo going through it though?
[18:47:12] <jaimef> talking like 1TB
[18:48:41] <jaimef> so always better to just let mongodb replicate all the data from scratch instead of trying to clone it with rsync(1) etc.
[18:48:42] <jaimef> thanks
[18:50:43] <vanchi> Hi, same question as Jaimef
[18:51:00] <vanchi> I was wondering if we can partition our replica set into two,
[18:51:09] <vanchi> add more members into the second unused one
[18:51:15] <vanchi> and then bring all these together..
[18:51:21] <vanchi> Is that a good option?
[18:51:44] <Auz> whats the reason for doing it that way?
[18:52:02] <vanchi> You mentioned there will be an overhead when adding a new member
[18:52:05] <vanchi> just want to avoid it
[18:52:15] <vanchi> we have 4 members on a rs now
[18:52:33] <vanchi> i can take off one, make it an unused standalone rs with two other arbiters
[19:27:09] <owen1> "killall mongod" on the primary host. and the secondary still shows 'secondary'. isn't it suppose to became primary?
[19:27:45] <kali> owen1: you can't have failover with two servers. you need a third one, at least in the form of an arbiter
[19:48:25] <Virunga> I have a collection of docs like this { _id:'..', day:'..', log: [{time:'..', messages:[..]}]}, and with these params {_id: channel, 'log.day': day}, {'log.$.messages': 1, '_id': 0} the find method returns this { log: [...] }. How can i get only the messages field?
[19:48:36] <Virunga> Could you give me an advise please?
[19:49:20] <kali> just unfold the document with whatever language you're using to query mongodb...
[19:49:57] <Virunga> Yes, but isn't there a query that returns just what i want?
[19:50:39] <Virunga> i mean, the object of field to give to the find method
[19:51:32] <kali> Virunga: not really, mongo always return objects
[19:52:10] <Virunga> An object like this { messages: [..] } would be ok
[19:52:11] <kali> Virunga: you can get them closer to what you want with the aggregation framework, but you'll never reduce them to the the messages strings
[19:52:20] <kali> Virunga: i advise against doing it
[19:52:45] <kali> Virunga: this kind of processing is ok on the client side, which is easily scalable
[19:52:55] <kali> Virunga: so no reason to bother the server with it
[19:53:32] <Virunga> kali: ok. Thanks!
[21:07:44] <JoeyJoeJo> How can I check how a collection is indexed?
[21:10:26] <kchodorow_> JoeyJoeJo: db.collectionName.getIndexes()
[21:10:31] <JoeyJoeJo> thanks
[21:11:58] <tqrst> I'm going through the tutorial in the browser shell on mongodb.org, and so far I'm having problems getting the find command to work: db.scores.save({a:99}); db.scores.find() -> db.scores.find() returns [] instead of what I suppose should have been [{a:99}]? Did I misread something?
[21:15:18] <kchodorow_> tqrst: looks like it's broken
[21:24:59] <owen1> kali: oh. i didn't realize that. i guess i'll add a 3rd host on my dev environment, to test it.
[21:26:52] <JoeyJoeJo> How would I remove documents that have a specific field, regardless of what that field contains?
[21:43:52] <owen1> what's the reason replica set doesn't work on 2 hosts? why 3?
[21:45:32] <kali> owen1: because when a member of a two-node replica set can't see its sibling, it can not know for sure if it is not still primary, but hidden behind a network split
[22:00:57] <owen1> kali: got it. thanks
[22:20:45] <changerO1Sea> jrule: whats up?
[22:22:01] <changerO1Sea> hey all! I got a $slice problem, maybe i'm reading the docs wrong, but I'm trying to just get one arg from the first obj in an array to show up and it's showing up everything the document. can anyone help?
[22:22:15] <changerO1Sea> everything in the document*
[23:01:35] <changerO1Sea> perhaps let me rephrase that question, I only want the first element in an array, instead I am getting the whole doc and the first element, can anyone help?
[23:08:01] <kchodorow_> changerO1Sea: you can say {x:0, y:0,...} for all the other fields in the second arg to find, or use the agg framework
[23:30:52] <jaimef> can you do db.fsyncLock() on the primary?
[23:47:01] <jaimef> can you merely copy an existing rs to a new host and start it up as a different replicaset name?
[23:48:10] <jaimef> split replicaset rather
[23:48:33] <jimlek22> jaimef: what are you trying to do?
[23:48:38] <jaimef> I copied an existing replica set to a new server, and want to start it up as a diffeent replica name.
[23:48:44] <jimlek22> mongodb does not support that.
[23:50:56] <jaimef> jimlek22: thanks