a question answered, a sale keptthe chat needs no cookie bannerunlimited teammatesreply from slack or our phone app

/blog / receipts

1000 messages a second on one core

· by kuba · 4 min read

The Spookat cat, startled, on top of the highest of six rising steps, with 1000/s written beside them.

We load-tested Spookat on the hardware it runs on in production. One process on one core took 1000 visitor messages a second with zero errors, and 800 a second while also posting every message to Slack, with every message delivered. Here’s how we tested it, the numbers, and what they mean for your site.

why we tested it

Spookat is deliberately small: the whole server is one process. Small is cheap to run and easy to reason about, and it gets you one obvious question from anyone who builds things: how far does it go?

We wanted a real number instead of a feeling. And we wanted it before launch, not after the first busy week.

how we tested

  • Same build as production. The exact release that serves real traffic, started as a separate process next to the live one. The live app and its data were never touched.
  • A fresh test database with 1200 test sites, so the load spread over many sites the way real traffic does.
  • Real widget traffic. A load generator opened widget connections and sent visitor messages at a fixed rate, in steps of 60 seconds. Every message went through the same code as a visitor typing: validation, abuse protection, saving, delivery, and the confirmation back to the widget.
  • Slack without spamming Slack. For the runs “with Slack”, every message was posted to a stand-in for Slack’s API that answers in about 50 ms, so we measured our side of the delivery, not Slack’s.
  • What we read: p99 of the confirmation (the time from the widget sending a message to the server confirming it was saved), CPU of the process, errors, memory, and for Slack runs, how many messages actually arrived.

Traffic came from the same machine, so these numbers are the app itself. Your visitors’ own network adds its usual latency on top, the same way it does for every site they visit.

the numbers

messages a second p99 confirmation CPU (one core) errors
without Slack 800 12 ms 58% 0
with Slack 800 75 ms 86% 0, every message delivered

Pushed further, the same process took 1000 messages a second with zero errors. That’s one process on one core taking 1000 visitor messages a second without Slack, and 800 a second with every message posted to Slack. Memory stayed near 110 MB the whole time.

For scale, 800 a second is about 69 million messages a day, far more than any one site will ever send.

one noisy site doesn’t slow the others

A busy chat server has a second job besides being fast: staying fair. So we also flooded a single site with a stream of new visitors for 90 seconds while the other sites carried 200 messages a second.

Spookat’s per-site flood protection held the flooded site back and rejected most of the flood. The other sites didn’t notice: p99 8.6 ms and zero errors, the same as with no flood at all.

That’s the part we care about most as a customer ourselves. If a bot hammers someone else’s chat, yours keeps answering.

the progress

We ran this test in rounds. After each one we profiled the process under load, found where the time went, fixed it and ran the stairs again. Between the first round and the build that’s in production now:

  • 4× the Slack traffic on the same core. With every message posted to Slack, one process now carries four times the rate it did in the first round, and every message arrives.
  • Steady at every step. From 200 to 800 messages a second, the confirmation stays under 15 ms without Slack, and no step dropped a message.
  • Less CPU per message. The same traffic that used most of the core in the first round now leaves room to spare.

stable for many sites at once

The test didn’t hammer one site. It spread the load over 1200 sites at the same time, each with its own visitors, conversations and delivery, the way Spookat runs for many companies side by side. In every run of the final build we report here: zero errors, zero lost messages, every Slack post delivered.

what it means for you

The app that answers your visitors is one small process, it keeps many sites talking at once without dropping a message, and it has a lot of room. On one core it takes far more than any single site sends, and a flood on one site stays on that site.

We built Spookat to be small on purpose, and small turned out to be fast. The launcher is about 2 kb, there are 0 requests to our API before a click, and the server behind it takes 1000 messages a second on one core.

Want a chat widget that’s already been hammered on your behalf? Start a 14-day trial, no card.

liked it? get on the list.

invites go out in small batches. when yours lands: 14 days free, no card.

we only email you about your invite and the launch. you can stop them anytime. privacy