[OpenAFS] Metrics on the cell

Robert Milkowski rmilkowski@task.gda.pl
Tue, 17 Mar 2015 07:59:46 -0000


This is a multipart message in MIME format.

------=_NextPart_000_00C9_01D06088.56353250
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

See the attached email on an example how to get stats on AFS operations per
IP.

Also there was a patch (don't know if it is integrated upstream or not,
probably yes) to add SysV message queue to AFS auditlogs - so then you can
write a simple program and extract data which would allow you to get
accesses by IP.
See https://lists.openafs.org/pipermail/openafs-devel/2009-April/016599.html


Then it depends what do you mean by "user" - if IP address and all you want
to know which IP addresses are using your AFS cell then wireshark might be
enough.


-- 
Robert Milkowski
http://milek.blogspot.com


> -----Original Message-----
> From: openafs-info-admin@openafs.org [mailto:openafs-info-
> admin@openafs.org] On Behalf Of Devine, Steve
> Sent: 16 March 2015 18:13
> To: Jeffrey Altman
> Cc: openafs-info@openafs.org
> Subject: RE: [OpenAFS] Metrics on the cell
> 
> Sadly, they are collecting stats in preparation of closing our AFS cell
> down. They are trying to determine the impact that shutting down our
> cell will have on the community.
> How many users use our Cell? They are not really concerned about the
> amount of disc space that is in use. Thing is this cell has been in
> place for so long it's hard to determine how deeply this will affect
> us.
> 
> /sd
> 
> 
> Steve Devine
> IT Services - Content and Collaboration
> 
> 
> 
> ________________________________________
> From: Jeffrey Altman [jaltman@your-file-system.com]
> Sent: Monday, March 16, 2015 1:48 PM
> To: Devine, Steve
> Cc: openafs-info@openafs.org
> Subject: Re: [OpenAFS] Metrics on the cell
> 
> Steve,
> 
> Could you clarify which statistics you are looking to collect?
> 
> Is the question "how many users are accessing the cell from OSX,
> Windows, Linux, iOS, etc via native clients?"
> 
> Or is the question, "how many files or how much data is accessed from
> these same client platforms?"
> 
> To core problem you will face trying to collect numbers such as these
> is that the type of client is agnostic to the servers.  One site that I
> am aware of explicitly assigned alternate port numbers to different OS
> versions so they could be counted by rx debug queries to the file and
> vl servers.  This approach failed when the clients were accessing the
> servers behind NATs.
> 
>  A related question is often "how can I find all of the clients running
> a version of OpenAFS older than x.y.z?"  This data is not available but
> is easier to obtain by modifying the servers to probe the client
> version on each new connection.
> 
> There are some differences in the access patterns between the client
> platforms that can be used if you are collecting the audit log data
> from the file and vl servers.
> 
> Only windows clients use rxkad authenticated connections for accessing
> the VL servers.
> 
> Only windows clients issue get volume info queries to the file servers
> to obtain free space and quota details on a regular basis.
> 
> Windows clients include the directory FID as the first entry in every
> bulk status query to the file servers.
> 
> OS X clients never issue bulk status queries.
> 
> Hope this helpful.
> 
> Jeffrey Altman
> Your File System Inc
> 
> > On Mar 16, 2015, at 5:11 AM, Devine, Steve <sd@msu.edu> wrote:
> >
> > I have been asked by senior leadership to gather data on the usage of
> our cell. I can of course tell them how much disc space is in use and
> parse logs from our filedrawers and FTP service, what I am struggling
> with is determining access via native OpenAFS Windows, Mac and Linux
> clients. I've been experimenting with Scout and Afsmonitor but haven't
> been able to find a definitive solution. It seems like years ago I
> investigated logging at the fileserver level and discovered that
> logging for usage wasn't possible.
> >
> > Has anyone found a way to gather these kind of stats? Thanks for your
> help.
> >
> > /sd
> >
> > Steve Devine
> > Michigan State University
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > OpenAFS-info mailing list
> > OpenAFS-info@openafs.org
> > https://lists.openafs.org/mailman/listinfo/openafs-info
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info

------=_NextPart_000_00C9_01D06088.56353250
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment

Received: from bojer.task.gda.pl ([153.19.250.250])
	by mx2.central.org with esmtp (Exim 4.69)
	(envelope-from <rmilkowski@task.gda.pl>)
	id 1TRWH6-0000L9-EK
	for openafs-info@openafs.org; Thu, 25 Oct 2012 18:51:43 -0400
Received: from mx2.central.org (MX2.CENTRAL.ORG [128.2.13.207])
	by grand.central.org (Postfix) with ESMTP id 66C148F
	for <openafs-info@list-submit.central.org>; Thu, 25 Oct 2012 18:51:43 -0400 (EDT)
Received: from grand.central.org (localhost.localdomain [127.0.0.1])
	by grand.central.org (Postfix) with ESMTP
	id C1318D7; Thu, 25 Oct 2012 19:06:04 -0400 (EDT)
Received: from quark (host86-135-244-55.range86-135.btcentralplus.com [86.135.244.55])
	by bojer.task.gda.pl (Postfix) with ESMTPSA id 59F53225D3
	for <openafs-info@openafs.org>; Fri, 26 Oct 2012 00:51:32 +0200 (CEST)
Received: from bojer.task.gda.pl ([127.0.0.1])
	by localhost (bojer.task.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 8B5B0lYfoQnd for <openafs-info@openafs.org>;
	Fri, 26 Oct 2012 00:51:32 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by bojer.task.gda.pl (Postfix) with ESMTP id 0C742226BE
	for <openafs-info@openafs.org>; Fri, 26 Oct 2012 00:51:34 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by bojer.task.gda.pl (Postfix) with ESMTP id C41A6226BE
	for <milek@task.gda.pl>; Fri, 26 Oct 2012 01:10:43 +0200 (CEST)
Received: from bojer.task.gda.pl ([127.0.0.1])
	by localhost (bojer.task.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id iIY6XCVR-XFh for <milek@task.gda.pl>;
	Fri, 26 Oct 2012 01:10:43 +0200 (CEST)
Received: from grand.central.org (OLD-GRAND.CENTRAL.ORG [128.2.13.211])
	by bojer.task.gda.pl (Postfix) with ESMTP id D53D4225D3
	for <milek@task.gda.pl>; Fri, 26 Oct 2012 01:10:42 +0200 (CEST)
Return-Path: <openafs-info-admin@openafs.org>
From: "Robert Milkowski" <rmilkowski@task.gda.pl>
Sender: <openafs-info-admin@openafs.org>
To: <openafs-info@openafs.org>
References: <4C9045EE15C9A34D8ACFFA037BD9725B0D041B91@OYWEX0203N4.msad.ms.com>
In-Reply-To: <4C9045EE15C9A34D8ACFFA037BD9725B0D041B91@OYWEX0203N4.msad.ms.com>
Subject: [OpenAFS] rx_clients.d
Date: Thu, 25 Oct 2012 22:51:25 -0000
Message-ID: <006701cdb303$439626c0$cac27440$@task.gda.pl>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 14.0
List-Help: <mailto:openafs-info-request@openafs.org?subject=help>
List-Unsubscribe: <https://lists.openafs.org/mailman/listinfo/openafs-info>,	<mailto:openafs-info-request@openafs.org?subject=unsubscribe>
List-Subscribe: <https://lists.openafs.org/mailman/listinfo/openafs-info>,	<mailto:openafs-info-request@openafs.org?subject=subscribe>
Thread-Index: AQEGElrIxvQt3RBpD1Kgg4EB4phKLgLILxZk
Content-Language: en-gb

Hi,


This is the other scripts, which prints different AFS operations being
requested by each client.
Similarily to the previous one - it is a very quickly written script, =
only
tested on our 1.4.11 based tree (with lots of patches, specifically =
DAFS),
but there is a good chance it will just work on 1.4.11+ and maybe even =
on
1.6 (I haven't tried it though). It makes some very specific assumptions
about how a given release of OpenAFS works, and it might not work =
correctly
or at all for you - although it should be trivial to fix it then.

Also notice, that either script is not necessarily the best way (or even
correct way) to get the stats, but they worked for me.

Please use it at your own risk.

The script requires two arguments - pid of fileserver, and how often it
should print its output (for example 5s).
It then clears terminal at a specified interval and prints the =
statistics.

Example output:
=20
# ./rx_clients.d `pgrep fileserver` 5s

CLIENT IP=A0=A0=A0=A0=A0=A0=A0=A0 CONN CONN/s MKFILE RMFILE=A0 MKDIR=A0 =
RMDIR RENAME LOOKUP=A0=A0
LINK SYMLNK SSTORE DSTORE=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=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3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 6191=A0=A0=A0 =
137=A0=A0=A0 234=A0=A0=A0 703=A0=A0=A0 234=A0=A0=A0 234=A0=A0=A0=A0=A0 =
0=A0=A0=A0=A0=A0 0=A0=A0=A0
234=A0=A0=A0 235=A0=A0=A0 238=A0=A0=A0=A0=A0 0
=A0

=A0=A0 started: 2010 Nov=A0 8 13:13:16
=A0=A0 current: 2010 Nov=A0 8 13:14:01
=A0

=A0=A0=A0=A0=A0=A0=A0 SSTORE =3D Store Status
=A0=A0=A0=A0=A0=A0=A0 DSTORE =3D Store Data


# cat rx_clients.d
#!/usr/sbin/dtrace -qCs

typedef int afs_int32;

struct rx_debugIn {
    afs_int32 type;
    afs_int32 index;
};

BEGIN
{
  start_timestamp =3D timestamp;
  start_walltimestamp =3D walltimestamp;

  @rx_storedata_total =3D sum(0);
  @rx_fetchdata_total =3D sum(0);
  @rx_createfile_total =3D sum(0);
  @rx_removefile_total =3D sum(0);
  @rx_makedir_total =3D sum(0);
  @rx_removedir_total =3D sum(0);
  @rx_rename_total =3D sum(0);
  @rx_lookup_total =3D sum(0);
  @rx_link_total =3D sum(0);
  @rx_symlink_total =3D sum(0);
  @rx_storestatus_total =3D sum(0);
}

pid$1:a.out:rxi_ReadPacket:entry
{
  self->in =3D 1;

  self->inrxient_host =3D arg2;
  self->inrxient_port =3D arg3;
}

pid$1:a.out:rxi_ReadPacket:return
/ self->in /
{
  this->srcp =3D *(uintptr_t *)copyin(self->inrxient_host, sizeof(int));
  this->port =3D htons(*(uintptr_t *)copyin(self->inrxient_port,
sizeof(ushort)));

  this->srca =3D (this->srcp & 0xff000000) >> 24;
  this->srcb =3D (this->srcp & 0x00ff0000) >> 16;
  this->srcc =3D (this->srcp & 0x0000ff00) >> 8;
  this->srcd =3D (this->srcp & 0x000000ff);

  /* stringify addresses */
  self->src =3D strjoin(lltostr(this->srcd), ".");
  self->src =3D strjoin(self->src, strjoin(lltostr(this->srcc), "."));
  self->src =3D strjoin(self->src, strjoin(lltostr(this->srcb), "."));
  self->src =3D strjoin(self->src, lltostr(this->srca + 0));

  @rxi_RP_conn[self->src] =3D count();
  @rxi_RP_conn_ps[self->src] =3D count();
  rxi_RP_conn_total++;

  self->inrxient_host =3D 0;
  self->inrxient_port =3D 0;
  self->in =3D 0;

  self->inrx =3D 1;
}



/* RX CALLS */

pid$1:a.out:SRXAFS_CreateFile:entry
/ self->inrx /
{
  @rx_createfile[self->src] =3D count();
  @rx_createfile_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_RemoveFile:entry
/ self->inrx /
{
  @rx_removefile[self->src] =3D count();
  @rx_removefile_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_MakeDir:entry
/ self->inrx /
{
  @rx_makedir[self->src] =3D count();
  @rx_makedir_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_RemoveDir:entry
/ self->inrx /
{
  @rx_removedir[self->src] =3D count();
  @rx_removedir_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_Rename:entry
/ self->inrx /
{
  @rx_rename[self->src] =3D count();
  @rx_rename_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_Lookup:entry
/ self->inrx /
{
  @rx_lookup[self->src] =3D count();
  @rx_lookup_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_Link:entry
/ self->inrx /
{
  @rx_link[self->src] =3D count();
  @rx_link_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_Symlink:entry
/ self->inrx /
{
  @rx_symlink[self->src] =3D count();
  @rx_symlink_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:SRXAFS_StoreStatus:entry
/ self->inrx /
{
  @rx_storestatus[self->src] =3D count();
  @rx_storestatus_total =3D sum(1);
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:StoreData_RXStyle:entry
/ self->inrx /
{
  self->storedata =3D 1;

  self->inrx =3D 0;
}

pid$1:a.out:StoreData_RXStyle:return
/ self->storedata /
{
  self->storedata =3D 0;
  self->src =3D 0;
}

syscall::writev:return
/ self->storedata /
{
  @rx_storedata[self->src] =3D sum(arg0);
  @rx_storedata_total =3D sum(arg0);
}


pid$1:a.out:FetchData_RXStyle:entry
/ self->inrx /
{
  self->fetchdata =3D 1;

  self->inrx =3D 0;
}

pid$1:a.out:FetchData_RXStyle:return
/ self->fetchdata /
{
  self->fetchdata =3D 0;
  self->src =3D 0;

}

syscall::readv:return
/ self->fetchdata /
{
  @rx_fetchdata[self->src] =3D sum(arg0);
  @rx_fetchdata_total =3D sum(arg0);
}


pid$1:a.out:RXAFSCB_ProbeUuid:entry
/ self->inrx /
{
  printf("%Y %s from %s\n", walltimestamp, probefunc, self->src);;
  self->inrx =3D 0;
  self->src =3D 0;
}

pid$1:a.out:RXAFSCB_ProbeUuid:return
/ self->inrx /
{
  printf("%Y %s from %s\n", walltimestamp, probefunc, self->src);;
  self->inrx =3D 0;
  self->src =3D 0;
}


tick-$2
{
  this->seconds =3D (timestamp - start_timestamp) / 1000000000;
  normalize(@rxi_RP_conn_ps, this->seconds);
  normalize(@rx_fetchdata, 1024*1024);
  normalize(@rx_storedata, 1024*1024);
  normalize(@rx_fetchdata_total, 1024*1024);
  normalize(@rx_storedata_total, 1024*1024);
  setopt("aggsortrev", "true");
  printf("\033[H\033[J");
  printf("CLIENT IP         CONN CONN/s MKFILE RMFILE  MKDIR  RMDIR =
RENAME
LOOKUP   LINK SYMLNK SSTORE DFETCH DSTORE\n");
  printf("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D\n");
  printa("%-15s %@6d %@6d %@6d %@6d %@6d %@6d %@6d %@6d %@6d %@6d %@6d =
%@6d
%@6d\n", @rxi_RP_conn, @rxi_RP_conn_ps, \
         @rx_createfile, @rx_removefile, @rx_makedir, @rx_removedir,
@rx_rename, @rx_lookup, @rx_link, @rx_symlink, \
         @rx_storestatus, @rx_fetchdata, @rx_storedata);
  printf("                =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D\n");
  printf("%-15s %6d %6d ", "", rxi_RP_conn_total,
rxi_RP_conn_total/this->seconds);
  printa("%@6d %@6d %@6d %@6d %@6d %@6d %@6d %@6d %@6d ",
@rx_createfile_total, @rx_removefile_total, @rx_makedir_total, \
         @rx_removedir_total, @rx_rename_total, @rx_lookup_total,
@rx_link_total, @rx_symlink_total, @rx_storestatus_total);
  printa("%@6d %@6d\n", @rx_fetchdata_total, @rx_storedata_total);

  printf("\n\n");
  printf("   started: %Y\n", start_walltimestamp);
  printf("   current: %Y\n", walltimestamp);

  printf("\n\n");
  printf("      SSTORE =3D Store Status\n");
  printf("      DSTORE =3D Stored Data in MB\n");
  printf("      DFETCH =3D Fetched Data in MB\n");
}


--
Robert Milkowski
Morgan Stanley | Enterprise Infrastructure
25 Cabot Square | Canary Wharf | Floor 02 London, E14 4QA
Phone: +44 20 7425-7065
Robert.Milkowski@morganstanley.com
<mailto:Robert.Milkowski@morganstanley.com>=20


-------------------------------------------------------------------------=
---
----

NOTICE: Morgan Stanley is not acting as a municipal advisor and the =
opinions
or views contained herein are not intended to be, and do not constitute,
advice within the meaning of Section 975 of the Dodd-Frank Wall Street
Reform and Consumer Protection Act. If you have received this =
communication
in error, please destroy all electronic and paper copies and notify the
sender immediately. Mistransmission is not intended to waive =
confidentiality
or privilege. Morgan Stanley reserves the right, to the extent permitted
under applicable law, to monitor electronic communications. This message =
is
subject to terms available at the following link:
http://www.morganstanley.com/disclaimers. If you cannot access these =
links,
please notify us by reply message and we will send the contents to you. =
By
messaging with Morgan Stanley you consent to the foregoing.

_______________________________________________
OpenAFS-info mailing list
OpenAFS-info@openafs.org
https://lists.openafs.org/mailman/listinfo/openafs-info

------=_NextPart_000_00C9_01D06088.56353250--