# Amazon Glacier data retrieval cost calculation confusion cleared with example

Amazon Glacier is a good product for storing your files online for long-term ( archive purpose). There is big confusion about  Amazon calculation  of data retrieval  cost from Glacier.To get clarity I did experiments and found how Amazon calculates retrieval fee.

For data storage, amazon charges fixed fee but data retrieval,  Amazon charging variable amount. Here big confusion started among users and developers. Official FAQ of Amazon Glacier is bit complicated  to understand. In  experiments with glacier past few days and experienced  shocking retrieval charges as mentioned in this post. I opened thread in Amazon support forums and got idea how amazon calculating data retrieval charges.

## Here is formula that Amazon following for calculating data retrieval fee from Glacier.

Amazon Glacier retrieval equation
Rate of data retrieval x no . hrs in month x 0.01

Before go ahead first let us understand the concept of “rate of data retrieved from Glacier”. The amount of data retrieved from amazon Glacier per hr, per request  is called rate of retrieval.  Lets see how to calculate rate of retrieval for Glacier.

For example:  You requested  file of size 1 GB of data, it will take 4 hours for retrieval ( almost it takes 4 hrs for any retrieval of file). Now  formula is – size of the data requested / no hours ( 4 by default). So here is calculation. 1 GB/4 = 0.25GB/hr.  It is your rate of data retrieval.

Ever month you can down 5% total storage used by you.
To get final rate of retrieval, we need to minus this free usage from  above derived rate of retrieval. In our example, I have 23 GB stored data and 5% of 23 GB per  month I can retrieve for free is  23GB x 5% / 31  = 0.04GB. But here we downloading only 1 GB so 0.04GB x 4  = 0.01 GB is free to retrieve for hour ( assuming data retrieval time is 4 hours)

So now we need to subtract this free usage from  peak  retrieval rate.  0.25 – 0.01 = 0.24

0.24x 744 ( no hr sin month)x0.01 ( retrieval cost per GB) = \$1.74.

So  the size of archive per request and percentage of free retrieval quota plays big role while calculating Glacier archive  data retrieval fee.

Author: Rawi G