How to Reduce the Cost of Artifact Distribution (Case Study) - Vim

A Case Study: How to Reduce the Cost of Artifact Distribution - Amazon S3 Direct Egress

As an R&D Group Manager at Vim, I oversee the company’s cloud infrastructure and costs. As our customer base grows, we aspire to increase cloud costs incrementally to improve our investors’ ROI over time. As part of my daily responsibilities, Ohad Dahan, a Full-Stack Developer at Vim, and I reviewed our Cloudflare dashboard and observed alarming bandwidth spikes on one of our delivery endpoints for new versions.

For anyone tasked with managing cloud services, you know this requires immediate attention. Upon further investigation, I found that the automatic download process initiated by thousands of clients each time a new version was released was the cause of these spikes.

Consequently, we were incurring substantial egress costs to S3, amounting to approximately $3,000 per month at the present rate.

Compounding this concern, our intention to transition to a daily release schedule would exacerbate the problem, potentially escalating costs to around $50,000 per month.

Recognizing the urgent need to address this issue, I immediately began brainstorming potential solutions.

This blog post is aimed to bring this real-world scenario to life in a case study so you can proactively lower your Amazon S3 Direct Egress costs.


Researching for a solution

Since each update comprises identical copies of the same new version, caching seemed like a promising solution.

Unfortunately, CloudFront costs weren’t much better at around $2,500 per month.

Being a big fan of CloudFlare, I knew of R2 and quickly calculated that using R2 would reduce costs to zero. The R2 interface is also compatible with S3; the main difference is that R2 does not charge on egress.

However, since we had not used R2 previously, we determined that the best path forward would be to keep a fallback solution in place to mitigate any risk when working with a new infrastructure.

Results

 

Implementing this was easy: I simply stored and served from R2 instead of  S3

ROI

After implementing this change, we saw impressive results in a few areas.

Cost: We use a tool called CloudHealthTech. It allows you to monitor your actual costs on the cloud.  This change reduced the costs to near zero.

Speed: Our download speed increased and became faster (an unexpected bonus). 

ROI based on Speed and Storage: 

Before R2: $4K per month for 30TB of traffic.

After R2: $0.05K per month for 30TB of traffic.

 = 80% Improvement

Ilan Benborhoum

R&D Group Manager

Subscribe For the latest updates
Subscribe today and become a Vim-insider