PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 10th of September, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:04:18] <zfjohnny> I have this currently set:
[00:04:21] <zfjohnny> logpath=/var/log/mongodb/mongodb.log
[00:04:22] <zfjohnny> slowms = 0
[00:04:22] <zfjohnny> profile = 2
[00:04:36] <zfjohnny> However, I do not see the queries.. just connection information and an occasional query.
[00:04:43] <zfjohnny> I restarted mongo service too.
[00:04:52] <joannac> do you actually have query activity?
[00:04:55] <zfjohnny> Yes
[00:06:42] <zfjohnny> I’m using PHP’s Doctrine ODM and it logs the queries it’s sending to MongoDB. I see a flurry of activity on the PHP side but on the Mongo side, there is no activity. Something isn’t quite right.
[00:07:37] <zfjohnny> However, I am sure that it’s connecting to my dev Mongo DB because while I’m smoke testing my project, I can see the log lines about the mongo connections
[00:07:45] <zfjohnny> Wed Sep 10 00:01:01.299 [initandlisten] connection accepted from xxx.xx.0.11:60056 #7 (6 connections now open)
[00:08:59] <joannac> zfjohnny: i just tried it in the shell, works for me
[00:09:13] <zfjohnny> hmm
[00:09:35] <joannac> [conn74] query test.foo query: { age: 45.0 } planSummary: COLLSCAN ntoreturn:0 ntoskip:0 keyUpdates:0 numYields:0 locks(micros) r:80 nreturned:1 reslen:89 0ms
[00:11:46] <zfjohnny> joannac: For example, I do this query: db.users.find({"dog":"cat"});
[00:11:55] <zfjohnny> Nothing appears in the mongo log
[00:13:31] <zfjohnny> Is there something wrong with my conf file? https://gist.github.com/blockjon/3e02dda4e607722c1a35
[00:14:27] <joannac> zfjohnny: run db.getProfilingStatus()
[00:14:44] <zfjohnny> > db.getProfilingStatus();
[00:14:45] <zfjohnny> { "was" : 2, "slowms" : 0 }
[00:15:13] <joannac> db.system.profile.find() ?
[00:15:18] <joannac> is the query in there?
[00:16:37] <zfjohnny> theres lots of records in there… not sure how to find it
[00:17:16] <joannac> search for {ns: "test.users"}
[00:17:27] <joannac> or whatever your database name is instead of "Test"
[00:19:49] <zfjohnny> nothing comes back
[00:19:51] <zfjohnny> here’s a clue though:
[00:20:06] <zfjohnny> In one window I’m tailing my dog .. in another window I am in a mongo db shell
[00:20:15] <zfjohnny> All of the commands I type into the shell trigger lines in the log file
[00:20:35] <zfjohnny> However, when my PHP code is talking to the same mongo database, it doesnt seem to log much of anything.
[00:20:46] <joannac> are you sure it's the same database?
[00:20:51] <zfjohnny> Yes
[00:21:17] <joannac> Maybe it's cachings results? I dunno
[00:21:27] <zfjohnny> When an appliation such as php connects, does it pass params that indicate that the server shoudl not log its commands?
[00:21:36] <zfjohnny> Does mongo have something like that?
[00:21:47] <joannac> no
[00:22:14] <joannac> I'm not aware of anything like a "stealth mode"
[00:22:21] <zfjohnny> Could it be that it only logs for statements which trigger a disk read but that items already in memory do not have log lines generated?
[00:22:25] <joannac> nope
[00:23:35] <zfjohnny> Gosh this is frustrating… is there a tutorial on how to get mongo to log that I can follow?
[00:23:49] <zfjohnny> I feel like I need to go to open office hours at Mongo’s headquarters just to get a query log to work.
[00:23:58] <joannac> http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/
[00:24:08] <joannac> the query log does work
[00:24:20] <joannac> you can see it works because you tested it in the shell
[00:26:28] <joannac> as a test, do an insert, and try the query in PHP again, and make sure it is connecting and gets the new document?
[00:27:34] <zfjohnny> http://docs.mongodb.org/manual/reference/configuration-options/#operationProfiling.mode seems interesting although no matter what I try, my server doesnt start when I try to add mode into my mongo config file
[00:27:43] <zfjohnny> operationProfiling.mode = all
[00:27:52] <zfjohnny> mongo crashes on start if i add that
[00:28:03] <joannac> what
[00:28:31] <joannac> what version?
[00:28:45] <zfjohnny> MongoDB shell version: 2.4.9
[00:28:51] <joannac> db.version()
[00:29:37] <Boomtime> operationProfiling.mode <- that's 2.6
[00:29:55] <zfjohnny> > db.version();
[00:29:56] <zfjohnny> 2.4.9
[00:30:03] <joannac> http://docs.mongodb.org/v2.4/reference/configuration-options/#profile
[00:30:11] <joannac> the current version is 2.6
[00:30:25] <joannac> if you're on 2.4, make sure you're looking at the 2.4 docs
[00:31:04] <joannac> actually
[00:31:10] <joannac> as a test, set slowMs to 1 ?
[00:34:00] <zfjohnny> No difference
[00:34:03] <zfjohnny> It seems to only log some things
[00:34:15] <zfjohnny> For example, I tried “show dbs;” and the first time, i get:
[00:34:18] <zfjohnny> Wed Sep 10 00:30:00.707 [conn2] command admin.$cmd command: { listDatabases: 1.0 } ntoreturn:1 keyUpdates:0 locks(micros) R:3 W:1564 r:67 reslen:487 2ms
[00:34:29] <zfjohnny> But every subsequent time I type that command, it doesnt log anything.
[00:35:31] <zfjohnny> Does it log something for you?
[00:35:36] <joannac> I feel like you;ve nessed something up
[00:35:41] <joannac> that lists every time for me
[00:36:08] <zfjohnny> No i mean, it only *logs* something the first time i do a “show dbs;”… every other time I run “show dbs;” nothing is added to the mongo log.
[00:36:20] <joannac> yes, that's what i mean
[00:36:21] <zfjohnny> I get the lits of dbs in the termianl.. but the log file doesnt log anything in the mongo log.
[00:36:30] <joannac> every time I type "show dbs", i get 2 more lines in my log file
[00:36:40] <zfjohnny> gah.. im so frustrated
[00:36:44] <zfjohnny> what could it be
[00:36:45] <joannac> a listDatabases and a isMaster
[00:37:19] <joannac> switching to 2.4.9 to macth your version now
[00:39:33] <zfjohnny> i could send you a screencast if you wanted of what im doing
[00:45:31] <zfjohnny> Were you able to confirm what I’m seeing?
[00:48:50] <joannac> zfjohnny: if you're willing to take the extra log space, db.adminCommand({setParameter:1, logLevel:1}) seems more consistent
[00:49:04] <joannac> I can see what you're seeing but I'm not sure why, and I don't have time to look further
[00:50:44] <zfjohnny> ok.. thanks for checking
[01:44:53] <deerfo> If the 'profile' object already exists in the found document with different properties, how do I add the new properties to it, without overwriting the entire profile object? User.findOneAndUpdate({username: req.user.aud}, {$set: {"profile": {"name": "Sally", "surname": "Smith"}}}, {});
[01:45:39] <deerfo> if profile has "age" and "gender" already, they're overwritten with "name and "surname". I'd like to insert or replace rather than replace *entirely*
[01:46:11] <joannac> "profile.name
[01:46:25] <joannac> I think
[01:48:31] <deerfo> joannac - '{"profile": {"name": "Sally", "surname": "Smith"}}' is in fact 'req.body', it's what's being sent by the client to the server
[01:48:44] <deerfo> are they able to send in that 'profile.name' format?
[01:49:02] <joannac> What's the client?
[01:50:29] <deerfo> well i'm trying to make a REST API, so I'm getting get and post requests from users, sometimes with a text body, sometimes with a multipart body
[01:51:23] <joannac> deerfo: okay, so it's your code? So you can rewrite the request...
[01:52:57] <deerfo> joannac - ah yes. i see what you mean now. apologies. thank you!
[01:54:47] <joannac> np :)
[02:12:58] <deerfo> joannac - if i use .findOneAndUpdate, and I receive profile.age = "" from the client, is there an easy way to remove .age from profile, rather than doing nothing?
[06:07:30] <pranam> how to implement a connection pool in mongodb
[06:15:15] <Boomtime> @pranam: all official mongodb drivers have a connection pool already
[06:17:59] <pranam> @Boomtime: so we dont need any sort of connection pool of our own and can rely on the official mongodb driver
[06:18:06] <pranam> @Boomtime: so we dont need any sort of connection pool of our own and can rely on the official mongodb driver?
[06:21:09] <Boomtime> @pranam: assuming you use an officially supported driver, yes
[07:04:07] <asdfasdf> i have a collection with geojson Polygons
[07:04:15] <asdfasdf> and i have another collection with geojson Points
[07:05:01] <asdfasdf> for each point, i want to determine which polygon it lives in.
[07:06:26] <asdfasdf> the $geoWithin seems to query on a particular object
[07:06:33] <asdfasdf> rather than the whole collection.
[07:06:40] <asdfasdf> is there a more efficient way to do this?
[07:59:51] <roxlu> hi guys, I've got a mongodb with about 160.000 records but the cpu keeps increasing linearly. When we reach 300.000 entries the cpu is 70-90%. We're using this query (all columns are indexed) https://gist.github.com/roxlu/951a049dad82e6d13f12
[08:02:51] <roxlu> Any ideas why?
[08:19:10] <sheldonh> when i add members to a replica set, will mongo leverage DNS SRV records to find the tcp port number?
[09:47:57] <CaShY> Hi, is it possible to do an aggregate on another collection on a virtual value? sort of like this http://pastie.org/9541580
[11:08:41] <fontanon> Hi Everybody! How can I display datetimes stored as strings (i.e. '2014-03-01 10:00:00') as numeric timestamps (i.e. 1136005200000)
[11:15:40] <fontanon> I mean to use some mongodb internal function to convert dates stored in string format to unix timestamps
[11:54:23] <nofxx> Ok, after the last day debugging and (not yet 100%) fixing ip, ipv6, dns thing was causing massive slow down, from 30s got to 5s, to 1s, to the usual 0.5s
[11:54:39] <nofxx> Was experimenting now with adding static IPs, all my servers on each /etc/hosts ...
[11:54:53] <nofxx> INCREDIBLE, it's like 1000% faster, everything... getting 0.030s !
[11:55:18] <nofxx> now, or my machines DNS is rly, rly messed up, or there's major improvement using static IP for mongo
[11:55:25] <nofxx> if anyone with a replica set can test this
[11:56:36] <nofxx> I know my time is very abstract, but includes a rly good bunch of queries. finds, modifies and whatnot
[11:56:53] <nofxx> it was all related to dns resolve, I'm 100% sure now
[11:57:04] <flok420> "rly"?
[11:57:33] <nofxx> 4:20 already?
[11:58:11] <nofxx> hmm..well, is there somewher on the docs recommending static lookup or local bind?
[11:58:17] <nofxx> dns bind*
[11:58:23] <fontanon> Hi Everybody! How can I display datetimes stored as strings (i.e. '2014-03-01 10:00:00') as numeric timestamps (i.e. 1136005200000) ?? I mean to use some mongodb internal function to convert dates stored in string format to unix timestamps
[12:01:47] <nofxx> fontanon, problably there is but have in mind mongo philosophy is dumb db, logic on the app
[12:01:57] <nofxx> hence the name...
[12:02:37] <fontanon> nofxx, ok .. ill do it in the app
[12:02:39] <fontanon> thanks
[12:03:32] <nofxx> fontanon, also, if it's something you use a lot, you can trade space with processing and store both formats while saving
[12:03:56] <nofxx> per project decision, per time processing... etc, yrs looks easy to process on the fly
[12:04:43] <fontanon> No, it isn't something I use a lot
[12:04:59] <fontanon> And also, I could rely the conversion on the user browser
[12:05:16] <nofxx> fontanon, yup! js to the rescue
[12:05:22] <fontanon> :)
[12:05:39] <nofxx> html5 has lots of nice stuff for that, but never work for me
[12:05:58] <fontanon> Yipes! I'll try and tell you. Thanks nofxx
[12:06:00] <nofxx> change zones, convert temperature, speed, etc
[12:06:10] <nofxx> hopefully it'll work in the future heh
[14:36:50] <rpage> hello all, i have a question on backgroun indexing? is it alway recommanded to do background indexing via foreground? i notice we are using foreground by default and need to purpose a action plan
[14:39:04] <rpage> Devs were in the middle of a massive document remove and re-import which cause replication lag
[14:40:01] <rpage> and notice the error [journal] DR101 Latencywarning journal
[15:06:45] <godelmang> hi all, im trying to return an element of an array that is a subdocument of mongodb collection of mine. the $slice operator seems appropriate? db.mycoll.find({},{_id:0,"foo.bar":{$slice[2,1]}}) seems like it should work, but it doesn't.
[15:07:54] <godelmang> db.mycoll.find({},{_id:0,"foo.bar":1}) however does return the whole array as a subdocument
[15:14:53] <godelmang> the .find() with the $slice operator is simply returning the entire collection.
[15:28:38] <Boomtime> @godelmang: both of the find() statements you pasted are returning the entire collection
[15:29:15] <Boomtime> db.mycoll.find({}, ... <- that first set of empty braces means "everything"
[15:30:25] <Boomtime> meanwhile, i'm not sure what you are attempting to do but i do not believe $slice is valid in a simple find
[15:31:47] <Boomtime> huh, whaddya know: http://docs.mongodb.org/manual/reference/operator/projection/slice/
[15:33:30] <Boomtime> -> db.mycoll.find({},{_id:0,"foo.bar":{$slice[2,1]}}) <- i assume there is a typo here, $slice should be followed by :
[15:36:02] <Boomtime> this will scan every single document in the collection, but the returned documents will contain only the 3rd element of the "foo.bar" subdocument from each source document
[16:05:42] <emfl_> Hello, I'm having a hard time installing mongo gem on windows 2012. It's complaining about missing sasl.h file. Does that ring a bell to anyone ?
[16:48:23] <geoffeg> I used to know what "fastmodinsert" meant in the profiling log but I've forgotten and google isn't helping.
[17:07:34] <pasichnyk> I have a production issue and i'm looking for some ideas on how to best restore a few collections in a database from a lvm2 snapshot backup. Is it possible to somehow put all the database file (renamed) in the data folder and have hte db load up the old copy as a new database name, so data can be selectively migrated over to the production database?
[17:24:46] <Acute_Angle> I am new to mongodb. I have been asked to rename some keys in one of our collections but am having trouble getting it to work.
[17:34:41] <pasichnyk> Or, if i have a copy of the files on disk, i can probably use mongoexport with --dbpath and --collection to export the data i need, eh?
[17:37:57] <Acute_Angle> I was trying to do something like:
[17:38:51] <Acute_Angle> db.statments.update( {}, { $rename: { "statments.context.extensions.http://foo&46;net/tincan/eid": "statments.context.extensions.eid", "statments.context.extensions.http://foo&46;net/tincan/iid": "statements.context.extensions.iid", "statements.context.extensions.http://foo&46;net/tincan/tcd": "statements.context.extensions.tcd" } } )
[17:40:01] <Acute_Angle> and what I get back is Script executed successfully, but there are no results to show.
[17:40:14] <Acute_Angle> And it appears that nothing was actually renamed.
[17:40:34] <Acute_Angle> I am sure I am missing something simple here, but I have no clue what it might be
[17:46:22] <Acute_Angle> is this thing on?
[17:46:25] <Acute_Angle> ;)
[21:41:12] <joannac> Acute_Angle: how are you verifying nothing got renamed?
[21:41:48] <Acute_Angle> joannac: I checked the data. I also found my typo! ;) Thanks for the response, though!
[21:42:00] <joannac> lol
[21:42:02] <joannac> okay