Resend Rewrote Its Email API in Go and Nearly Halved Median Latency
Resend said on Nov. 12 that a Go service now handles all its email API traffic and cut median send latency from 58 ms to 31 ms.

Resend has replaced the Node.js service behind its email API with one written in Go, the company said in a Nov. 12 engineering post. The rewrite took seven weeks and roughly 140 pull requests, and by October the Go service was handling all email API traffic, the post said. While traffic was split evenly between the two, Go showed about half the median latency and about one-seventh the memory per task.
Median send latency fell from 58 ms to 31 ms
Resend measured both services during a 50% rollout, with half of requests going to Node and half to Go on the same task size. Median latency for POST /emails fell from 58 ms to 31 ms, the post said. The 95th percentile fell from 149 ms to 107 ms and the 99th from 498 ms to 420 ms, a drop of about 16%.
Batch sends improved by a similar margin, from a 149 ms median to 74 ms. Memory per task went from about 1.3 GB to about 180 MB, and the number of tasks at peak fell from 34 to 10. Go used about 62% less CPU per request.
Resend called the results preliminary. Much of the slow tail is time spent waiting on S3 and the database, the post said, so cutting it further means work on those dependencies.
Large requests could freeze a Node task
The old service had failure modes Resend wanted gone. During bursts of large requests, a whole task could stop responding, the post said. One investigation traced that to parsing and serializing large request bodies, including requests the rate limiter was already rejecting. That work is synchronous in Node.js and blocks the event loop until it finishes. S3 timeouts also reached customers as 408 and 524 errors.
Resend kept some Node quirks on purpose
Resend built a test harness that sends the same request to Node and Go and compares the results. It checks responses and errors, database rows, S3 objects, idempotency and rate limits. The post said checking the HTTP response alone would miss cases where both services return success but store different metadata or produce different email content.
“We also preserved some Node quirks deliberately,” the post said. “Changing an unexpected behavior can still break an integration that depends on it.”
One example was the plain-text version Resend generates when an email arrives with only HTML. The Go library the team first chose kept elements marked data-skip-in-text="true" and added URL text to links, which would have changed what recipients received. Resend wrote its own Go port of the Node behavior, and it matched all 60 fixtures generated from the Node service.
Attachments were another case, engineer Derich Pacheco said in the post. Resend’s Node SDK accepts a Buffer for attachments, which arrives as JSON, and Go has no Buffer, so the team rebuilt the conversion by hand.
Go needed tuning in production
The Go service used fewer resources per request, but Resend still doubled task sizes twice during the rollout. It also added capacity ahead of a traffic spike that recurs at the top of each hour, set per-request timeouts on S3 uploads and tuned Redis connection pools, the post said.
The take
We would copy the test harness before we would copy the choice of Go. A public API promises more than its documentation says. Customers build on whatever the service does, including its accidents, so a rewrite is safe only if the new code repeats those accidents. Resend compared stored rows and finished emails as well as HTTP responses, and those are the places where two services can disagree while reporting success.
Resend users have nothing to change. If you send attachments or HTML-only email, compare a few recent sends against older ones. Before a rewrite of our own, we would write down what “the same” means and build the test that checks it.


