We will now create visualizations of our workload effiency. We will add the new dataset, and then build different visualizations to see what exactly impacts efficiency and where to look to improve it.
We will create a visualization from the application log files.
Go into QuickSight
Click Manage data:
Click New data set:
Enter the Data source name: Efficiency, and click Create data source
Select the costusage Database, and the efficiency Table and click Select
Select Spice and click Edit/Preview data
Make sure there is data in the bottom pane:
Ensure you have data and click Save & visualize:
Create a Clustered bar combo chart. Place datetime (aggregate hour) on the x-axis, cost (sum) in the bars column, add request (count) to the lines field
Label the chart Requests vs Cost:
We can see that it roughly follows the same pattern, however there are times when the trends change. Below you can see the requests increase, but the cost decreases. Also the requests remain the same, and the cost decreases:
Maybe it can be explained through something other than request count, lets add mbytes (sum) to the lines field well to see if there is correlation there:
Again, similar trends and anomalies. MBytes remains constant and cost decreases:
Lets now create our efficiency visualition. Add a calculated field named efficiency with the formula below. Our efficiency metric will be requests per dollar:
count(request) / sum(cost)
Add a visualization, select a Line chart. Place datetime (hour) in the x-axis, efficiency as the value,
We now have a chart showing our efficiency over time. Notice how the efficiency changes significantly at the end of the day:
You can now see increases and decreases in efficiency clearly, look when the output increases and cost remains the same, or the cost remains the same and the output decreases:
You now have a baseline efficiency metric. Use this to look for areas of low efficiency of your workload - this will provide areas to cost optimize.
Lets look deeper into the types of requests to see if we can get better insight into what is driving our costs and efficiency.
Lets look at a sample of a successful log request in our application log files:
We can see there are the fields:
Lets create a calculated field RequestType with the formula below. This will separate out the types of requests, health checks, image requests and other/errors from the request field:
ifelse(locate(request,"index.html") > 0,split(request,',',2),ifelse(locate(request,"health.html") > 0,"HealthCheck",ifelse(locate(request,"image_file") > 0,"ImageFile","error")))
Create a Cluster bar combo chart visualization. Place datetime (HOUR) in the x-axis, add Request (count) in the bars, add RequestType in the Group/Color for bars, add efficiency to lines:
We can see a correlation between the user type and the efficiency, when paid users increase the efficiency goes down, this indicates its more costly to service paid customers. Also look at the efficiency increase when there are large amounts of errors, you may which to filter and exclude low value outputs from the measures of efficiency. These insights can be used to categorize different types of requests in your workload and understand how to charge them back appropriately.
You can use this to increase your efficiency by removing unwanted requests, for example you may use CloudFront to more efficiency handle errors - instead of processing them on the web servers.
Congratulations! You have now calculated the efficiency of a workload, you can see how your efficiency changes over time, and look into the types of requests to understand what contributes cost to your workload.