PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 21st of March, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:19:44] <morenoh149> lost1nfound: I use mongohub but its not web
[16:01:03] <atarihomestar> i’m new to mongo. i have a friends and a users collection. i want to query the users collection getting everybody who isn’t already my friend. that would mean i’d have to somehow also look in the friends collection and figure out who is already my friend. how do i do that?
[16:11:39] <GothAlice> atarihomestar: MongoDB isn't relational, so what you are asking will require multiple queries within your application. See also: http://www.javaworld.com/article/2088406/enterprise-java/how-to-screw-up-your-mongodb-schema-design.html
[16:13:10] <GothAlice> As another note, MongoDB isn't a good fit for storing graphs (i.e. social networks, multi-degree frend-of-friend type stuff will be quite difficult, etc.)
[18:58:48] <Strinnityk> Hello guys
[18:59:00] <Strinnityk> I have a list of documents I've obtained (the documents contain score, kind and name).Is there a way I can get the 3 documents with highest score per each different name
[20:42:48] <altamish> Hi all, I am trying to upload an image file using pymongo flask, the file wouldnt be over 16MB so I dont need GridFS. So how do I upload it as a document?
[21:26:48] <GothAlice> xerxes: http://api.mongodb.org/python/current/api/bson/binary.html#bson.binary.Binary
[21:29:20] <GothAlice> Don't try to store the binary data as a string, all "strings" in MongoDB are UTF-8 encoded, which isn't binary safe.
[21:30:25] <xerxes> thanks GothAlice
[21:33:07] <xerxes> # Convert from subtype 3 to subtype 4 .. Whats subtype 3 and 4?
[21:33:27] <GothAlice> xerxes: http://bsonspec.org/spec.html < search for "subtype" on this page
[21:33:36] <GothAlice> That applies to how UUIDs are being stored.
[22:12:01] <MacWinner> Hi, my mongo replica set is dumped at midnight every night. I noticed at the time I got alerts about high disk I/O on the server. But I also noticed that my queries to mongo were reaching 30 second timeout. I have a simple PHP script that queries for some activity documents. However, I have PRIMARY_PREFERRED as my read preference, so I didn't think this timeout should occur. Any pointers on why this timeout was happening during the mongodump?
[22:12:07] <MacWinner> Or is it expected behavior?
[22:12:27] <MacWinner> THough only thing I could come up with was maybe I need to set "secondaryAcceptableLatencyMS" higher
[22:20:03] <RegexNinja47> My database size in mongo reports <32mb, but my mongodb directory itself is around half a gigabyte. What should I do to fix/troubleshoot the issue?
[22:20:25] <RegexNinja47> Also, smallfiles is and has been on, so that's not the issue
[22:27:09] <RegexNinja47> I noticed something odd
[22:27:36] <RegexNinja47> This is the output of running du -sh * on my data directory
[22:27:51] <Derick> please don't paste that here
[22:27:55] <Derick> use a pastebin
[22:28:01] <RegexNinja47> I'm cleaning it up
[22:28:23] <RegexNinja47> Actually I'll summerize it
[22:28:37] <RegexNinja47> Journal was 318mb
[22:28:54] <RegexNinja47> Everything else was around 16mb
[22:29:45] <RegexNinja47> I feel like I probably shouldn't disable journaling
[22:30:24] <RegexNinja47> But what should I do to drastically reduce the size of the journal file?
[22:31:57] <RegexNinja47> It would be 25x less space to have no journals and a mirror database
[22:32:03] <RegexNinja47> *20
[22:34:58] <MacWinner> RegexNinja47, when you startup mongo for first time, I think it looks at your total HD space and allocates 5% by default
[22:35:11] <MacWinner> RegexNinja47, i think it's the journal file..
[22:35:28] <RegexNinja47> ITs definately the journal file
[22:35:38] <RegexNinja47> And I'm on a server with a quota
[22:35:49] <MacWinner> it's not actually using all that space.. there is a way to make it not do that, but I forget how
[22:36:01] <Derick> noprealloc?
[22:36:10] <Derick> but you also definitely need the journal
[22:36:11] <MacWinner> http://stackoverflow.com/questions/9473850/mongo-prealloc-files-taking-up-room
[22:36:59] <RegexNinja47> one sec. I'll check the prealloc file size
[22:38:05] <MacWinner> Derick, hi, not sure if you were around when I asked the question above... any idea why read operations would fail on a replica set during a mongodb dump operation (about 50GB db). I'm doing teh query via PHP script that has read preference set to PRIMARY_PREFERRED
[22:38:07] <RegexNinja47> Yeah. >90% of the storage is those prealloc files
[22:39:20] <RegexNinja47> ...
[22:39:24] <MacWinner> RegexNinja47, i got stuck on this when I first started using mongo too.. would be nice if the mongo startup script echo'd something out during the initial startup that it's about to allocate all that space.. I noticed it more because it took like 10 minutes for it to create the file on my 2TB hard drive
[22:39:45] <MacWinner> i'm not sure what the process is to reduce the size of it though
[22:39:52] <RegexNinja47> Noprealloc is already set to true
[22:40:36] <RegexNinja47> It would be nice
[22:40:58] <MacWinner> maybe this: http://lostquery.com/questions/313/how-do-i-shrink-the-mongodb-journal-files
[22:41:17] <Derick> MacWinner: what does the mongo log say?
[22:42:00] <RegexNinja47> @Derick, what am I looking for?
[22:42:33] <RegexNinja47> Macwinner, smallfiles is already set to true (As well as noprealloc) by my hosting service
[22:42:55] <RegexNinja47> Which makes no sense, because there are prealloc files
[22:44:13] <RegexNinja47> Can I verify wheather the options are actually enabled from within mongo?
[22:44:22] <Derick> RegexNinja47: MongoDB uses diskspace...
[22:44:31] <Derick> and the smallest file it makes is iirc 128MB
[22:44:51] <Derick> 16MB in smallfiles mode
[22:44:58] <RegexNinja47> Thats off
[22:45:02] <RegexNinja47> *odd
[22:45:20] <Derick> the .ns file is also 16MB
[22:45:50] <MacWinner> Derick, can't seem to find any relavent log entries.. but probably more because I saw the problem very late at night and I can't remember exactly what day.. was up all night fixing something else.. any particular string you think would be helpful to grep in the log files?
[22:46:09] <RegexNinja47> Both smallfiles and noprealloc are set to true by default on my hosting service, but there are three 128mb prealloc files
[22:46:36] <RegexNinja47> They're set in mongodb.conf
[22:47:51] <RegexNinja47> Should I contact the people who host it and talk to them? I don't want to sound like an idiot
[22:48:21] <RegexNinja47> Although one would assume noprealloc would get rid of prealloc files
[22:52:48] <RegexNinja47> The mongodb log says that they're enabled
[22:53:31] <RegexNinja47> Sat Mar 21 17:59:52.203 [initandlisten] options: { ... noprealloc: "true", ... smallfiles: "true" }
[22:54:29] <RegexNinja47> But there are two 128mb and one 113mb prealloc.# files in my journal directory
[22:57:06] <RegexNinja47> No j._# files
[22:58:54] <Derick> MacWinner: sorry... don't know
[22:59:18] <MacWinner> no worries.. my info was not very helpful.. I will gather more info next time it happens
[22:59:52] <MacWinner> Derick, but at a high level.. if a mongodump is happening should the primary be able to respond to client requests?
[22:59:57] <Derick> yes
[23:00:10] <Derick> mongodump is just another reader
[23:00:45] <MacWinner> should a client driver attempt to connect to a secondary if a primary times out?
[23:00:52] <Derick> no
[23:00:56] <MacWinner> assuming PRIMARY_PREFERRED is set
[23:01:03] <Derick> the selection happens before the query
[23:02:08] <RegexNinja47> Fixed it!
[23:02:32] <RegexNinja47> Deleting those prealloc files made mongo default to the other journal format
[23:02:46] <Derick> there is only one journal format?
[23:02:46] <RegexNinja47> I guess it uses prealloc files if they exist
[23:07:05] <MacWinner> Derick, if the mongodump is happening on the same server as the primary, and it's causing a spike in disk I/O, could you see this as possibly causing timeouts at 30 seconds? mongodb seemed to have started responding fine again after the dump was complete.
[23:07:35] <MacWinner> assuming nothing else is happening on the server
[23:09:58] <Derick> MacWinner: yes, I can
[23:10:25] <Derick> a mongodump needs to read all data into memory - potentionally displacing indexes/data that your query is requesting
[23:10:54] <Derick> MacWinner: why not run your mongodb dump against a secondary isntead?
[23:10:56] <Derick> instead*
[23:11:02] <MacWinner> ahh.. yeah.. my server has 16GB ram..
[23:11:23] <MacWinner> Derick, haha.. I was just about to ask you about a different strategy.
[23:11:29] <MacWinner> cool.. I will do that
[23:12:00] <MacWinner> out of curiousity, does having a delayedSLave of lets say 1-day serve a purpose as a backup?
[23:12:14] <MacWinner> so basically i have a continuous backup
[23:12:18] <Derick> you can, but you need to make sure your oplog size is that big
[23:13:07] <MacWinner> i'm not clear how i would recover from the delayed node.. would I just run a mongodump on it and then mongoimport back on the primary or new cluster?
[23:13:26] <MacWinner> recover from a failure using the delayed node I mean
[23:13:53] <Derick> yes, or, make it primary
[23:14:18] <Derick> with some trickery... I don't think I have tried it myself
[23:14:23] <MacWinner> ahh.. cool, thanks a lot for all the color on this
[23:14:24] <Derick> I bet we have some docs on it
[23:14:59] <MacWinner> i'm thinking of updating to wired tiger become of the compression since my data is highly repetitive
[23:15:28] <MacWinner> looks like 3.0.1 is out.. any major reason not to now?
[23:17:18] <MacWinner> oops.. gotta run.. have a great weekend!
[23:18:06] <Derick> for anybody else here: always update