Unsolved
This post is more than 5 years old
294 Posts
1
7033
June 15th, 2012 07:00
Mminfo and time fields, savepnpc and clones
I'm currently investigating some issues with backups taking a long time and I am writing some scripts to report back how long backups take. A few things have came up and I wondered if anyone could give me some input.
Firstly, the savepnpc logs when it finishes its pre-processing and also when it begins its post-processing; I have yet to see the results of this (from another team!) but I am told the results we are seeing are 16 hours for a backup.
I am analyzing the mminfo output to find duration of backup based on the earliest start time of the savesets (nsavetime) in the backup and the latest completion time (sscomp); this is done by converting sscomp to a UNIX timestamp then subtracting nsavetime from sscomp(timestamp) to give a time in seconds. This gives a result in the region of 20-25 hours (I have checked this against human readable dates and these are reasonable values based on mminfo output).
I was wondering if anyone has any suggestions as to why we are seeing such a big anomaly here between these two values (I hope to have some further data shortly from the savepnpc logging to shed more light on this!)
The second part of my query is I want to do similar for reporting on clone times; however there is no completion time details. However after looking at the values mminfo gives out I suspect that I can get this information by taking the clonetime value as the time a clone completes, and the cloneretent with retention time subtracted being the time a clone kicks off. Anyone have any ideas on this one?
0 events found


coganb
736 Posts
0
June 18th, 2012 03:00
Hi David,
What does the savegrp log say? I'd be checking this to compare.
You're going to need to check each of the times in mminfo to see if you can see which one correlates with the savepnpc data (sscreate, nsavetime, ssinsert, save time, sscomp). This should tell you where the difference is coming from. The sscomp time is the time on the Storage Node, so be sure to check the time on that machine also.
Some info in this article though I'm guessing you know all that already:
http://solutions.emc.com/EMCSolutionView.asp?id=esg116916&usertype=C
I haven't found any better way to get the clone times than what you described. The 'clonetime' value seems to be the
only one dedicated to the clone instance time.
-Bobby
DavidHampson-rY
294 Posts
0
June 18th, 2012 08:00
Thanks Bobby, sscreate, savetime, nsavetime, ssinsert all appear to be the same but I am sure there are certain scenarios where they would differ.
sscomp seems to be the only value that is recorded in the media database that represents the time that the backup ends, I didn't realise this was the time on the storage node but they appear to be sufficiently close to give a reasonable value for backup time. I used awk to jiggle the values around to get it into a format I could use with the awk mktime function, not too sure if anyone has an idea of an easier way:
|awk -F, '{hour=substr($3,12,2);if(substr($3,21,1)=="p") hour=substr($3,12,2)+12;comptimestamp=substr($3,7,4)" "substr($3,1,2)" "substr($3,4,2)" "hour" "substr($3,15,2)" "substr($3,18,2);comptimestamp=mktime(comptimestamp)
It would be useful if there was an nsscomp too!
There are two times associated with cloning, clonetime and clretent, the retention time of the saveset; however I was wrong in my assumption on the clretent time - obviously that would be taken from the ssretent of the original backup but could be changed by nsrinfo.
However now I am confused even more; here are some examples extracted for one of the savesets I am working on:
-r "ssinsert(22),savetime(22),sscomp(22),clonetime(22),clretent(22),ssretent(22)"
ssinsert(22) 06/04/2012 10:08:51 PM
savetime(22) 06/04/2012 10:08:51 PM
sscomp(22) 06/05/2012 12:43:44 AM
clonetime(22) 06/05/2012 09:06:22 AM (clone)
clonetime(22) 06/04/2012 10:08:51 PM (original)
clretent(22) 07/06/2012 09:25:06 PM
ssretent(22) 07/06/2012 09:25:06 PM
(note values are same for both original and clone; retention policy=1 month)
So for original saveset:
savetime=ssinsert=clonetime=time backup started
sscomp=time completed
For clone:
savetime=ssinsert=time backup started
clonetime=unknown but I would assume this is the time the clone started if it is to fit in with above
sscomp=time original completed
For both:
ssretent=clretent=a time after the clone completes (group completion as most but not all savesets in a group seem to share this value?) + retention time + 1 day?
coganb
736 Posts
0
June 19th, 2012 06:00
Hi David,
What two values are you referring to when you note that 'values are same for both original and clone'? Are there dates that are the same that you don't expect to be the same?
I don't know how exactly it's going to calculate 'one month' in this sense as regards the time of day it will place on the retention.
-Bobby
DavidHampson-rY
294 Posts
0
June 19th, 2012 08:00
Apart from the clonetime all other time fields are the same for both clone and original.
DavidHampson-rY
294 Posts
0
June 20th, 2012 08:00
Some muppetry with the scripting of my doing, the problem was converting timestamps when the hour was 12 - as 12pm follows 11am and 12am follows 11pm times were thrown out when finishing with a date with 12 as the hour! I've added a clause in there to convert 12pm to 12:00 and 12am to 0:00 and it now returns more correct looking data. Secondly there were two groups running against the client, one for file systems and one for databases so I split out the group data too. Having now compared results with savepnpc log output there does not appear to be a lot of difference in their figures and ours.
My script is below, I'm sure some people will find it useful for troubleshooting - no notes in there as it was meant to be a couple of lines to quickly pull some data off!
#! /bin/bash
exec 2>/dev/null
clientname=$1
if [[ -z $clientname ]]
then
echo "format is clientreport.sh clientname"
exit 1
fi
report=/tmp/total_backup_size_report_for_$clientname
cat /dev/null>$report
echo $clientname>$report
echo "date start_timestamp finish_timestamp total/GB total/HR throughput">>$report
echo "---------------------------------------------------------------------------">>$report
mminfo -q "client=$clientname,level=full,savetime>30 days ago" -r "group"|sort -u|while read -r group
do
echo $group>>$report
for ((t=30; t>=0; t--))
do
to_date=`date -d "$t days ago" +"%m/%d/%y 09:59:59 AM"`
from_date=`date -d "$((t+1)) days ago" +"%m/%d/%y 10:00:00 AM"`
short_from_date=`date -d "$((t+1)) days ago" +"%m/%d/%y"`
mminfo -q "savetime<$to_date,savetime>$from_date,client=$clientname,level=full,group=$group" -r "totalsize(14),nsavetime,sscomp(22),sscreate(10)" -xc,|grep -v created|awk -F, '
{
hour=substr($3,12,2)
if(substr($3,21,1)=="P") hour=hour+12
if (hour==24) hour=12
else if (hour==12) hour=0
comptimestamp=substr($3,7,4)" "substr($3,1,2)" "substr($3,4,2)" "hour" "substr($3,15,2)" "substr($3,18,2);comptimestamp=mktime(comptimestamp)
t += $1
if(first_date=="")short_date=$4
if(first_date=="") first_date=$2
if($2
if(last_date=="")last_date=comptimestamp
if(last_date
}
END{
totalGB=int(t/100000000)/10
totalHR=int((last_date-first_date)/360)/10
print short_date,strftime("%d/%m/%y %T",first_date)," ",strftime("%d/%m/%y %T",last_date)," ",totalGB," ",totalHR," ",int(totalGB/totalHR)
}'>>$report
done
done
The only part of my question remains how to pull out data on when clones complete to be able to calculate clone times. We do have data in the savepnpc generated log but it would be nice to pull the data out of Networker and confirm the data matches up.
coganb
736 Posts
0
June 22nd, 2012 02:00
Hi David,
Thanks for sharing the script. If you're using scheduled cloning, you can get this information from the nsrtask.raw. If you're not, you could get it from jobquery - clone job - endtime. I can't see this info in the mediadb.
-Bobby