[04:31:08] <nevan> the mongo became unsresponsie after the script executed succesfully and remained so until i did not killed and started mongod process
[06:48:46] <joannac> check the logs, if they go back that far
[06:49:04] <jhonkola> yes, but exact same query has been running for ~400 secs
[06:49:21] <jhonkola> I copy-pasted the query expression from db.currentOp()
[06:50:20] <jhonkola> explain output is on http://pastebin.com/pLMw92hq
[06:50:49] <jhonkola> What should I look for in the logs
[06:51:09] <jhonkola> last night I could not find anything suspicious
[06:51:32] <joannac> no idea, but mongodb is servicing the query in 107ms
[06:56:50] <jhonkola> http://pastebin.com/rDn3e2gP contains currentOp() output of the same query I ran from shell that had taken 163 seconds when I ran currentOp()
[06:57:06] <jhonkola> some parameters were replaced with aaa...
[06:58:23] <jhonkola> could the reason be that sometimes mongod fails to find suitable index for query
[06:58:40] <jhonkola> then the long running time would make sense as the collection is large
[07:01:39] <joannac> jhonkola: yes, that's possible
[07:02:25] <joannac> that's a massive number of yields
[07:03:12] <joannac> what else is running on that system?
[07:04:52] <jhonkola> It is storing data from sensor network
[07:05:24] <jhonkola> lot of messages coming from aws SQS and then inserted to wait for further processing
[07:07:19] <jhonkola> there are enough queries that if index determination fails even occasionally it will be a problem
[07:10:04] <joannac> your writes might be starving out reads?
[07:12:47] <jhonkola> the problem that follows from long running queries is that the message writers eventually all block while waiting for query to finish
[07:13:11] <jhonkola> thus after a short while all message writers are stuck on query
[07:16:27] <jhonkola> Also during the problem query there is lot of disk activity, looks like mongodb is scanning the entire collection
[07:16:42] <jhonkola> there are no other processes running in the computer
[07:17:21] <joannac> you sure you're explaining the same query that's stuck?
[07:17:38] <joannac> the query you're explaining scans 2 documents
[07:17:59] <jhonkola> could have been one of the other ones that were running at the same time
[07:18:27] <jhonkola> I'll get you a new explain shortly
[07:34:14] <jhonkola> http://pastebin.com/kX0neisX there is currentOp() and explain for 2 longest running queries (sorry for needing to obfuscate some values, might make it harder to understand)
[07:37:57] <rspijker> jhonkola: what’s the question?
[07:43:06] <jhonkola> some queries take long time (up to 10000s seen)
[07:43:21] <jhonkola> there should be index available and explain finds that
[07:44:10] <jhonkola> when looking at currentOp() when query is stuck and doing same query from shell explain reports reasonable values
[07:46:58] <rspijker> well… looks like some of them are alreay spending >8s to acquire a lock...
[07:47:06] <rspijker> could it be your DB is very heavily loaded?
[07:48:36] <jhonkola> it has lot of query + insert pairs, query to determine if doc exists, if not then insert
[07:48:56] <rspijker> your explain queries have no results…
[07:49:06] <jhonkola> insertions come from SQS (no uniqueness guarantee there)
[07:49:21] <rspijker> if your explained query uses values for the indexed fields that already yield no results, they are going to be very fast
[07:49:49] <jhonkola> Yes, and the 2 fields should be sufficient to narrow the search set
[07:49:53] <rspijker> if your ‘real’ queries use values for those fields that yield a resulting set of millions of documents, which you then have to narrow down by the unindexed fields, that’s going to be sloooow
[07:56:10] <jhonkola> Could the cause be that query planner fails occasionally, then the long running times would make sense as the collection is large
[07:56:22] <rspijker> ok, so couyld it be that the index does not narrow that down enough?
[07:56:38] <rspijker> take the query that fails on the shell as well
[07:57:15] <rspijker> what happens if you do a count on the 2 indexed fields for the specific values in that query?
[07:58:02] <rspijker> so, if your query was aaa:xxx, bbb:yyy, … ,time: timeVal, indetifier: idVal, … then do a count on {time:timeVal, identifier:idVal}
[07:58:32] <jhonkola> for one in pastebin, count was 1 which is expected
[07:58:57] <jhonkola> the same setup with same indexes etc. has been working fine until this week
[07:59:35] <jhonkola> the load has increased which may just have brought underlying problem to light
[08:00:30] <jhonkola> I guess I'll next try to work around the problem by checking uniqueness of documents by querying only on identifier and time
[08:00:50] <jhonkola> then at least indexes should work ok
[08:02:05] <jhonkola> rspijker and joannac, thanks for help
[08:02:30] <rspijker> sure, weird problem though :/
[12:18:32] <Jadenn> my favourite day http://puu.sh/8XIlu.png
[12:18:46] <Jadenn> its like a ginourmous mysql cruft weight was lifted off me
[12:31:04] <Veejay> Hi, we're thinking of upgrading from 2.4 to 2.6, I had a look at the changelog for 2.6 and I couldn't find any major changes that would break anything
[12:31:13] <Veejay> Does anyone have messages of caution in that regard for me?
[12:31:23] <Veejay> Something I should be aware of?
[12:34:41] <tscanausa> I never trust software that isnt on its 5th patch
[12:35:19] <Veejay> tscanausa: You mean 2.6 is still young?
[12:55:33] <hglattergotz> Anyone familiar with geo spatial search performance issues? Have a 2dsphere index on 900K recs (US and Canada) with GeoJson Point. Queries with $maxDistance greater than 100 miles are very slow. 200 miles takes over 20 seconds.
[14:56:49] <BrianJ> Does a replica set just mean having 2 mongodb instances?
[14:57:12] <BrianJ> that are running under the same set of config servers
[15:16:37] <Lujeni> BrianJ, u must read the doc :)
[16:30:58] <doug1> how can I run mongos in foreground and get log output to screen?
[16:46:44] <doug1> I'm trying to create an admin user with mongo. Where do I run the db.createUser() command? The mongos? The config server? The shards?
[16:47:12] <IndianaJoe> doug1 - run from mongo - the command line interface
[16:47:28] <doug1> IndianaJoe: On which instance? the one running mongos or another?
[16:48:19] <IndianaJoe> not sure. I'm not using sharding. On a replicaset, it needs to be the primary
[16:48:40] <doug1> IndianaJoe: I have a cluster set up. I created the key file... modified mongodb.conf on all instances and restarted. See errors about auth in logs now. I suppose that's expected. Went to mongos box, added user, it was accepted. Now when I try and login to mongo with mongo -u ddd -p ddd i get a socket exception error
[16:49:07] <doug1> The mongo docs don't say which box to run these commands on
[16:49:43] <IndianaJoe> all I can suggest is to look in the logs.
[16:50:07] <doug1> don't need the logs... I got this :) rror: 13106 nextSafe(): { $err: "error creating initial database config information :: caused by :: socket exception [CONNECT_ERROR] for s1r1/mongo-shard-s1-n1.prod.slicetest.com:2701...", code: 11002 } at src/mongo/shell/db.js:1210
[16:50:29] <doug1> ran it on the primary shard... user created. still can't login to mongos. grrr
[16:50:49] <doug1> and I can log into the primary shard with auth. I don't get it
[16:53:44] <doug1> it makes no sense to run it on a shard box I think
[16:54:01] <doug1> but, the docs don't say where to run it. All they say is 'run mongod'
[16:54:19] <doug1> maybe I need to run on the config server.... why not....
[17:17:10] <Fetch> I've read some docs/slideshares about setting mongodb on AWS, but I need some conceptual help. I want to present a single DNS name (mongo.foo.bar) for my internal clients to access for a mongo replica set. If I setup mongo.foo.bar to point to an ELB in front of the replica set, is the client going to get the full seed list from the first server the ELB shuffles it off to? (that would be great) Is a better solution to have each replica set member create an A
[17:25:11] <Fetch> kali: what is a solution to have a single DNS name be effective for connections to a mongodb replica set, then?
[17:25:42] <doug1> oh yeah... reminds me... with two routers... what would I typically put in front? a load balancer or would round robin DNS do? is this stateless or not?
[17:28:37] <kali> Fetch: it's a very bad idea. the mongo client and server exchange adresses of replica set members to be ready to switch over or adresse a secondary.
[17:28:38] <Fetch> kali: alternatively, I run a zookeeper cluster, so I could have replica set members add themselves to a config space there, if there's any real client support for that
[17:30:33] <Fetch> kali: so, generally speaking, everyone keeps their mongo clients configured with a full array of replica set members?
[17:31:23] <kali> Fetch: more or less. but you don't need the array to be exact. as soon as the client manage to connect to one working member, it will pull the actual configuration from the replica set
[17:33:16] <kali> Fetch: you can imagine to have one dns alias that you use to configure the client, a CNAME pointing to one member. the client will connect and pull the full correct config when starting
[17:34:18] <kali> Fetch: but if your "special" node is down, a new client will fail to start. better to list all the replicas in the configuration string to the best of your knowledge, and let mongo adjust what's wrong
[17:34:29] <Fetch> kali: what would be the issue with having multiple entries for the same CNAME record? The client would pull one at randomly, connect, and pull a proper config
[17:35:44] <kali> Fetch: and if it pulls a broken one, you need to wait for a timeout
[17:36:31] <doug1> I'm trying to set up auth... where would I typically run the addUser() command? the shard? the config server? the mongos? the docs don't say
[17:48:28] <MTughan> I'm making a python program to help set up a sharded cluster and am trying to find a way to determine if a database and a collection has been sharded. I don't see any commands to do this in the Python API or in the database commands section, although the shell makes this available through sh.status().
[17:48:38] <MTughan> How can I get that info from Python using PyMongo?
[17:50:18] <doug1> i just dont get it. Which instance in a cluster do I run admin commands on?
[17:50:50] <MTughan> doug1: Typically mongos. That will modify the config servers as necessary.
[17:51:07] <doug1> MTughan: kinda what I figured but wasn't clear. thanks
[17:56:34] <doug1> so... I added the admin user on mongos box. Seems to work... also seems to have 'replicate' to config server.... but the shards I can still mongo to without a password...
[17:58:16] <doug1> I tried to connect from the config server box to the shard box, and auth denied. Ok... so I did it again passing in user/pass and it fails. Huh?
[17:59:25] <doug1> works tho from shard to config box... so obviously the user isn't being replicated to shards (but it is to config server)
[18:23:47] <MTughan> I'm making a python program to help set up a sharded cluster and am trying to find a way to determine if a database and a collection has been sharded. I don't see any commands to do this in the Python API or in the database commands section, although the shell makes this available through sh.status(). Is it possible to get that from Python without querying the config database?
[18:56:44] <jbrechtel> Is there a 'right way' to create mongo users using the Ruby mongo driver? I'm finding db.eval() to be a painful way to do it. In particular, I'm unable to create a second user after I create an admin because I get an 'unauthorized' error.
[18:57:19] <jbrechtel> I've tried authenticating as the admin after I do that but then I still get unauthorized. Am I perhaps racing with the create action by executing the authentication immediately following the create?
[18:57:44] <IndianaJoe> once you have created the first[admin] user, you'll need a db.auth() before you can create others
[18:57:56] <jbrechtel> To be clear, when I try to authenticate as an admin after creating the admin I get unauthorized on the db.auth() for the admin user I just created
[18:58:17] <jbrechtel> I can later log in via the console as that admin user though.
[18:58:21] <IndianaJoe> you've got a problem with your Roles
[18:59:10] <jbrechtel> hmm.... I'm using these: ["userAdminAnyDatabase","readWriteAnyDatabase","clusterAdmin"] ...and mongo 2.4
[18:59:16] <jbrechtel> Maybe I'm using 2.6 roles by accident
[19:29:12] <jbrechtel> Contrary to what I said earlier, authenticate does not fail. authenticate DOES fail if I try db.eval(db.auth()) but db.authenticate() does not fail. However, even with db.authenticate() the subsequent adduser fails.
[19:29:29] <jbrechtel> at this point I feel like I should just shell out to the command line
[19:41:40] <jbrechtel> I don't know why I care about creating that user in the admin database. The annoying thing seems to be trying to authenticate as an 'any database' admin with the Ruby driver. The authentication, for whatever reason, doesn't seem to carry to operations across databases. It's not the same as doing a 'use someotherdb' after authenticating in the mongo console.
[19:41:53] <jbrechtel> If I just create my admin user in my appDb then everything works fine.
[20:14:16] <ekristen> I’m trying to dump documents from a collection where a date is great then and less then two dates
[20:14:26] <ekristen> the query works and count returns a number I’d expect
[20:14:38] <ekristen> but when I go to run mongodump, it wants to dump the entire contents of the collection
[22:46:32] <PXER> Mac OS Mongo installation of 2.6: Every executable is around the same size. What gives with that?
[22:47:03] <federated_life> PXER: must be a human cron job
[22:48:14] <PXER> I've looked at your statement like 5 times and can't make sense out of it.