[SERVER-50038] [mongostat] difference between pingMs and heartbeat parameters(lastHeartbeat & lastHeartbeatRecv) Created: 30/Jul/20  Updated: 01/Jun/22  Resolved: 03/Aug/20

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

Type: Question Priority: Major - P3
Reporter: Abolfazl Ziaratban Assignee: Jonathan Streets (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

VMWare + CentOS 8 + Mongodb Replica Set


Attachments: PNG File diagram.png     PNG File image-2020-07-31-20-13-43-972.png    
Issue Links:
Backports
backported by DOCS-7810 Replica set lastHeartbeat documentati... Closed
Participants:

 Description   

hi

according to this post , heartbeat is the same as ping.

so what is difference between pingMs and heartbeat parameters(lastHeartbeat & lastHeartbeatRecv) ?

 

this is my understanding of lastHeartbeat & lastHeartbeatRecv :



 Comments   
Comment by Abolfazl Ziaratban [ 07/Aug/20 ]

hi again

according to docs :

Compare this value to the values of the date and lastHeartBeatRecv fields to track latency between these replica set members.

what is relation between the replSetGetStatus.date and lastHeartbeat(or lastHeartbeatRecv) and how i can calculate the latency between these replica set members?

What are these parameters(lastHeartbeat,lastHeartbeatRecv) used for?

what are use cases?

 

thanks.

Comment by Jonathan Streets (Inactive) [ 03/Aug/20 ]

hi abolfazl.ziaratban@gmail.com .

I think you are ok with the explanation, so I’m going to mark this ticket as resolved. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Regards,

Jon

Comment by Abolfazl Ziaratban [ 31/Jul/20 ]

Jonathan Streets  thanks.

your explanation is very clear.

i edited my diagram and now is :

 

and this heartbeat request is not related to run of db.adminCommand({...}) in across replica set

Comment by Jonathan Streets (Inactive) [ 31/Jul/20 ]

hi abolfazl.ziaratban@gmail.com

from the docs here, i found good explanations for the 3 metrics

  • replSetGetStatus.members[n].lastHeartbeat,
  • replSetGetStatus.members[n].lastHeartbeatRecv,
  • replSetGetStatus.members[n].pingMs

Briefly:

  • pingMs is the round trip time (RTT) in milliseconds.
  • lastHeartbeat is the ISODate when the server received a response from a heartbeat request it had sent.
  • lastHeartbeatRecv is the ISODate when the server received a heartbeat request.

Does this help ?
Regards
Jon

Comment by Abolfazl Ziaratban [ 31/Jul/20 ]

Tim Fogarty  thanks.

i could not found any button for edit.

Comment by Tim Fogarty [ 31/Jul/20 ]

Hi abolfazl.ziaratban@gmail.com, I have moved this to the SERVER project since question has to do with the replSetGetStatus server command.

Generated at Thu Feb 08 05:21:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.