[00:01:06] <lkannan> So rebuilt index for that collection, some changes in the index count: https://gist.github.com/lakshmi-kannan/31bb4e45865d5448d27b. Mongo still at 100%.
[00:04:08] <GothAlice> lkannan: Hmm. Would you be willing to PM me your process strace? I might remember enough 2.4 internals to make sense of it.
[00:04:36] <GothAlice> Changes in index count are… not a good sign, really. ;)
[00:05:59] <GothAlice> If you were using 2.6+ with sharding enabled, though, certain index record counts may be kinda somewhat sorta inaccurate. (Because the shards report back "index buckets", not record counts.)
[00:06:06] <GothAlice> But, not so much the case here.
[00:07:02] <GothAlice> BSD sample is so nice. Keep forgetting that sample/spindump aren't GNU tools. XP
[00:09:10] <GothAlice> lkannan: Some of those index size drops are substantial. Unless those indexes were created with "background: true", that's worrying to me.
[00:09:28] <GothAlice> The _id_ index differing would indicate to me a full repair may be necessary. :|
[00:09:55] <GothAlice> cheeser: Ever seen a drop like that on _id_ indexes after a reIndex()?
[00:09:57] <lkannan> I see. Sorry, was getting strace info to you.
[00:10:20] <GothAlice> lkannan: No worries. I problem solve "out loud". Take your time. :)
[00:14:48] <GothAlice> Ugh. And I keep forgetting how noisy Linux syscalls are. XP
[00:18:04] <GothAlice> lkannan: Looks like a large chunk of that trace is something, somewhere requesting MongoDB server stats. The many, many futex (fast userspace mutex) lock fails with "EAGAIN (Resource temporarily unavailable)" may be concerning.
[00:18:59] <lkannan> I was thinking the same. But the PID is not mongo PID.
[00:19:28] <lkannan> ps auxww | grep didn't match that pid.
[00:19:42] <GothAlice> Ah, then that'd be a thread.
[00:25:19] <lkannan> Jesus. Mongo is spinning even without app doing much. I have debug logs turned on for our app and trust me we have so.much.logging.
[00:28:02] <GothAlice> I'd seriously check the underlying storage for problems. Grab a copy of 'htop' and enable "Detailed CPU time" — is it waiting on system, user, or io?
[00:29:20] <GothAlice> Additionally: always good to have backups, as a full repair may be needed. I'd recommend stopping the DB for enough time to snapshot the stripes, make a local copy of the stripes, and try to repair them locally.
[00:30:34] <GothAlice> cheeser: You know you mongo too much when you can read BSON. As a binary.
[00:32:11] <GothAlice> Heh, and if you're making a local copy, I'd also try to reproduce the failure locally, too. Either you can or can't… either way the result is significant. :)
[00:32:44] <GothAlice> (If you can't, it may be the machine. If you can, it's surely the data.)
[00:40:39] <lkannan> GothAlice: Some news. I turned on mongo debug logging and still was seeing only trace_d_b queries I pointed you to earlier. We made a call to drop trace_d_b and we did :). #yolo. Mongo CPU dropped significantly.
[00:42:23] <lkannan> Definitely points to some problem with how we are writing to that collection. I am going to try a 2.6 upgrade and see if this problem comes back.
[00:43:25] <GothAlice> I'd carefully review the indexes you use by testing small scale in development with dex on, using "normal" behaviour on the app.
[00:43:57] <GothAlice> And remember: MongoDB documents do have size limits; you can't append values to one forever. You may need to add bounds checking for that.
[00:44:48] <lkannan> Got it. So "totalIndexSize" : 8176 -> Is this bytes or count?
[00:48:26] <jiffe> if a value is quoted in db.coll.find() output that means it is a string?
[00:48:49] <jiffe> I have perl inserting into a collection via $mongo_records->insert( $ref, { safe => 1 } );, Dumper($ref) shows time_stamp to be an integer but it is quoted in the mongodb output
[00:50:40] <GothAlice> lkannan: Reindexing "compacts" the indexes. Substantial drops like those are… weird to my brain. Possibly explained if the index was created in the background because those are created "sparsely" on-disk, though, but _id_ is not that way unless there's some manipulation going on.
[00:57:10] <sector_0> how can I get a simple mongodb server up and running?
[00:57:51] <sector_0> and before someone tells me to sign up for the courses...I have but they havne't started yet but I need to test some code
[00:59:13] <lkannan> GothAlice: Just read through our code and we don't do background indexing. Currently reading through the code for updating trace collection. I'll keep you posted.
[00:59:18] <Boomtime> use the mongo shell to connect to it
[00:59:28] <Boomtime> everything else you can learn from the docs if you need
[00:59:42] <Boomtime> and the university course is well recommended, it's a great intro
[01:01:09] <sector_0> Boomtime, yeah I signed up, but it starts in January
[01:04:30] <sector_0> I'm trying to start mongo using "sudo service mongod start"
[01:05:05] <sector_0> "mongod start/running, process 7283" gets printed after but then if I do "ps -A | grep mongo"
[01:58:37] <idd2d> When (if ever) should I use a join table in mongo? I've got a many-to-many (even squillions-to-squillions, depending on your definition) relationship going on, and I'm wondering which approach to this relationship is most performant.
[02:11:36] <Boomtime> sector_0: what does the log say?
[02:14:23] <sector_0> Boomtime, Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
[02:15:13] <sector_0> the rest look rather normal to me, just couple general info about the current mongo setup
[02:19:47] <boutell> I noticed that mongolab offers dedicated single-node plans, which are among its priciest. I am scratching my head at that. Why would you want a single-node mongodb hosting plan? I mean, for projects that aren’t webscale, which is most projects, we run mongodb in a single node configuration quite often, and just do nightly mongodumps. But if you were paying someone else for your mongo, wouldn’t you want a replica set?
[02:20:26] <cheeser> if i was running a production app, i'd want a replica set regardless.
[02:24:35] <boutell> “The deployment of a replica set affects the outcome of failover situations. To support effective failover, ensure that one facility can elect a primary if needed. Choose the facility that hosts the core application systems to host the majority of the replica set. Place a majority of voting members and all the members that can become primary in this facility. Otherwise, network partitions could prevent the set from being able
[02:25:05] <boutell> sooooo if you have two nodes in location A and one node in location B, and location A is underwater, does the node in location B just say “oh well” because it’s not a majority?
[02:28:07] <boutell> I was interested to see that straight master-slave is actually a thing in mongo, but it seems to be discouraged. I would think that for a certain set of needs (and a certain budget), it’s one of the reasonable choices
[02:28:38] <cheeser> master-slave is eons outdated
[02:28:54] <boutell> it’s certainly not the answer if you can afford three DCs (:
[02:28:54] <cheeser> no reason not to use a replica set
[02:29:59] <boutell> [read read read] I guess having two nodes is actually allowed, and you can forbid one of them from becoming the primary (without intervention)
[02:30:03] <boutell> two nodes in a replica set, that is
[02:33:47] <boutell> is it possible to forbid reads from the secondary if the primary is reachable? I’m struggling with an application that needs consistent read-after-write semantics. That may just not be something mongo really wants to give me, and gives me by accident in a single node configuration.
[02:37:53] <cheeser> use a read preference of PrimaryPreferred
[03:03:34] <boutell> . o O so a 2-node replica set with the write preference set to PrimaryPreferred and the primary status disabled for the secondary gives me a reasonable setup for streaming backup to a geographically redundant server that is only going to get seriously lit up by a DNS cutover in the event of ragnarok
[03:04:23] <boutell> . o O both run on sizable VPSes that also host the web application because small budget, and VPSes have high durability generally in terms of not being easily wiped out by the death of two hard drives
[03:27:54] <sector_0> Boomtime, I restarted and now it's working
[03:28:05] <sector_0> but what caused that little glitch just now?
[08:23:16] <newbsduser> i modified and compiled mongodb for increasing 16MB max bson object size to 64 MB... But now java clients gives me this error message: WARN PlanBasedMongoClient - Mongo max bson object size invalid; waiting... how can I solve it?
[08:26:03] <Zelest> sorry for asking, but why on earth do you need 64MB documents? :o
[08:31:33] <newbsduser> Zelest, iam trying to insert tcp/udp sessions
[09:49:55] <vasilakisfil> Hi! I am trying to connect to my staging mongodb using mongoid but I get: Mongo::Error::NoServerAvailable: No server is available matching preference. However I am able to connect to it using the cli tool mongo
[11:05:48] <contracode> does anyone have experience with MongoDB and PHP?
[11:16:17] <contracode> good morning, Derick! I'm looking at legacy code, and I see this in PHP --> $mongo_con = new Mongo(); $m_db = $mongo_con->foo;
[11:17:13] <contracode> I haven't used PHP in years, and I'm new to MongoDB-- but would that select the MongoDB "foo" table? It's odd syntax, in my opinion
[11:28:46] <Derick> contracode: you can also do $m_db = $mongo_con->selectDatabase('foo');
[11:30:49] <Rashad> Hello! Should I keep closing the database after each insertOne() [or any operation] like how it is done here: https://docs.mongodb.org/getting-started/node/insert/ ?
[11:31:07] <contracode> Derick: thanks for that! I think you saved a headache later on today
[11:31:14] <Rashad> And in general, when should I close the db?
[11:31:42] <contracode> I'll be moving the PHP/MongoDB code base from an old machine that nobody knows about to a new one-- and the new machine will have a new driver
[11:32:06] <contracode> so, I'm guessing I'll have to swap out the selectDatabase() logic
[11:37:31] <Rashad> "var db = require('mongodb').MongoClient;"
[11:37:42] <contracode> Derick: I'm moving legacy PHP code to a new system, since the current system went unmaintained long enough for it to be unservicable
[11:37:45] <StephenLynx> I can link you my project so you can see how I work with it.
[11:43:37] <Rashad> In the link it's closing the connection each time, like the tutorial. My background is in SQL databases with php where you have a connection object that you use for operations and then after all the operations you close the db.
[11:44:00] <Rashad> Here I have to do all the operations inside the connection callback instead.
[11:49:20] <StephenLynx> no-daemon means I don't want to start the server and listen to connections. so in this case, I close my connection when all pre-boot operations are done
[14:36:38] <whyhankee> Hi, Mongo's CloudManager is complaining about a backup agent on a machine that does not exists anymore. Anyone know of a way to reset/refresh/fix that?
[14:38:01] <whyhankee> it also appears in the deployment's server-list but the '...' option is locked for some reason
[16:23:34] <nalum> hello, quick question about mongodb. In version 2.* the enterprise version was needed in order to use tls secured connections, is this still the case with version 3.*? The site is confusing me on this point.
[16:24:07] <Derick> I think SSL has been put into the standard build in 3.0... let me see if I can find out
[16:26:14] <StephenLynx> from what I heard, it was mostly an issue with cross compiling
[16:29:53] <Derick> the one I just downloaded has:
[21:39:17] <kexmex> the other thing is, i got major perf problems
[21:39:31] <kexmex> mongodump is taking forever-- i got a 1mil+ collection
[21:39:53] <kexmex> could it be that SSD is faulty?
[21:40:08] <GothAlice> ObjectIds are compared as if they were just really big numbers. But because of the order of the fields, this means you get "ascending" sort on [unix timestamp, machine, process, counter which wraps]. So within a single second, records may be in a relatively unusual order, but between seconds you do indeed get time order.
[21:41:27] <kexmex> unless some records were created on another machine? or timestamp goes in front?
[21:43:44] <kexmex> i need to diagnose a perf problem really-- even find() commands are slow (more than enough mem to fit the DB)