PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 23rd of February, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:26:24] <jiffe> if I flatten a maching with mongoc running (in a 3 mongoc node setup), it should resync from one of the other nodes right?
[00:32:46] <Derick> flatten?
[00:35:21] <Doyle> inotifywatch is what I was thinking of
[00:43:06] <GothAlice> Doyle: I was going to suggest iotop, but apparently MongoDB doesn't name its threads, so that's not useful. :(
[00:48:32] <Doyle> inotifywatch -r -t 60 /dbpath shows a total that is far from the numbers I see from iostat -xmt /dbpath
[00:49:14] <GothAlice> Doyle: What package provides inotifywatch?
[00:49:31] <Doyle> inotify-tools
[00:49:56] <Doyle> it just watches the inode, so it's non-impactful
[00:50:04] <GothAlice> Well, ish.
[00:50:08] <Doyle> ish :P
[00:50:27] <GothAlice> Depends on how the kernel decides to multiplex filesystem events, i.e. if it waits for all receivers.
[00:50:47] <GothAlice> (This is one area where BSD's kqueue really kicks Linux's inotify.)
[00:51:02] <Doyle> You know your stuff
[00:51:26] <GothAlice> Well, these days I know more BSD/Mach than Linux. ;P
[00:53:04] <GothAlice> Yeah, I suspect inotifywatch is giving you the perceived operations, not actual operations.
[00:53:28] <cheeser> oh, mach. that bastard child of FOSS.
[00:53:32] <GothAlice> I.e. it can't tell if the kernel actually had to hit disk to accomplish the operation.
[00:53:43] <GothAlice> cheeser: Oh, the promise of microkernels. ;P
[00:54:25] <GothAlice> <3 L4, with its secure and actually fast IPC.
[00:55:05] <GothAlice> cheeser: Hmm. That's actually something I hadn't considered. Do you know of any work to get MongoDB running under L4?
[00:57:02] <cheeser> i don't even know what L4 is :)
[00:57:35] <GothAlice> http://sel4.systems/Info/Docs/seL4-brochure.pdf
[00:58:17] <GothAlice> L4 is generally a microkernel architecture. Specific implementations take different directions, but seL4 went for the "formally verified in every operation" approach. It's the only 100% guaranteed secure, guaranteed bug-free kernel in the world.
[00:58:26] <GothAlice> (With formal verification and everything.)
[00:58:56] <GothAlice> Fun fact: its the kernel in use on the Security Enclave in that iPhone currently giving the FBI fits. ;P
[00:59:18] <cheeser> guarantee bug free, eh?
[00:59:21] <GothAlice> Yup
[00:59:29] <cheeser> color me dubious ;)
[01:00:10] <GothAlice> "The functional correctness proof states that, if the proof assumptions are met, the seL4 kernel implementation has no deviations from its specification. The security proofs state that if the kernel is configured according to the proof assumptions and further hardware assumptions are met, this specification (and with it the seL4 kernel implementation) enforces a number of strong security properties: integrity, confidentiality, and
[01:00:10] <GothAlice> availability."
[01:00:29] <GothAlice> http://sel4.systems/Info/FAQ/proof.pml
[01:00:32] <GothAlice> :)
[01:01:22] <Doyle> Yes, the perceived ops... that's what I'm guessing at this point
[01:02:52] <GothAlice> cheeser: L4 is more widely deployed, generally, than Linux, BSD (+Mac), and Windows combined. (It's in pretty much everything, from WiFi basebands and every iPhone with a Security Enclave, to cars and industrial machinery.)
[01:03:33] <GothAlice> But there are no consumer graphical OSes built on top of it, alas.
[01:09:08] <cheeser> twm! what more do you need?
[01:09:59] <cheeser> i miss linux on my laptop
[01:17:06] <GothAlice> Heh, interestingly, L4Linux is a thing. L4 makes for a great microvisor. :D
[01:17:26] <GothAlice> But, ah, I want more trusted OS components and less inefficiency through indirection.
[01:25:32] <uuanton> when i remove a member from replica set why is it elected new primary ?
[01:25:50] <uuanton> anybody experienced that before ?
[01:27:04] <GothAlice> uuanton: Step 1 in both methods of removing a node involve shutting that node down.
[01:27:05] <GothAlice> https://docs.mongodb.org/manual/tutorial/remove-replica-set-member/
[01:28:02] <GothAlice> This would make such behaviour impossible.
[01:35:32] <uuanton> GothAlice whenever I remove a member from replica set it elect new primary using both methods ?
[01:36:08] <GothAlice> Yes; changes in the electorate call for an election. Sometimes the same server might reclaim primary, sometimes not.
[01:58:51] <joannac> GothAlice: that's fixed in 3.0 onwards, I think. Removal can happen without always requiring an election, under certain conditions
[01:59:10] <GothAlice> Hmm. Must needs determine those conditions.
[01:59:21] <uuanton> thats kind of bad
[01:59:43] <GothAlice> Well, if the current primary would win anyway, there's no need to call.
[02:00:28] <uuanton> when i migrate staging primary won, but on prod one of secondary won
[02:00:52] <uuanton> i was like o_0
[02:01:17] <uuanton> so i have to stepDown
[02:01:29] <joannac> uuanton: why do you need a specific node to be primary?
[02:02:11] <GothAlice> Indeed, dependence on such factors is sub-optimal; every client driver I am aware of can handle failover if configured with a set name.
[02:02:19] <uuanton> there is a few reason i don't know why but thats due to old design
[02:02:49] <Trinity> does the _id key have to be unique?
[02:02:56] <uuanton> C# driver not really friendly
[02:03:05] <Trinity> nvmd
[04:37:16] <gzn> http://pastebin.com/mP64aExd <--- interview question having trouble with. My background Lamp Dev. Initial ideas -> db sharding && elastic search. Never used nosql db before wondering if I could get some help here
[06:21:12] <WaRLoRD786> Hey guys, I'm testing a 3 sharded mongo instance with only an _id field and one other value which is a 32 character value. Using a single mongoimport process I'm able to load about 19k rec/sec. But on the query side (querying the mongos process), i'm only able to achieve about 1400 rec/sec when querying on the _id field. This seems off? Or does this seem right with a sharded mongo cluster?
[06:21:57] <WaRLoRD786> just would have expected higher query performance
[08:09:25] <Ameo> Is there any way to monitor a collection for document insertions?
[08:10:31] <partycoder> well mongo doesn't have access control lists
[08:10:41] <partycoder> monitoring can be done through logs
[08:10:45] <partycoder> if you need to take action on that
[08:11:17] <partycoder> then you would like to use something like publish/subscribe each time you insert a document
[08:11:22] <partycoder> in your application
[08:11:30] <partycoder> does that make sense Ameo
[11:23:43] <Lope> lets say I have a document {_id:1, stuff: {a:{one:'
[11:25:15] <Lope> lets say I have a document {_id:1, stuff: {a:{one:'blah'}}} now I want to update stuff.a. I want to add these fields {two:'blah', three:'blah'}. How can I do that?
[11:26:13] <Lope> When I tried an update with {$set:{stuff.a.two:'blah', stuff.a.three:'blah'}} it destroyed stuff.a.one ?
[11:28:09] <Lope> Oh, i think I must use dot notation.
[11:41:57] <kalx> Hi All. Is there anyway to use $bitsAllSet in the other direction, meaning check if field_value & provided_value == field_value?
[11:48:40] <Lope> cool, i got it working.
[12:03:51] <zerivael> Hi, I have a strange problem with old mongodb from 2.4 line. I have a production installation of 2.4.9 and it runs quite fast but when we try to copy it to another machine and restore databases from dump it runs almost 100x slower on querying, inserts are fast (mongostat). Funny thing is that we managed once to get the same speed as in production environment by upgrading mongo to 2.4.14. But when we tried to repeat the preocess it was still slow. Can anybo
[12:37:09] <Zelest> is a db.collection.count({}) heavy?
[12:37:20] <Zelest> or does the index/metadata part handle that automagically?
[12:43:59] <rom1504> try it
[12:44:24] <rom1504> it's pretty fast
[12:55:33] <kurushiyama> Zelest: However, it is unreliabe in sharded environments
[13:00:42] <kurushiyama> Zelest: See https://jira.mongodb.org/browse/SERVER-3645
[15:15:36] <Pirschie> h
[15:15:46] <stennowork> hey Pirschie :)
[15:15:56] <Pirschie> Hi stennowork :D
[15:16:08] <stennowork> yay
[15:16:14] <Pirschie> ow, gotta restart pc now and see if the .NET reinstall worked
[15:17:36] <StephenLynx> wt
[15:17:37] <StephenLynx> wot
[15:17:38] <StephenLynx> .net?
[15:23:33] <pirschie> nop
[15:34:34] <stennowork> Pirschie: well now you can ask your question in this channel :P
[15:35:07] <pirschie> yea, i'm trying out some more things. hopefully that works
[15:36:29] <ramnes> zerivael: did you duplicated the indexes? :)
[15:37:50] <zerivael> turned out dump was done using older mongo 2.0.9, i'm trying to get backup made with newer version and than restore and see what will happen
[15:38:17] <ramnes> zerivael: version shouldn't change much
[15:38:30] <ramnes> just make sure to recreate the same indexes before restoring
[16:48:03] <Pirschie> I keep getting "The application was unable to start correctly (0xc000007b). Click OK to close the application. "
[16:48:08] <Pirschie> when starting mongod.exe
[16:48:25] <Pirschie> I reinstalled .NET, C++ red., did chkdsk
[16:49:29] <GothAlice> Pirschie: Are you running 32-bit?
[16:49:38] <Pirschie> 64 bit
[16:54:00] <StephenLynx> install gentoo
[16:55:13] <GothAlice> Since I don't use Windows, I can only really point you at https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/ Pirschie. AFIK "reinstalling .NET, C++ red." etc. is unnecessary as the MongoDB MSI installer bundles its dependencies.
[16:56:44] <StephenLynx> I warned you about windows
[16:56:47] <StephenLynx> I warned you, bro
[17:01:16] <Pirschie> I did that GothAlice
[17:01:22] <Pirschie> but still error
[17:02:44] <StephenLynx> you didn't installed gentoo, though :V
[17:03:10] <chao> install arch
[17:03:51] <GothAlice> Pirschie: Alas, then you are beyond my ability to assist. As StephenLynx so ineloquently puts, Windows isn't typically considered a "serious" service hosting platform (given the lack of POSIX or overall architecture sanity). I'd recommend getting VirtualBox or another VM system and running MongoDB under a Linux VM.
[17:04:15] <GothAlice> Choice of Linux distribution is effectively irrelevant.
[17:04:49] <StephenLynx> NOOOOO, I will kill for the honor of my distro! >:3
[17:05:13] <Pirschie> Well, can't run virtualbox as it slows my pc down too much
[17:05:26] <StephenLynx> then install as the base system
[17:05:44] <Pirschie> ha
[17:06:05] <GothAlice> Pirschie: That is worrisome; is it a memory issue? Modern virtualization is paravirtualization, i.e. the CPU doesn't really make a distinction between host and VM instructions, making overhead extremely small.
[17:06:22] <StephenLynx> you can either stop working with windows or you can be a serious developer.
[17:06:27] <StephenLynx> wait
[17:06:36] <StephenLynx> I messed up :v
[17:06:37] <GothAlice> StephenLynx: You're… not really helping here.
[17:06:44] <StephenLynx> i r dum
[17:06:45] <StephenLynx> v:
[17:06:49] <Pirschie> seems like i'm the only serious developer here then StephenLynx :D
[17:06:55] <StephenLynx> :v
[17:06:56] <Pirschie> well
[17:07:01] <Pirschie> it's not the memory
[17:07:24] <Pirschie> it's just, everything is going super slow nowadays and my ping dropped by half in every game since a few months
[17:07:38] <GothAlice> Pirschie: Right. Then I'd double, nay, quadruple check your OS is actually running in 64-bit mode, and that your BIOS has VT-x extensions enabled. (Older BIOSes might have that set to off by default.)
[17:07:39] <Pirschie> So running a VM
[17:08:06] <GothAlice> VT-x is required for low-overhead virtualization.
[17:08:31] <Pirschie> hmm
[17:08:39] <Pirschie> well, i am 64 bit
[17:08:48] <Pirschie> not sure about the VT-x
[17:09:34] <StephenLynx> you need to enable some stuff on the bios on most cases
[17:09:53] <GothAlice> Wagh. https://support.microsoft.com/en-us/kb/827218 < clearly, Microsoft isn't particularly good at consistency or simplicity even when it comes to the simple question "am I actually running 64-bit".
[17:10:06] <StephenLynx> that is, if your cpu and bios support
[17:10:27] <Pirschie> Well, my next machine is gonna be dual boot. So then I got both
[17:10:40] <Pirschie> But that's for later
[17:10:47] <GothAlice> "Both"… 32- and 64-bit? 32-bit is dead. :|
[17:11:04] <GothAlice> Let it RIP in peace. ;P
[17:11:15] <Pirschie> linux and windows
[17:11:19] <Pirschie> not 32 bit :p
[17:11:20] <GothAlice> Ah. ^_^
[17:12:00] <Pirschie> btw, this command doesnt seem to work
[17:12:02] <Pirschie> msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-3.2.3-signed.msi ^ INSTALLLOCATION="C:\mongodb" ^ ADDLOCAL="all"
[17:12:23] <Pirschie> it just does nothing, is that normal?
[17:12:46] <GothAlice> The ^'s are line continuation markers, no?
[17:12:57] <GothAlice> I.e. they shouldn't be needed (or desired) if compacted onto a single line.
[17:13:38] <Pirschie> but if I remove them, it's still the same
[17:13:42] <GothAlice> And I'd expect nothing to happen if your command prompt isn't running as Administrator.
[17:13:51] <Pirschie> it is administraotr :p
[17:14:12] <Pirschie> just the line "msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-3.2.3-signed.msi" doesnt do anything
[17:14:14] <Pirschie> great
[17:20:11] <Pirschie> great, reinstalled it 15x in a row and it worked
[17:21:26] <GothAlice> Windows is like that.
[17:30:04] <StephenLynx> kek
[17:33:20] <DrPeeper> good day!
[17:33:50] <foxnesn> many happy returns
[18:03:18] <bakhtiyor> https://gitter.im/mongodb/node-mongodb-native?at=56cc867aa6edbb623dbb8748
[18:03:32] <bakhtiyor> posted question there
[18:08:12] <StephenLynx> >gitter
[18:08:25] <synthmeat> freaky. i rebooted server and mongod failed running with "No map found at top level of YAML config"
[18:08:26] <StephenLynx> ill never understand why people move to these bloated crappy systems.
[18:10:04] <synthmeat> here's config https://gist.github.com/synthmeat/f866d90c98405ccce810
[18:12:56] <GothAlice> synthmeat: Run your config through yamllint.com, then remove the superfluous leading "---" line.
[18:14:06] <synthmeat> GothAlice: already ran it through 2 validators. says all is fine
[18:15:10] <GothAlice> The amount of indentation is unusually wide. YAML is whitespace sensitive, except in specific wrapped sections, so its something that yamllint.com changes that might have an impact.
[18:15:17] <synthmeat> yes, i have 4 spaces
[18:17:56] <synthmeat> short of trying to rebuild mongodb (which is horrible experience on low-mem instances), i'm hitting a wall
[18:23:37] <cheeser> 2 spaces i believe
[18:23:52] <Derick> i thought it just required *spaces*
[18:24:01] <Derick> but I see mine uses 2 too
[18:24:03] <synthmeat> yes, it's just "same number of spaces"
[18:24:13] <cheeser> try with 2 spaces :)
[18:24:38] <synthmeat> i might as well...
[18:24:50] <Derick> synthmeat: you sure you don't have a BOF at the start? run: head -n 1 /etc/mongodb.conf | od -t x1
[18:25:06] <GothAlice> A BOM would indeed cause problems.
[18:25:11] <Derick> (that shows the first line as hex)
[18:25:17] <synthmeat> nope
[18:25:21] <synthmeat> BOM?
[18:25:23] <Derick> nope?
[18:25:25] <GothAlice> Byte Order Marker
[18:25:26] <Derick> can you show the output?
[18:25:38] <synthmeat> Derick: "nope" to the spaces
[18:25:45] <synthmeat> sure, a moment
[18:25:47] <GothAlice> Typically caused by editors on Windows that like to use UTF-16.
[18:26:08] <synthmeat> i actually noticed that in a file of mine the other day, unrelated
[18:26:36] <synthmeat> (i don't use windows, all bsd)
[18:26:56] <GothAlice> It's still a thing that can happen generally.
[18:27:09] <synthmeat> Derrick: https://gist.github.com/synthmeat/4c3c0ea1301619adcf9a
[18:27:34] <Derick> pr...
[18:27:35] <Derick> so no
[18:28:45] <synthmeat> nobomb, says vim
[18:31:55] <GothAlice> synthmeat: The lint site I linked gave modified output. It was my assumption that testing its output (with two-space indentation) would be a reasonable diagnostic step. Apologies if I was unclear on that.
[18:32:56] <synthmeat> GothAlice: no need for apologies, and yes, i've tried that. even making another file localy and uploading and various other things
[18:33:15] <synthmeat> i did many package rebuilds on my system today
[18:33:26] <synthmeat> maybe something just broke, and i should rebuild mongodb
[18:34:23] <cheeser> i doubt that. unless you already have a custom build
[18:37:23] <synthmeat> i do, because on freebsd latest port is 2.6.7
[18:38:22] <cheeser> wow. old.
[18:38:38] <cheeser> but i doubt the yaml parsing broke in 2.6.7
[18:38:54] <synthmeat> nah, i have 3.2 manually patched and built
[18:41:14] <Derick> patched? :)
[18:41:33] <synthmeat> well, it worked!
[18:41:43] <synthmeat> anyways, ugh, did you see how big binaries are?
[18:41:50] <GothAlice> For various definitions of "working". :P
[18:41:54] <synthmeat> mongo with full tool set, binaries are almost 1.5GB
[18:42:04] <GothAlice> Say what now?
[18:42:12] <synthmeat> yeah
[18:42:33] <synthmeat> i need ~3GB just to link that monster
[18:42:41] <cheeser> /usr/local/Cellar/mongodb/3.2.1 (17 files, 208.4M) *
[18:43:21] <GothAlice> mongodb-linux-x86_64-amazon is 60MB.
[18:43:26] <GothAlice> (Compressed download.)
[18:43:44] <kalx> Hi All. Is there anyway to use $bitsAllSet in the other direction, meaning check if field_value & provided_value == field_value?
[18:43:46] <synthmeat> https://gist.github.com/synthmeat/cd70710dbecbe4b20f2e
[18:43:52] <Derick> cheeser: mine's 380MB - with debug symbols
[18:44:26] <synthmeat> Derick: so i prolly have it with debug symbols?
[18:44:39] <Derick> I don't know...
[18:44:44] <GothAlice> synthmeat: Ah, you're… actually not entirely sure what you've got there. Statically linked, with symbols?
[18:45:02] <GothAlice> Those are ludicrous binary sizes.
[18:45:07] <cheeser> indeed
[18:45:08] <Derick> at least it's not HHVM, which at one point gave me a 1.8GB binary
[18:45:10] <synthmeat> dunno really, i'm using this makefile ftp://ftp.wart.ru/pub/download/mongodb3.tar.gz
[18:45:27] <cheeser> that's a tarball :)
[18:45:28] <synthmeat> (it's not distribution, just makefile and distinfo etc)
[18:45:36] <GothAlice> For comparison: https://gist.github.com/amcgregor/b14a59eb816d8559c653
[18:45:48] <kalx> The only workaround I've been able to see is to use $where with a custom js function
[18:46:40] <synthmeat> you know what? apologies for my french, but fuck freebsd
[18:47:14] <GothAlice> synthmeat: Mac is effectively also BSD…
[18:47:35] <synthmeat> and ios. and ps
[18:47:41] <GothAlice> synthmeat: So getting an order of magnitude larger binary size is likely a PEBKAC issue. ;P
[18:47:50] <synthmeat> pebkac?
[18:48:13] <GothAlice> "Problem Exists Between Keyboard And Chair"
[18:48:30] <StephenLynx> kek
[18:48:30] <synthmeat> yeah, i'd bet on that too
[18:48:36] <GothAlice> I.e. there's something you're suppling to ./configure or friends causing that.
[18:49:43] <synthmeat> i'm having numerous other issues with this though, everything's kinda built to work with linux nowadays
[18:49:54] <synthmeat> nothing unsolvable, but eh
[18:53:54] <GothAlice> kalx: Isn't https://docs.mongodb.org/manual/reference/operator/query/bitsAllClear/#op._S_bitsAllClear the inverse?
[18:55:21] <foxnesn> is there a best practice for managing collections?
[18:55:21] <Gevox> Hello, I'm working on some HA architecure research and taking a deeper look into the MongoDB HA Architecure'. A question raised while reading docs about the replication model. What happens if the primary node have failed while the secondary are still reading the oplog (i.e they are not done of a complete sync)?
[18:56:21] <GothAlice> Gevox: Then they're stale, and election will take place only between nodes with the latest operation applied.
[18:57:00] <GothAlice> Whatever the "latest" is according to the cluster, that is; if all nodes are stale, the least stale one will win if it can.
[18:57:05] <Gevox> GothAlice, so there is a high potential that an incomplete version of the data goes live.
[18:57:52] <GothAlice> Initial sync is a touchy area, true.
[18:58:10] <Gevox> Is there any supporting documents by the Mongo architectes demonstrating the pros and cons of the currently used architecure, why did they prefereed that one over others etc?
[18:59:18] <Gevox> Something from the labs, because the docs are full of cleared statement about what is actually going on, not why.
[18:59:58] <kalx> GothAlice: That would essentially be field_value & provided_value = 0. Not quite the same. I supposed I could take the inverse of my provided_value and then look for the !$bitsAnySet
[19:00:01] <GothAlice> But initial sync is equivalent to a RAID rebuild; if the process is interrupted, it's bad. How bad would vary from instance to instance. A clean set of nodes would initial sync almost instantly (no operations to apply) after which you could load it with data. This would be the "safest" way to set up a replicated cluster. Migrating an existing large dataset to a replicated cluster is… a different bucket of bolts.
[19:01:06] <GothAlice> Gevox: With WiredTiger being the default back-end, now, I'd check out the WiredTiger mailing list traffic.
[19:01:47] <GothAlice> Gevox: http://source.wiredtiger.com/community.html
[19:02:52] <uuanton> anyone else using centos 7 for mongodb
[19:03:25] <Gevox> GothAlice, Thank you, I will dig into that
[19:03:50] <uuanton> seems like when you install using yum /lib/systemd/system/mongod.service missing
[19:08:38] <GothAlice> As well as JIRA tickets relating to architectural decisions, such as https://jira.mongodb.org/browse/SERVER-14561 (though this particular example contains less discussion and more links to Github change sets.)
[19:08:47] <GothAlice> Gevox: ^
[19:10:12] <Gevox> GothAlice, Ok, I will try to act as a good stalker
[19:13:34] <synthmeat> btw, someone apparently heard me and JUST NOW added a mongodb 3.2 port :D
[19:13:49] <synthmeat> good to rant online
[19:14:18] <synthmeat> Port added: 23 Jan 2016 12:47:08
[19:14:30] <synthmeat> Port Added: 23 Jan 2016 14:36:33
[19:14:57] <synthmeat> whoever did it, saved me 2 days of moving off of freebsd to ubuntu :D
[19:18:49] <Derick> synthmeat: hah
[19:19:41] <synthmeat> yeah. close call
[19:23:17] <foxnesn> 2 days?
[19:26:49] <synthmeat> yeah, i guess, 'till i iron all the kinks. sure. 2 days
[20:27:31] <djMax> so I have a 3 member RS. 2 members have died, and I am trying to bring up new members while they try and figure out what blew up. Of course, I can't add them to the rs because there's only 1 member... Is there anything I can do to bring the RS back up?
[20:30:49] <foxnesn> RS ?
[20:30:57] <foxnesn> rackspace?
[20:31:26] <cheeser> replica set
[20:33:50] <Doyle> djMax, for quickest recovery, disengage the RS from your application layer, and kick off an initial sync with a new secondary
[20:34:21] <Doyle> Once that's complete and comes up as secondary, start another initial sync to bring up the second secondary
[20:34:21] <djMax> ok thx. Making the single member the only member won't blow shit up?
[20:35:21] <Doyle> djMax, with a single member you're in a high risk situation for complete failure. Priority one is typically the recovery of a secondary
[20:35:52] <djMax> agree. Just wanted to make sure reducing to one while no apps connected wouldn't blow up on principle
[20:35:52] <Doyle> As long as the single member comes up as primary, you can do an init-sync... as far as blowing shit up, I'm not sure in what capacity you mean.
[20:36:50] <Doyle> As far as apps go, they'll stall if you block their access to that RS. I only recommend that to help expedite the recovery of a secondary
[20:37:03] <Doyle> if your load is light, you can leave it online with your app
[20:37:29] <Doyle> If the data to sync isn't much, you could also just leave it online. I think in terms of multiple TB/rs...
[20:39:00] <zeioth> using the C# driver, InsertMany() will continue inserting even if one document has a DuplicateKey?
[20:39:04] <Doyle> You may want to perform a mongodump of critical data also
[20:40:03] <cheeser> zeioth: by default it will not
[20:40:13] <cheeser> you have to tell it you don't care about order
[20:40:40] <zeioth> oh, same that a bulk operation then, thank you cheeser ^^
[20:40:46] <cheeser> np
[20:43:13] <djMax> Doyle, worked like a charm, thanks much.
[21:59:40] <kalx> Hi all. How can I figure out why mongo CPU would be jumping to 100% (across all 8 cores on a test machine) for a query. The query runs on an index, but the last condition requires a scan to look for matching values. However, we're only talking about 200k records here.
[22:00:22] <kalx> Explain shows that no sorting is required -> an idx scan + filter.
[22:03:41] <kalx> (30 executions of said query in parallel taking around 15sec)
[22:05:00] <Doyle> It looks like there's no configuration for journal path. Do people typically add a simlink when mounting dedicated volume for it?
[22:52:57] <rook2pawn> i want to use jsonschema. Can i just remove/not use mongoose if I am going to be using jsonschema?
[22:56:00] <GothAlice> rook2pawn: Current advice seems to run along the lines of a) mongoose is terrible, and b) MongoDB now has document validation built-in, so requiring a DAO/ODM for that is… excessive.
[22:56:18] <GothAlice> Ref: https://docs.mongodb.org/manual/core/document-validation/
[22:58:03] <GothAlice> MongoDB document validation is infinitely more expressive than typical field → type mapping.
[22:58:11] <GothAlice> (Though you can do that, too. ;)
[22:59:27] <Derick> i feel like it doesn't get enough attention really
[22:59:32] <Derick> time to write some posts on it
[22:59:55] <StephenLynx> +1 on mongoose being awful
[23:00:26] <GothAlice> Yeah, Derick, even I'm considering pumping out some "your ODM is now deprecated" inflammatory posts. ;P
[23:01:54] <rook2pawn> @GothAlice: The reason I like json-schema is that you can throw these schema's everywhere, not just for database stuff. Does using json schema instead of the built-in validator seem fine?
[23:02:32] <GothAlice> It's a question of integrity. Validation schemas within the database will better guarantee integrity.
[23:02:46] <GothAlice> If your DAO is required to touch your data, touching your data with things like the mongo shell will bypass your rules.
[23:02:53] <rook2pawn> I have json schema in my API routes, in form submissions, everywhere. This way i define them once, in a single way, taht is agnostic of a database type
[23:03:21] <GothAlice> rook2pawn: Then an obvious solution would seem to involve automatic translation of your JSON schema to a MongoDB validation schema.
[23:03:29] <StephenLynx> schema validation isn`t required when your db doesn`t work based on it.
[23:03:30] <GothAlice> Which… ought not be very difficult.
[23:03:37] <StephenLynx> you are just wasting your energy
[23:31:46] <kalx> I can reproduce it easily so source is known. Wondering if there's any tools/options to enable better logging to figure out exactly why the cpu spike occurs.
[23:32:14] <kalx> The query plan uses an index but requires a scan in the end for the final matching condition (so execution plan is a filter + idxscan). Running 30 of these queries in parallel pushes cpu to 100% across 8 cores for ~15 seconds.
[23:32:46] <GothAlice> kalx: It'd be important to identify the source for the "load". Under "top" is the CPU time for mongod spent mostly in "user", "system", or "wait"?
[23:35:03] <GothAlice> I.e. under "top" I get a third line like: "%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st" — indicating 0% user, 0% system, 0% nice'd, 100% idle, 0% wait, 0% hardware interrupt, 0% software interrupt, 0% stolen by hypervisor.
[23:35:04] <kalx> GothAlice: All user
[23:35:26] <GothAlice> What's the third line of "top" output for you, in the summary section?
[23:35:37] <kalx> %Cpu(s): 97.6 us, 1.9 sy, 0.0 ni, 0.2 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st
[23:37:47] <GothAlice> Hmm. (Confirmed: Linux) I can assist with BSD/Mac process sampling/spindumping, but not so much on the Linux side, for capturing what mongod thinks its doing.
[23:40:08] <GothAlice> kalx: Can you gist/pastebin the .explain() of the query you are running, the query, and an example document? You mentioned earlier you had many such documents returned in response to this query.
[23:44:39] <bros> I currently have 1 tall MongoDB server. I read you can shard on the same machine to improve performance due to multiple CPU cores, is this correct?
[23:46:26] <StephenLynx> hm
[23:46:29] <StephenLynx> don't think so.
[23:46:50] <StephenLynx> that is, im pretty sure mongo is designed for a multi-core environment.
[23:49:50] <cerjam> howdy folks
[23:50:02] <cerjam> i'm having a bit of a problem with mongodb silently crashing
[23:50:07] <cerjam> and its driving me wacko
[23:51:44] <GothAlice> What's your disk utilization, and is there anything at all in the logs?
[23:51:53] <GothAlice> (both df -h, and df -i, BTW.)
[23:52:31] <cerjam> i've got it running in a debian8 openvz container, centos host
[23:52:39] <cerjam> all df is way low
[23:52:46] <cerjam> 40% use on drive, inotes 2%
[23:52:52] <cerjam> nodes*
[23:53:04] <cerjam> i couldve sworn i saw it get task killed in syslog for RAM
[23:53:09] <cerjam> but its got 20gb assigned to container
[23:53:11] <cerjam> so how the hell?
[23:53:39] <bros> StephenLynx: Should I shard at all?
[23:53:55] <bros> What are the qualifying questions/breaking points for "ok, it is time to shard"?
[23:54:49] <StephenLynx> can your single server handle it?
[23:55:32] <bros> It can, but I have it on the same host as 20 node.js microservices
[23:55:58] <GothAlice> cerjam: Cool beans, so it's probably not dying due to failing allocation. Memory utilization is predominantly virtual, with memory-mapped on-disk files and some "real" working memory for query space. Too-big queries should die gracefully, though. (If you are doing an aggregate query, investigate the allowDiskUse option of https://docs.mongodb.org/manual/reference/method/db.collection.aggregate/#definition )
[23:56:09] <cerjam> http://pastebin.com/raw/QvL7AVz8
[23:56:13] <cerjam> thats what i got in mongodb.log
[23:56:29] <cerjam> i left for an hour and come home with that.
[23:56:34] <StephenLynx> then don`t shark.
[23:56:36] <StephenLynx> shard*
[23:56:38] <GothAlice> cerjam: Uh, did you notice the "WARNING: You are running in OpenVZ. This is known to be broken!!!" note in there?
[23:56:48] <StephenLynx> when it can either not store all the data or not handle the load
[23:56:51] <StephenLynx> then you shard.
[23:56:53] <bros> StephenLynx: Ok. Should I move it to a separate dedicated machine?
[23:56:58] <GothAlice> cerjam: https://jira.mongodb.org/browse/SERVER-1121
[23:57:03] <StephenLynx> if your current server is too stressed
[23:57:12] <bros> StephenLynx: what's a good way to measure "too stressed"?
[23:57:18] <StephenLynx> or you know it will be
[23:57:32] <StephenLynx> in peak ours, does your software becomes unresponsive?
[23:57:35] <cerjam> perhaps i didnt google that enough
[23:57:42] <cerjam> the result for it just said eh thats old been fixed
[23:58:01] <GothAlice> Not if your logs are emitting that, no.
[23:58:20] <bros> StephenLynx: It could be a touch faster. Some things do get pretty sluggish.
[23:58:21] <GothAlice> You're running v2.4.10, which is old and deprecated.
[23:58:33] <StephenLynx> then start moving stuff around.
[23:58:37] <GothAlice> cerjam: Like, insanely old at this point.
[23:58:44] <StephenLynx> first I would put it on a dedicated server.
[23:58:47] <bros> StephenLynx: I have it on a 4 CPU machine now. Is it a step back to move it to a dedicated 2?
[23:58:56] <StephenLynx> mixing db and application is literally dev-tier
[23:59:08] <bros> StephenLynx: does the same apply for redis or no?
[23:59:29] <StephenLynx> depends, if your usage is IO intensive, then moving to a 4 core server will help.
[23:59:39] <cerjam> interesting.
[23:59:42] <GothAlice> There's also the availability and redundancy thing, like RAID.
[23:59:43] <StephenLynx> if its CPU intensive AND your current sofware makes good usage of all the cores, then no.
[23:59:57] <GothAlice> Running three copies on the same physical hardware, in VMs, protects you from nothing.