Reputation: 5
I am analyzing memory usage for the past three months on a Softlayer Virtual Guests using getMemoryMetricDataByDate. Specs on an example guest are maxCpu = 2, and maxMemory = 8192 MB.
Memory usage is reported to be at 89% to 100% of maxMemory. This does not seem correct for this server. An example datapoint is:
[counter] => 8127187622.8697
[dateTime] => 2016-05-04T18:00:00-06:00
[type] => memory_usage
In the set of 183 datapoints, the min counter value is 7652222531.7333 (bytes) the max is 8589934592 (bytes).
To cross check, I pulled the graphic image for the same date range using getMemoryMetricImageByDate. See below. The chart shows two lines. The first with memory average of 1.6 GB and max of 11.1 GB. The second line shows memory average of 5.3 GB and max of 220.1 GB.
My questions are:
Why are there two lines on the chart?
Why is the data significantly different between getMemoryMetricDataByDate and getMemoryMetricImageByDate, given that the exact same virtual guest and date range were specified for each call?
Upvotes: 0
Views: 173
Reputation: 4386
I suggest you to use the methods that the control portal uses to get the data of usage.
It uses this method: http://sldn.softlayer.com/reference/services/SoftLayer_Metric_Tracking_Object/getSummaryData
with the fetched data, the portal creates the images. So try that method it should contain data more accurated.
RESTful example:
POST https://api.softlayer.com/rest/v3.1/SoftLayer_Metric_Tracking_Object/$MetircOBjectID/getSummaryData
body:
{
"parameters": [
"2016-08-04 00:00:00 America/Chicago",
"2016-08-05 23:59:59 America/Chicago", [{
"keyName": "MEMORY_USAGE",
"summaryType": "max"
}],
600
]
}
Note: replace $MetircOBjectID
in order to get the associated MetircOBjectID of a Virtual Guest use this RESTFul
GET https://api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/$VirtualGuestId/getMetricTrackingObjectId
Note: replace $VirtualGuestId
Regards
Upvotes: 1