DEV Community

Cover image for Building a Low-Cost Image Converter on AWS With Rust Lambda
fayismahmood
fayismahmood

Posted on

Building a Low-Cost Image Converter on AWS With Rust Lambda

Project demo link: https://image-ignite.vercel.app/

This started as a hobby project. I was thinking about a simple image conversion service for resizing ,convert, compress uploaded images.

Since it was a personal project, cost mattered a lot.
Keeping EC2 instances running 24/7 felt unnecessary for a workload that only existed for a few seconds per request.

So I started experimenting with AWS Lambda.


First Attempt: Node.js + Sharp on Lambda

My initial stack was:

Component Tech
Runtime Node.js
Processing Sharp
Compute AWS Lambda
Storage AWS S3

The architecture was very simple:

Upload → Lambda → Process Image → Store Result
Enter fullscreen mode Exit fullscreen mode

At first, Lambda felt like the perfect solution:

  • no idle server costs
  • automatic scaling
  • no server management
  • pay only when used

Exactly what I wanted for a hobby project.


The Problem I Started Noticing

After some usage, cold starts became noticeable.
Especially for image-heavy requests.

The actual image processing was fast enough, but startup time sometimes became a large part of the total request.

Approximate numbers from my experience:

Metric Node.js + Sharp
Cold Start ~700ms – 2s
Warm Start ~50ms – 150ms
Memory Usage ~180MB – 350MB

For a workload that only runs a few seconds, that startup overhead feels significant.


Why I Switched to Rust

I rebuilt the processor using Rust Lambda.
Not because of hype.

The workload simply matched Rust better.
The difference became noticeable almost immediately.

Metric Node.js + Sharp Rust Lambda
Cold Start ~700ms – 2s ~80ms – 300ms
Warm Start ~50ms – 150ms ~10ms – 40ms
Memory Usage ~180MB – 350MB ~40MB – 90MB

For this type of workload, lower startup time mattered a lot more than I initially expected.


Final Thoughts

This project started as a small hobby image converter where I wanted to avoid the cost of always-on infrastructure. I initially used Node.js with Sharp on AWS Lambda, but cold starts became noticeable for short-lived image processing tasks. Moving to Rust improved startup time and reduced memory usage significantly. More importantly, it changed how I think about infrastructure — some workloads work better as temporary, event-driven compute instead of persistent servers.

Top comments (0)