S3 Spend

home / log / 2019-04-05-s3-spend

S3 Usage Cost Increases

At the end of 2018, I was seeing steady increase in my s3 bill for laps.run static websites. Using an export of csv data from the billing portal and a pivot table, I was able to determine that the PutObject API action was causing the increase. I determined automated deploys from travis ci are the primary driver of PutObject calls. At the time of writing, S3 Standard pricing for PutObject calls is us-east-1 is $.005/1000 requests.

Month Total Deploys PutObject Cost Cost per Deploy
2018-10 351 $0.48 $0.0014
2018-11 217 $0.53 $0.0024
2018-12 273 $0.89 $0.0033

Deploy Methods

Per deploy costs were rising while the rough quantity of deploys has not substantially changed. The number of files to be deployed each time was steadily growing. And travis ci’s s3 deployment method does the equivalent of s3 cp, thus doing a PutObject for files which are already in the bucket and have not changed.

Deploy Improvements

Opting out of Travis S3 Deploy and instead using aws cli to do an s3 sync, I believed I could reduce the number of PutObject operations I was doing.

Billing Improvements

After making the change on January 6:

Month Total Deploys PutObject Cost Cost per Deploy
2019-01 213 $0.31 $0.0015
2019-02 212 $0.23 $0.0011
2019-03 244 $0.28 $0.0011

Cost per deploy has stabilized even as my projects continue to grow the number of deployed files.