Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MountStatsNFS parsing multiple transport (xprt) lines #450

Closed
chilversc opened this issue May 19, 2022 · 1 comment · Fixed by #619
Closed

MountStatsNFS parsing multiple transport (xprt) lines #450

chilversc opened this issue May 19, 2022 · 1 comment · Fixed by #619

Comments

@chilversc
Copy link

The mountstats for NFS mounts can contain multiple xprt lines when nconnect is greater than one. Because traffic is equally spread between all the connections, when nconnect is greater than 1, anything that reports on the NFS transport stats will report a lower value than expected.

The simplest option would be to change MountStatsNFS.Transport to a slice of NFSTransportStats. Though this would introduce a breaking change.

Example

This is an example of the mountstats with nconnect=16. In this example there are 16 xprt: lines, one for each RPC connection.

device 10.0.0.3:/files mounted on /srv/nfs/files with fstype nfs statvers=1.1
	opts:	rw,vers=3,rsize=1048576,wsize=1048576,namlen=255,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,nocto,proto=tcp,nconnect=16,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.3,mountvers=3,mountport=53359,mountproto=tcp,fsc,local_lock=none
	age:	186
	caps:	caps=0x1000000f,wtmult=4096,dtsize=1048576,bsize=0,namlen=255
	sec:	flavor=1,pseudoflavor=1
	events:	15 45 0 0 55 6 386 0 0 5241 0 0 3 0 44 0 0 44 0 0 0 0 0 0 0 0 0 
	bytes:	49163927552 0 0 0 41916993536 0 10262313 0 
	fsc:	0 10262935 10233641 0 622 
	RPC iostats version: 1.1  p/v: 100003/3 (nfs)
	xprt:	tcp 689 1 2 0 0 2826 2818 0 24955 0 10 0 22129
	xprt:	tcp 815 1 2 0 0 2819 2811 0 24942 0 10 0 22123
	xprt:	tcp 847 1 2 0 0 2817 2809 0 24949 0 10 0 22132
	xprt:	tcp 767 1 2 0 0 2814 2806 0 24874 0 10 0 22060
	xprt:	tcp 732 1 2 0 0 2818 2810 0 24906 0 10 0 22088
	xprt:	tcp 913 1 2 0 0 2816 2808 0 24867 0 10 0 22051
	xprt:	tcp 1019 1 2 0 0 2821 2813 0 24898 0 10 0 22077
	xprt:	tcp 947 1 2 0 0 2815 2808 0 24855 0 10 0 22040
	xprt:	tcp 959 1 2 0 0 2815 2807 0 24964 0 10 0 22149
	xprt:	tcp 1022 1 2 0 0 2817 2809 0 24976 0 10 3 22158
	xprt:	tcp 997 1 2 0 0 2818 2810 0 24943 0 10 0 22125
	xprt:	tcp 965 1 2 0 0 2816 2808 0 24867 0 10 0 22051
	xprt:	tcp 921 1 2 0 0 2813 2805 0 24948 0 10 0 22135
	xprt:	tcp 905 1 2 0 0 2814 2806 0 24892 0 10 0 22078
	xprt:	tcp 846 1 2 0 0 2813 2805 0 24847 0 10 0 22034
	xprt:	tcp 898 1 2 0 0 2814 2805 0 24965 0 10 0 22151
	per-op statistics
	        NULL: 1 1 0 44 24 0 0 1 0
	     GETATTR: 76 76 0 8496 8512 3 27244 27249 0
	     SETATTR: 0 0 0 0 0 0 0 0 0
	      LOOKUP: 6 6 0 696 1392 2 1241 1244 0
	      ACCESS: 42 42 0 4864 5040 1 18545 18548 0
	    READLINK: 0 0 0 0 0 0 0 0 0
	        READ: 40083 40083 0 4970292 41922124160 656 22306727 22310579 0
	       WRITE: 0 0 0 0 0 0 0 0 0
	      CREATE: 0 0 0 0 0 0 0 0 0
	       MKDIR: 3 3 0 420 432 2 0 3 3
	     SYMLINK: 0 0 0 0 0 0 0 0 0
	       MKNOD: 0 0 0 0 0 0 0 0 0
	      REMOVE: 0 0 0 0 0 0 0 0 0
	       RMDIR: 0 0 0 0 0 0 0 0 0
	      RENAME: 0 0 0 0 0 0 0 0 0
	        LINK: 0 0 0 0 0 0 0 0 0
	     READDIR: 0 0 0 0 0 0 0 0 0
	 READDIRPLUS: 1 1 0 128 1232 0 415 415 0
	      FSSTAT: 6 6 0 656 504 0 1 1 0
	      FSINFO: 4 4 0 432 320 2 0 3 0
	    PATHCONF: 1 1 0 104 56 0 0 0 0
	      COMMIT: 0 0 0 0 0 0 0 0 0
@discordianfish
Copy link
Member

The simplest option would be to change MountStatsNFS.Transport to a slice of NFSTransportStats. Though this would introduce a breaking change.

That seems reasonable to me.

rexagod added a commit to rexagod/procfs that referenced this issue Mar 22, 2024
Allow parsing multiple `xprt` fields present in the same NFS transport
stats data.

Fixes: prometheus#450
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
SuperQ pushed a commit that referenced this issue May 12, 2024
Allow parsing multiple `xprt` fields present in the same NFS transport
stats data.

Fixes: #450

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants