[SERVER-28693] Use getrusage to collect major page faults in serverStatus.extra_info on Linux Created: 07/Apr/17  Updated: 06/Dec/17  Resolved: 30/Jun/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Improvement Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Tyler Kaye
Resolution: Done Votes: 1
Labels: neweng, platforms-interns-2017
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-28712 serverStatus collect extraInfo may be... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-07-10
Participants:
Linked BF Score: 15

 Description   

In order to return the "page faults" field of serverStatus.extra_info, the /proc/self/stat file is read, and parsed for just a single field. Its cheaper to simply call getrusage instead.

This should eliminate the stalls seen while collecting "extra_info".

Example stall:

[js_test:fsm_all_sharded_replication_with_balancer] 2017-02-13T19:17:48.812+0000 d20010| 2017-02-13T19:17:48.811+0000 I COMMAND  [ftdc] serverStatus was very slow: { after basic: 0, after asserts: 0, after backgroundFlushing: 0, after connections: 0, after dur: 0, after encryptionAtRest: 0, after extra_info: 2546, after globalLock: 2546, after locks: 2546, after network: 2546, after opLatencies: 2546, after opcounters: 2546, after opcountersRepl: 2546, after repl: 2546, after security: 2546, after storageEngine: 2546, after tcmalloc: 2546, after wiredTiger: 2546, at end: 2546 }

Source
https://github.com/mongodb/mongo/blob/b3e59f004f541242e1778efcbbca704c9f174890/src/mongo/util/processinfo_linux.cpp#L453-L459



 Comments   
Comment by Githook User [ 30/Jun/17 ]

Author:

{u'username': u'tkaye407', u'name': u'Tyler Kaye', u'email': u'tyler.kaye@mongodb.com'}

Message: SERVER-28693 Use getrusage() to report the number of major page faults on linux
Branch: master
https://github.com/mongodb/mongo/commit/2c895be9d7f506432b8377bbbde357452a92e9d2

Generated at Thu Feb 08 04:18:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.