PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 24th of April, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:43:06] <leandroa> hi, is there a way to sort by list values? for example I have these docs: https://gist.github.com/lardissone/5448683 and I want to sort by the doc with the smallest value in the lists (no matter how many values in the list)
[01:08:34] <yeukhon> so I am using mongoengine for my pyramid project. and recently, my user registration part is failing. here is the gist showing traceback https://gist.github.com/yeukhon/8c99e1d7ff5c0b4308e0
[01:08:41] <yeukhon> mongo said "AutoReconnect: could not connect to localhost:27017: timed out"
[01:09:08] <yeukhon> any thoughts on this? thanks
[01:45:54] <leandroa> yeukhon: are you able to connect from shell?
[01:51:46] <yeukhon> leandroa: yeah. it looks like somewhere it got disconnected
[01:52:06] <yeukhon> leandroa: thanks for looking over this though. it's weird... same fn running for a while
[01:52:13] <yeukhon> just start noticing the failure today
[01:52:42] <leandroa> and what server logs says?
[01:53:17] <fjay> is there a way to drop databases w/o impacting the performance of read/write operations of other databases?
[02:12:31] <yeukhon> sorry computer got shut down...
[02:21:31] <yeukhon> leandroa: i dont see any particularly interesting enty in the log. conns are still open.
[02:22:09] <yeukhon> and i have the same "connect, run test, disconnect" setUp/tearDown in other tests
[02:22:21] <yeukhon> it fails on one test
[02:22:38] <yeukhon> the subsequent tests are also creating users and they pass
[03:26:18] <bmatusiak> i have a question,
[03:28:18] <bmatusiak> is it possible to use a db like git repo?
[03:32:07] <yeukhon> bmatusiak: not any easy way, i am working on virualizaing mercurial using mongodb and i still dont have time to do the file system backend using nosql
[03:32:28] <yeukhon> bmatusiak: what i am doing is save the tar of .hg (or .git) extract to tmpfs in memory
[03:32:58] <yeukhon> bmatusiak: but again, depends on how you want call ur db "git repo" .
[03:33:33] <bmatusiak> well the idea I'm looking into is trying to have a fork-able db for the local client
[03:34:29] <bmatusiak> then or if the network db become online then pushes and merges back into primary db
[03:34:49] <yeukhon> pretty new to mongodb but isn't that what replication is for?
[03:39:43] <bmatusiak> @yeukhon looking toit now
[03:41:07] <yeukhon> bmatusiak: sorry i wish i could be more helpful than that. but if u want to backup db u should look at replication or dump or something similair. other than that, i'd say given it's night time in the US u priobably will have better answers on the mailinglist.
[03:41:27] <yeukhon> but i'd like to hear what u ac tually want to accomplish and the solution later.
[03:42:45] <bmatusiak> i might just make a file struct to hold json files and use git for the remote storage
[03:43:45] <bmatusiak> what i need to do is not so data intensive :P
[03:49:34] <yeukhon> well periodically u can do a dump. idk if git is good with that as long as u have a way to dumb the text, rather than a binary. to me hg maybe better at handling it.
[03:49:49] <yeukhon> just personal bias.
[05:20:26] <svm_invictvs> Heya
[05:20:40] <svm_invictvs> does the $skip and $limit apply for regular queries? Or just aggregation?
[07:33:48] <[AD]Turbo> hola
[09:58:41] <tab1293> for some reason my mongo push statement seems to be updating the array twice with the same calue
[09:58:44] <tab1293> *value
[09:59:01] <tab1293> $usersCollection->update(array("username"=>"tab1293"), array('$push'=>array("torrents"=>"59516b06674da07749ffd9923a554a64ff643e96")));
[09:59:27] <tab1293> the torrents array in my document now has two values of that hash string
[10:03:47] <Nodex> $push does that
[10:03:51] <Nodex> you want $addToSet
[10:05:57] <tab1293> Nodex: ok I will try that
[11:12:49] <r04r> 6
[12:02:03] <jwilliams_> Is it normal when chunks are moved, the lock acquired for building index will take very long time?
[12:25:55] <CupOfCocoa> If I declare a field as unique in an index and then try to insert the same value twice, will the insert operation fail?
[12:31:18] <Nodex> yes
[12:32:05] <Zelest> Nodex, my TTL index works now..
[12:32:15] <Zelest> Nodex, might indeed be daylight savings related
[12:33:36] <CupOfCocoa> perfect, thanks Nodex
[12:33:59] <Nodex> Zelest :D
[12:34:04] <Nodex> CupOfCocoa :)
[13:32:20] <leandroa> hi, is there a way to sort by list values? for example I have these docs: https://gist.github.com/lardissone/5448683 and I want to sort by the doc with the smallest value in the lists (no matter how many values in the list)
[13:37:47] <Nodex> have you tried sort({values:1}); ?
[14:15:57] <CupOfCocoa> I need a query to fetch all documents in a collection that share the value for a given key. Any pointers on how to go about that?
[14:16:19] <Nodex> db.foo.find({key:"val"});
[14:16:23] <CupOfCocoa> basically I need to detect duplicates given a key
[14:16:25] <CupOfCocoa> val is unknown
[14:16:42] <Nodex> group or aggregation framework is your only choice
[14:16:49] <Nodex> or a slow map/reduce
[14:17:08] <CupOfCocoa> mhm will write a quick python script then, should be a one time ops
[14:17:10] <CupOfCocoa> thx
[14:25:40] <marcqualie> When using the aggregation framework if you don't specifiy $project, does it project all fields from the document? Can't find any reference to not including it in the docs
[14:38:09] <leandroa> Nodex: oh, that simple like that.. thanks
[14:48:05] <Nodex> I have never tried, I was asking if you've tried before I worked out somethign different for you
[15:34:40] <chandru_in> I have a multi-key index of size ~33M on a collection. The box has 7G of RAM and mongod's RSS is about 3.5G. I'd expect the entire index to be in memory but I see a lot of disk hits on the server. What could I be doing wrong?
[15:35:18] <chandru_in> mongostat shows ~40 pagefaults per sec
[15:43:23] <Number6> chandru_in: What's the output of $blockdev --report
[15:44:44] <chandru_in> RO RA SSZ BSZ StartSec Size Device
[15:44:44] <chandru_in> rw 4096 512 512 0 137433710592 /dev/md0
[15:48:06] <Number6> chandru_in: Try halfing the Readhead (RA) value. You'll need to restart MongoDB for the changes to take effect
[15:48:52] <Number6> ReadAhead, basically, takes in more data from the disk than is needed, as a method to speed up disk accesses - by caching blocks from the filesystem in RAM.
[15:49:19] <chandru_in> Number6, given there is enough memory for the entire index, how will reducing read-ahead help? Also, our queries are pretty must across the entire data-set.
[15:49:48] <Number6> For random data access patterns, a high read-ahead value can impact preformance by lessining what the OS thinks it should cache
[15:53:46] <Number6> chandru_in: A high readahead can take up a fair bit of RAM, as it is the OS trying to cache disk data in memory - the OS is being helpfull but at the cost of loosing a fair amount of RAM
[15:54:16] <chandru_in> ok, will try setting RA to a lower value
[15:58:59] <scoates> adjusting the readahead made a huge difference for us, chandru_in
[15:59:10] <scoates> this is also helpful: http://www.snailinaturtleneck.com/blog/2012/04/05/thursday-4-blockdev/
[16:08:01] <chandru_in> Reducing RA made it worse. ~90 faults per sec now
[16:19:36] <scoates> reducing RA will just help you fill up more RAM (more of your working set in RAM)
[16:20:09] <scoates> is your ram exhausted? if so, your working set it too large for your RAM. if not, then it'll fault until your RAM fills up.
[16:22:33] <saml> hola
[16:23:03] <saml> mongoimport takes 2 minutes now. is it good?
[16:23:21] <saml> i mean, would clients still read stale data during mongoimport?
[16:24:33] <ron> seriously?
[16:24:47] <ron> no, I mean... seriously?!
[16:30:26] <saml> ron, ? what's problem
[16:30:34] <saml> i need to run mongodb every hour or so
[16:30:46] <saml> to get data from legacy system
[16:31:09] <saml> actually, jsons that we get from legacy is about 100MB every day.. and it takes 2 minutes to import 100MB
[16:31:17] <saml> so if we run every hour, it'll be shorter
[16:31:24] <saml> is it bad?
[16:31:27] <saml> IS MONGODB BAD?
[16:32:37] <ron> did you consider that THE WAY YOU DO THING IS BAD?!
[16:32:37] <theRoUS> i'm getting this on almost every operation of a new 2.2.3 install: mongo: symbol lookup error: mongo: undefined symbol: _ZN7pcrecpp2RE4InitEPKcPKNS_10RE_OptionsE
[16:33:23] <theRoUS> what does this mean, and what should i do about it?
[16:35:30] <theRoUS> oh, d'oh, needs pcre package (undocumentedly in the docco i've looked at)
[18:05:41] <manny> will the $in operator supplied with an array of _id's return documents in the order of the _id's?
[18:14:05] <manny> anyone?
[18:15:14] <scoates> manny: maybe. probably not. you need a sort()
[19:03:46] <krz> is mongo a good solution for BIG data?
[19:04:04] <redsand> krz: if you're sharding
[19:04:25] <krz> or hadoop would be a better alternative?
[19:04:45] <redsand> depends on what you need
[19:04:51] <redsand> hadoop is shit for adhoc queries
[19:18:54] <fejes> hello - is anyone around that can help with a Javascript API/mongodb question?
[19:19:27] <scoates> fejes: it's best to just ask specific questions and if someone can help, they will
[19:19:31] <fejes> I'm trying to do something I thought was very simple, but all I can get is an empty array back from the find command
[19:19:45] <fejes> thanks scoates
[19:20:08] <fejes> is pastebin used in this channel?
[19:20:45] <fejes> http://pastebin.com/yACGgcRR
[19:21:50] <scoates> fejes: looks like you're missing the first parameter here: coll.find(function(e, data) {
[19:22:00] <scoates> (you're skipping a query and going to the callback?)
[19:22:19] <scoates> I'm not intimately familiar with the Node API, but that looks like it.
[19:22:46] <fejes> ah, right - was trying variations... it used to read: coll.find(query_string, fields,function(e, data)
[19:23:20] <fejes> although that just fails outright.
[19:23:32] <scoates> what's in query_string?
[19:23:42] <fejes> "TypeError: Object.getOwnPropertyNames called on non-object"
[19:23:54] <fejes> right now, I believe it's "{}"
[19:24:12] <fejes> oh, no, sorry, it's :'{xlat: "status"}'
[19:24:36] <scoates> I suggest you reduce your code down to the part that's failing. Get a working coll.find(…) and then add it to the wrapper, then add it to the prototype change.
[19:25:23] <fejes> scoates: thanks... I actually have done that, but wasn't able to get a working coll.find()
[19:26:04] <fejes> I haven't done javascript in a good decade, and what I did back then was pretty trivial.
[19:27:08] <fejes> is there an obvious reason why this doesn't work: coll.find('{}', '{}', function(e, data) {
[19:28:17] <kali> fejes: not quote around the arguments
[19:28:38] <fejes> thanks
[19:28:48] <kali> fejes: and... you're in node.js, not the mongodb shell, right ?
[19:29:04] <fejes> yep - node.js
[19:29:09] <kali> ok
[19:29:33] <kali> be carefull, node.js and the mongodb shell have different apis.
[19:29:55] <fejes> thanks for the reminder.
[19:30:03] <fejes> I dunno.
[19:30:18] <fejes> I'm starting to wonder if either I'm doing something wrong, or if the whole thing is buggy.
[19:30:32] <fejes> odds are higher on the first, but i've been working at this for 24 hours now.
[19:30:42] <fejes> ready to toss in the towel.
[19:31:28] <fejes> I get one of three things happening: the result is undefined, an empty array, or the whole thing crashes.
[19:32:16] <fejes> and this is just trying to do a find... let alone use anything more advance.
[19:32:19] <fejes> advanced.
[19:33:17] <kali> fejes: why don't you start by playing with the mongodb shell ? node.js async nature do not simplify for a beginner
[19:33:31] <fejes> I'm reasonably comfortable in mongo shell.
[19:33:35] <fejes> the finds work there.
[19:33:43] <fejes> it's just in node.js that they fail.
[19:34:00] <fejes> Probably because I can't find a single example that works, so I'm not sure what template to follow.
[19:35:33] <fejes> ok... I'm giving up for a half hour.
[19:35:36] <fejes> back in a bit.
[19:50:03] <davlaps> hello all!
[19:50:14] <davlaps> i have a mongodb index question.. can anyone help?
[19:50:34] <scoates> just ask (-:
[19:50:38] <davlaps> thanks!
[19:51:13] <davlaps> i'm a newbie, but already a huge fan. converting my current rdbms to mongo (most of it).
[19:51:25] <davlaps> so.. i read in the docs that: Index Size
[19:51:25] <davlaps> Indexed items can be no larger than 1024 bytes.
[19:51:35] <davlaps> it doesn't make sense to me..
[19:51:51] <davlaps> i ran a quick test generating documents of 2048bytes, and then indexing on one of the fields..
[19:52:06] <davlaps> it seemed to work… should that be the case?
[19:52:12] <kali> the 1024 byte limit is for the key size
[19:52:13] <scoates> I'm pretty sure "indexed items" in that case is the actual field you're putting into the index's tuple
[19:52:27] <davlaps> awesome! that makes total sense..
[19:52:39] <davlaps> i couldn't understand what my document size had to do with the index..
[19:52:52] <davlaps> that would have been a major limitation.. thanks kali!
[20:23:10] <fejes> Ok... lets try one more time. Anyone able to help me figure out why Nodejs is incapable of doing a collection.find() correctly?
[20:23:11] <fejes> http://pastebin.com/TgFDyWH2
[20:28:02] <fejes> maybe a better question is if anyone has ever managed to get .find() working in Node.js.
[20:38:16] <zamnuts> fejes, find returns a cursor, it doesn't issue a callback.
[20:38:55] <kali> zamnuts: in node ?
[20:39:43] <pygmael> anyone have much experience with MongoDB's GeoJSON stuff? Specifically trying to query within a rectangle using the 2dsphere index?
[20:39:50] <zamnuts> kali, yes in the js driver: http://docs.mongodb.org/manual/reference/method/db.collection.find/
[20:40:07] <kali> zamnuts: this is the mongodb shell, not node.js
[20:40:53] <zamnuts> fejes, fejes question was in the context of nodejs, that and the JS driver is hosted on mongodb.org... wouldn't that make it relevant?
[20:41:00] <zamnuts> kali^
[20:41:53] <kali> zamnuts: the node.js driver is not the mongodb shell: http://mongodb.github.io/node-mongodb-native/markdown-docs/queries.html
[20:46:56] <zamnuts> kali, i understand, didn't know this channel was for the mongodb shell only :/
[20:47:04] <zamnuts> :$ you win
[20:47:20] <leandroa> Does anyone knows a service like chart.io that works with MongoDB?
[20:47:32] <kali> zamnuts: it's not, but zamnuts is right when he's using a callback in find
[21:01:00] <jmpf> locks(micros) r:182122 <--- the read lock that happens - does that mean it's blocking all other reads during that time?
[21:03:43] <davlaps> is it typical to find data import 10x faster than rdbms on a dev setup?
[21:03:51] <davlaps> that's what i am seeing now.. can't believe it is that easy..
[21:04:39] <kali> davlaps: several thousands insert per second is common. insertion is easy
[21:05:23] <davlaps> kali: that's the promise of doc/nosql store. just can't believe it was that easy! i may not even have to shard at this rate.
[21:08:07] <bean__> sharding might not be necessary, depending on your scale / use case.
[21:46:00] <davlaps> bean_: probably not!
[22:55:43] <ghanima> hello all
[22:57:48] <ghanima> I am troubleshooting a performance problem with my mongo cluster and trying to determine if this is truely a system contrainst or optimization needs to be done within the mongodatabase... I get an alert that the load average on a mongo box is above 110 utilization so I begin to investigate. When I see this condition I notice that there 4000 read OPS/ happening per sec which too me seems to be alot but not to the level of driving loa
[22:58:16] <ghanima> iostat on the box and nothing out of the ordinary except for CPU IO wait is always at about 85% to 95%
[22:58:27] <ghanima> Looked at top and the same metric....
[22:59:26] <ghanima> Memory has been steady and not increasing and the mongo process is flucuation in its usage and not staking constant
[23:00:17] <ghanima> Because its CPU IO/Wait I did a ps -aux | grep " D" to see if their were any processes being blocked and it refered to kjournald process but when looking at top its not in the top 10
[23:00:39] <ghanima> At this point I know my constraint is IO Wait but not sure how to track down what is causing the I/O wait
[23:00:41] <ghanima> any thoughts?
[23:00:53] <livinded> inserting into mongo is a blocking operation right?
[23:01:47] <ghanima> livinded: That's the thing when doing a mongo stat all my ops are read I am doing no writes... I was told that this DB only gets updates once every few months and that the only ops I should see is reads
[23:02:51] <livinded> oh, I'm talking about something else
[23:02:59] <ghanima> oh my bad
[23:03:05] <livinded> trying to figure out why a write would be happening but a read right after is returning nothing
[23:03:48] <livinded> if I make the request right after it shows up
[23:38:47] <bcessa> hi, I've a problem with MongoDate on the PHP driver, is this the right place to ask?
[23:54:56] <Raynos> hi
[23:55:02] <Raynos> Having some issues with my mongo driver
[23:55:17] <Raynos> I'm getting in a message thats bigger then 16mb and having difficulty identifying whats bigger then 16mb
[23:59:30] <livinded> is there any reason there would be a delay between an insert and when a query returns a document?