PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 13th of September, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:03:40] <INSANU> night
[00:03:53] <INSANU> anyone here does make use of mangrove?
[00:08:16] <cheeser> it's pretty new and experimental. i don't think anyone's mentioned using it here.
[00:09:10] <INSANU> cheeser: thank you
[00:23:07] <bros> How many EC2 instances should I have for a production MongoDB set?
[00:26:26] <cheeser> at least 3 because you'll want a 3 member replSet at minimum
[00:43:54] <bros> cheeser: where do I put the "router" or whatever it is called then?
[00:43:56] <bros> on one of the 3?
[00:44:00] <bros> they all have to be equal size?
[00:54:00] <jstream> i tried using mongodump and mongorestore to move an application and its database to another, soon-to-be production server. except surprisingly, the application on the production server is behaving as though there are multiple copies of the same obj stored in the db.
[00:54:41] <jstream> I put on a bandaid by checking to see if an obj had already been read before adding it, and that fixed the problem
[00:55:00] <jstream> but, i never encountered this problem on the original server
[00:56:10] <jstream> curiously, when I use mongo on the production server, i cant find any duplicate copies of objects -- at least by searching for _id's
[00:57:23] <jstream> I wonder if this might be happening because when i moved the database, i did NOT use the point-in-time option
[00:57:34] <jstream> should I have?
[01:07:29] <cheeser> with mongorestore you can pass --dump to remove the existing collection before restoring the dumped data
[01:18:59] <jstream> ty cheeser
[01:29:28] <cheeser> np
[07:27:02] <anubhaw> does anyone know answer to this question or point me to the right resource.
[07:27:04] <anubhaw> https://stackoverflow.com/questions/30882629/does-performing-a-partial-update-on-a-mongodb-document-in-wiredtiger-provide-any
[07:29:19] <anubhaw> if you don't want to follow the link then question is this. "Does performing a partial update on a MongoDb document in WiredTiger provide any advantage over a full document update?"
[08:32:31] <catphish> hi, i have just added a node to my replica set, but it seems to be writing to disk a lot more than any other nodes in the cluster, my primary is writing about 20 operations per second, the new secondary is writing about 500, is there any obvious reason for the disparity?
[08:32:56] <ranman> if you just added it is it potentially grabbing the data?
[08:33:08] <ranman> or did you restore it from a backup?
[08:33:19] <ranman> it could be syncing?
[08:33:28] <catphish> it's finished syncing i believe
[08:34:03] <catphish> i didn't rsync, i just let it pull the database, but thats now complete
[08:34:07] <catphish> i'll paste some info
[08:34:08] <ranman> are the nodes the same hardware and config?
[08:34:29] <ranman> it could be building indexes? I can't remember if repl sets build the indexes after sync or before
[08:34:51] <catphish> is there a way i can check if its building indexes?
[08:34:55] <catphish> that sounds plausible
[08:35:01] <ranman> https://docs.mongodb.com/manual/core/replica-set-sync/
[08:35:04] <ranman> looks like step 3
[08:35:27] <ranman> the simplest way would be https://docs.mongodb.com/manual/reference/method/db.currentOp/ I think
[08:35:31] <ranman> on the replica node
[08:35:32] <catphish> the member is in secondary state though
[08:36:40] <ranman> does your app have secondary preferred or nearest perhaps?
[08:37:01] <catphish> nope, the app is currently unaware of the new secondary i believe
[08:37:47] <catphish> unless it's learned about it from the primary and is using it, i would not expect that to be the case
[08:38:43] <catphish> this is the currentOp(): http://paste.codebasehq.com/pastes/7gze842p1qty3fqz6p
[08:43:02] <catphish> these are the io stats across the cluster http://paste.codebasehq.com/pastes/glv3muysv3jgruu2xn
[09:35:22] <Zelest> could someone update the topic? :P *poke Derick*
[09:35:30] <Zelest> the version numbers that is
[09:35:36] <Derick> I can I suppose
[09:35:44] <Derick> I'd rather just remove them
[09:36:12] <Derick> now it can't be out of date anymore ;-)
[09:41:30] <catphish> so, is there any way i might be able to trace what operation is causing my huge number of disk writes?
[09:46:17] <catphish> i cant work out if this is some kind of one-off operation, or just extremely inefficient ongoing replication
[09:47:11] <Derick> slow queries show up in the log
[09:48:16] <catphish> this host is currently a secondary with no clients
[09:48:37] <catphish> ie just receiving a copy of all writes done on my primary
[09:52:26] <Derick> so check the primary log for slow queries?
[09:52:33] <Derick> iostat could also help
[09:52:35] <Derick> and mongostat
[10:00:43] <catphish> ah, i've not seen mongostat before
[10:03:27] <catphish> Derick: sorry, i guess you missed my original question, i have a primary and a new secondary, the primary is (afaik) handling all the clients, and is doing about 20 disk writes per second, the secondary (which is new, but has progressed to secondary state), should be doing nothing but replicating the primary, but is running hundreds of writes per second
[10:06:16] <Derick> what sort of updates are you doing?
[10:07:20] <catphish> the workload is mostly updates, i'll have to look at the queries
[10:09:03] <catphish> here's montostat http://paste.codebasehq.com/pastes/a8edlt6ia11irbjlnp and iostat http://paste.codebasehq.com/pastes/7j2bcz22u1i0ivrtdy
[10:09:45] <catphish> *mongostat
[10:16:12] <catphish> i'm not really sure what information you're asking for when you say "what sort of updates"
[10:17:38] <catphish> but these updates obviously run very fast on the primary
[10:18:08] <catphish> so either the secondary is running the same updates in a less efficient manner, or its doing something else i'm not aware of
[10:18:16] <catphish> (that the primary isn't doing)
[10:36:48] <catphish> i just noticed my replication is from mmapv1 to wiredTiger, with the latter being the problematic host
[12:55:51] <kees_> hey all, does anyone know why the mongo-php-driver connecting to dead members of a replicaset / arbiters?
[12:56:28] <kees_> i had to reboot an arbiter, and suddenly my error logs were full with connectionTimeoutExceptions
[12:56:56] <kees_> rs.status(), the exception and the connectstring: http://pastebin.com/XT0xq24z
[12:57:14] <cheeser> kees_: https://www.mongodb.com/blog/post/server-discovery-and-monitoring-next-generation-mongodb-drivers
[13:01:53] <kees_> hm, ok that explains it a bit, but i still see no need to connect to arbiters or nodes the cluster already deemed dead
[13:04:51] <cheeser> what if they come back up? they still need to be monitored because they're listed in the topology
[13:06:21] <kees_> true, but you can detect that from the other nodes that do work i guess
[13:06:51] <kees_> my php app isn't really happy with this behaviour tho, as it reconnects all the time
[13:08:03] <cheeser> that's the nature of the php driver, iirc
[13:08:20] <cheeser> the other nodes, though, don't keep track of the health of the cluster.
[13:08:38] <kees_> ah
[13:08:47] <kees_> are there any settings to tune this behaviour? i can't really reconfigure the replicaset every time a host goes down and have my php app wait for 300ms to connect to a server not in the seed list
[13:09:35] <kees_> i know discovery and all can have advantages, but if it is killing my performance i'd rather have a less flexibel but more performant setup
[13:10:25] <cheeser> arguably, your cluster is the problem if you have nodes dying. fixing that will fix your perf problems.
[13:11:58] <kees_> it was a planned reboot this time, but i guess i'll just have to reconfigure the cluster next time before i reboot
[13:13:04] <cheeser> didn't the perf go back up when the nodes came online?
[13:13:11] <kees_> yes it did
[13:13:16] <cheeser> great.
[13:13:55] <cheeser> there was at one point an SDAM daemon for drivers like the PHP driver that couldn't do the SDAM work in a thread. did that one escape the lab?
[13:16:37] <kees_> i guess i'll just need to rework my mongo architecture to include some sort of mongodb proxy so my (short lived) php apps can connect to localhost and dont have to check the entire cluster for almost every request
[13:17:40] <cheeser> you should consult the mongodb-users list or wait for Derick to notice.
[13:20:19] <Derick> kees_: for those apps, don't connect to the mongod as a replicaset then
[13:21:18] <kees_> hm, good point, i thought it was mandatory if you used a replicaset :)
[13:21:52] <Derick> no, just "mongodb://localhost:27017" should do
[13:22:07] <Derick> unless the cdriver does something clever
[13:22:20] <cheeser> you run the risk of connecting to a secondary that way
[13:22:26] <Derick> yes
[13:26:02] <kees_> would be nice to have a middleway, still have the ability to detect primary/secondary, but without connecting to all the members
[13:26:29] <Derick> that's not possible
[13:26:42] <cheeser> primary can change. you need to track the other nodes so you can find it if it does.
[13:29:27] <kees_> or just throw an error if the primary isn't found in the initial seed list
[14:16:37] <ashp> Hey guys, maybe I don't understand indexes but..
[14:16:39] <ashp> https://gist.github.com/apenney/b86ee2447777b61564467c033f4dcc46
[14:16:57] <ashp> In this case it does a long scan of 1.2M entries rather than using the index that seems to exist
[14:17:09] <Derick> db..employer_email.getIndexes()
[14:17:12] <Derick> db.employer_email.getIndexes()
[14:18:02] <ashp> https://gist.github.com/apenney/b86ee2447777b61564467c033f4dcc46 updated - not sure why it has the word test in it now
[14:18:14] <Derick> name of the database
[14:18:34] <Derick> what's your query?
[14:18:47] <ashp> all the info I have really is: "query db.employer_email query: { employerId: ObjectId('576865fe9b221298341f16ae') } "
[14:18:57] <ashp> so I assume it's literally just passing in an employerId and hoping to get the whole thing back
[14:19:26] <ashp> well, GREAT
[14:19:30] <ashp> i made all these indexes on the wrong database
[14:19:45] <Derick> :)
[14:20:17] <Derick> "test" is the default database if you don't specify one
[14:20:46] <ashp> We had DatabaseName:PRIMARY> at the start of the prompt
[14:20:52] <ashp> and i mistakenly thought that was the database it was using!
[14:20:52] <ashp> ha!
[14:20:57] <ashp> no wonder all those indexes were so fast to apply
[14:22:39] <ashp> We're going to sort out a 2.6->3.0 WT update (hopefully for this weekend)
[14:22:45] <ashp> ahead of building the new cluster, so that should drastically help too
[14:36:23] <jadew> hey, what's a good way of generating an insert error?
[14:36:35] <cheeser> a duplicate _id
[14:36:40] <jadew> thanks
[14:46:35] <jadew> is there a way to have a failed bulk write, rollback automatically?
[14:47:08] <cheeser> the document that failed to write won't be present/updated in the database.
[14:47:29] <jadew> I'm afraid that manual rollback could also fail, in which case you're left with an unknown state
[14:47:49] <jadew> cheeser, yeah, but that means you have to cross reference them
[14:48:04] <jadew> that can add a lot of complexity
[14:48:10] <cheeser> yes, it can.
[14:48:17] <cheeser> well, wait.
[14:48:37] <cheeser> you should know which doc fails. i think that's indicated in the response type
[14:49:39] <jadew> yeah, but what can you do about it?
[14:49:59] <jadew> the recovery scenario is just too complex for something that doesn't expect this to happen
[14:50:20] <cheeser> fix the reason that particular update failed? skip that one and do the rest?
[14:50:34] <jadew> yeah, I'd like to completely halt
[14:51:12] <jadew> so.. no way, eh?
[14:51:23] <cheeser> to rollback all the other updates? no.
[14:51:31] <jadew> ok, thanks
[14:51:36] <cheeser> mongo doesn't have multidocument transactions
[14:52:31] <jadew> well, I guess I'll just make it try to manually rollback, crash and prevent furthern instances from running
[15:18:42] <allfro> hi
[15:18:54] <allfro> has anyone built a production cluster on docker swarm ?
[15:19:42] <allfro> is it basically a waste of time because of the dynamic hostname issue?
[16:17:14] <daumie> can someone please show me how to catch uploaded files and CRUD them
[16:20:14] <StephenLynx> v:
[16:20:20] <StephenLynx> that's unrelated to mongo.
[16:20:36] <StephenLynx> how is the file being uploaded? what is your runtime environment?
[16:32:31] <daumie> am using multer as the middleware
[16:32:48] <daumie> Generally ma using the MEAN stack StephenLynx
[16:33:31] <StephenLynx> no idea what multer is
[16:33:52] <n1colas> Hello
[16:34:03] <StephenLynx> if you are using node
[16:34:14] <StephenLynx> then you should check how to insert the file in gridfs.
[16:34:20] <StephenLynx> that is, if you wish to store files there.
[16:34:42] <StephenLynx> after that you have to learn how to serve them
[18:41:56] <AlmightyOatmeal> i'm using Python to cache ElasticSearch data in MongoDB but i was wondering if there was a bulk operation that wouldn't throw an exception if a duplicate key exists but either silently ignore it (and continue processing the remainder of the batch) or update the existing object if it already exists?
[18:42:14] <AlmightyOatmeal> s/bulk/batch/
[18:43:15] <StephenLynx> did you try bulkwrite? I don't remember if it would stop everything when hitting a duplicate unique index.
[18:43:53] <GothAlice> AlmightyOatmeal: If you want to insert, or update if existing, you want the "upsert" option.
[18:44:31] <GothAlice> If you're using bulk operations, https://docs.mongodb.com/manual/reference/method/Bulk.find.upsert/ or your driver's equivalent may be useful. Otherwise it's just an option to the .update() call.
[18:45:07] <GothAlice> https://docs.mongodb.com/manual/reference/method/db.collection.update/#upsert-behavior
[18:59:53] <AlmightyOatmeal> GothAlice: awesome! thanks :)
[19:01:12] <AlmightyOatmeal> GothAlice: also, i like the nick :)
[19:23:33] <catphish> so, i don't understand memory mapped files very well, but it seems to me that mongo maps as much as possible, which rather upsets my free memory monitoring mechanism, is there some way to find out how much memory is mapped (but actually available to other processes)?
[19:24:49] <GothAlice> catphish: https://gist.github.com/amcgregor/4fb7052ce3166e2612ab#memory
[19:25:20] <GothAlice> Your monitoring should be measuring RSS, not VSZ.
[19:25:51] <txm> Hi. AES encryption at rest, https://docs.mongodb.com/manual/core/security-encryption-at-rest/, can this be done with the open source version or enterprise only? I note “Available for the WiredTiger Storage Engine only.”
[19:26:37] <GothAlice> txm: Right above the warning mentioning it's available for WiredTiger is another warning: Available in MongoDB Enterprise only.
[19:36:34] <AlmightyOatmeal> StephenLynx: i didn't see your response earlier, my apologies. afaik all bulk/batch operations will fail if a duplicate key is found but there is a method that would allow me to essentially do update calls, instead of insert, but that would mean i would have to iterate over the list of data i want to send to build a new array of data i want to send which introduces additional overhead :(
[19:43:12] <StephenLynx> yeah, then you'd like to look at upsert, like alice said
[20:04:43] <Doyle> Doesn't this: "Use CNAMEs to identify your config servers to the cluster so that you can rename and renumber your config servers wi1thout downtime." conflict with: "If you start a mongos instance with a string that does not exactly match the string used by the other mongos instances in the cluster, the mongos instance returns a Config Database String Error error and refuses to start."?
[20:04:46] <Doyle> as seen here: https://docs.mongodb.com/v3.0/core/sharded-cluster-config-servers/, https://docs.mongodb.com/v3.0/tutorial/deploy-shard-cluster/
[20:11:59] <kuku1g> Is it possible to have a single node in two replica sets? for example, i want node1 to be in rs0 and rs1
[20:12:15] <cheeser> no
[20:13:16] <kuku1g> @cheeser I have 5 nodes and want to split up my data evenly but have data only replicated once. How do achieve it then? I wanted to have 5 replica sets but this won't work then
[20:13:39] <cheeser> only replicated once?
[20:13:46] <cheeser> as in, the data should only be on one node?
[20:14:05] <kuku1g> No, sorry, I meant one replication of the data. So data is available twice
[20:17:19] <kuku1g> @cheeser When I create a replica set with 3 nodes and one with 2 nodes, data is only sharded two times. I want to benchmark Cassandra vs MongoDB for my usecase. I think the setup is not equal.
[20:17:36] <kuku1g> In my Cassandra ring, data is evenly distributed over the 5 nodes.
[20:18:17] <Doyle> Nevermind. I found the line I remembered reading. "These records make it possible to change the IP address or rename config servers without changing the connection string and without having to restart the entire cluster."
[20:25:40] <catphish> GothAlice: thanks, i was actually mistaken, my memory monitoring works fine, and only looks at rss :)
[20:27:45] <kuku1g> @cheeser or do i misunderstand the concept of a sharded collection? can I have one replica set of 5 nodes and one sharded collection that will distribute all data across the nodes evenly?
[20:28:21] <kuku1g> it doesnt work that way right? one replica set will cause all nodes in the RS to have the same data?
[20:33:06] <cheeser> replica sets and sharding are two different things, kuku1g
[20:35:45] <kuku1g> does that mean that I can have a collection sharded on my 5 nodes without needing the replica sets?
[20:36:28] <kuku1g> as in "the replica sets are just there to maintain availability in case of hardware failure"?
[20:40:49] <cheeser> a shard typically consists of a replica set.
[20:41:04] <kuku1g> I just want to benchmark. And benchmark the actual system as good as possible.
[20:41:14] <cheeser> so a sharded cluster with 5 shards will be at least 15 machines: 5 replica sets of 3 members each
[20:41:26] <kuku1g> When a replica set involves faster reads because data is deployed on more machines, this is not equivalent to my cassandra setup!
[20:41:42] <cheeser> you don't *have* to have a 3 member replSet but for production that's the lowest recommendation
[20:42:23] <kuku1g> I see. that's for production though. I want to benchmark the system performance for now
[20:43:22] <kuku1g> I think the best solution I can come up with is a sharded collection without a replica set for mongodb so data gets evenly distributed on the 5 nodes. as for cassandra, i would also use no replication.
[20:43:59] <cheeser> sounds reasonable
[20:44:56] <kuku1g> do you have a rule of thumb on how much a replica set increases the read performance for mongodb?
[20:45:17] <kuku1g> like in "it does affect it a lot" or "not so much"
[20:48:00] <kuku1g> I know that it will not affect write performance because only the primary member will be used to upsert data
[20:58:57] <kuku1g> @cheeser the same approach has been used by Datastax for a YCSB benchmark here: http://www.datastax.com/wp-content/themes/datastax-2014-08/files/NoSQL_Benchmarks_EndPoint.pdf
[20:59:18] <kuku1g> So it looks pretty resonable. Thanks for your help.
[20:59:48] <cheeser> np
[21:41:03] <Robbilie> good evening
[21:41:36] <Robbilie> i am running into a mongoerror the past week and i cant really identify the source of it
[21:42:01] <Robbilie> MongoError: operation exceeded time limit, code 50 inparticular
[21:42:30] <Robbilie> would be greate if anyone could advise me on finding the source of this error :)
[21:43:13] <Robbilie> running an oplog enabled 3.2 instance accessed via a nodejs application
[21:47:22] <crazyphil> if I have a sharded 2.6 setup, and I need to turn auth on (mongodb-cr specifically), do I need to set every mongod instance for --auth, or only my config servers, or everything?
[22:16:34] <Robbilie> this channel is so active yet so inactive
[22:20:37] <joannac> It's for questions, so if no one has questions about MongoDB then yes, it is quiet
[22:27:27] <Robbilie> joannac: me and the other guy asked questions though :D
[22:29:07] <joannac> Robbilie: operation exceeded time limit -> probably maxTimeMS
[22:29:40] <Robbilie> not set
[22:29:53] <Robbilie> and i set it to 14 days and it still happened
[22:30:16] <joannac> crazyphil: need to turn on auth for everything. https://docs.mongodb.com/v3.2/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster/
[22:31:06] <joannac> Robbilie: in the shell?
[22:31:21] <Robbilie> on the cursor
[22:31:22] <Robbilie> in nodejs
[22:31:28] <joannac> raw nodejs?
[22:31:32] <joannac> show me your code
[22:31:35] <Robbilie> mongodb native
[22:31:43] <Robbilie> pastebin?
[22:31:50] <joannac> yes
[22:32:33] <Robbilie> http://pastebin.com/raw/RtVf0kqL
[22:32:51] <Robbilie> add a .maxTimeMS(1000 * 60 * 60 * 24 * 14)
[22:34:04] <Robbilie> the error is not instant, happens after some time, with both calling .stream() or .each() on the cursor
[22:34:31] <joannac> why do you have maxTImeMS at all, then?
[22:34:35] <Robbilie> i dont
[22:34:41] <Robbilie> you said it was related to that
[22:34:49] <Robbilie> i tried setting it but didnt change anything
[22:35:10] <joannac> oh, so it happens even without maxTimeMS?
[22:35:25] <Robbilie> yes
[22:38:22] <joannac> open a ticket in https://groups.google.com/forum/#!forum/mongodb-user
[22:38:33] <joannac> I don't know and don't have time to dig further right now
[22:39:24] <joannac> but I haven't seen that message for anything other than maxTimeMS, so it's weird that you're getting it without setting maxTimeMS
[22:48:53] <Robbilie> joannac: well looking at mongos server source its mentioned with some deadline or replication stuff so maybe also related to that…
[23:01:20] <Robbilie> i posted a topic in the forum but i cant find it there wtf…