Encore

Stay in touch

Product updates and engineering deep-dives.

DiscordGitHubYouTube

© 2026 Encore

Product
Encore PlatformEncore Platform
Encore.tsEncore.ts
Encore.goEncore.go
InstallInstall
PricingPricing
Customers
Case StudiesCase Studies
ShowcaseShowcase
Book a DemoBook a Demo
Resources
DocsDocs
Example AppsExample Apps
Demo videoDemo video
ArticlesArticles
GitHub ReleasesGitHub Releases
Systems Operational
Company
AboutAbout
Swag ShopSwag Shop
ContactContact
JobsJobs
PressPress
SecuritySecurity
Legal
TermsTerms
Privacy PolicyPrivacy Policy
Data Processing AgreementData Processing Agreement
Enterprise SLAEnterprise SLA
← All articles

Worker Pooling — 5x performance for CPU-intensive JavaScript workloads

Launch Week Day 5

Dec 13, 2024
3 Min Read
André Eriksson
← All articles
Dec 13, 2024

Worker Pooling — 5x performance for CPU-intensive JavaScript workloads

Launch Week Day 5

André Eriksson
3 Min Read

It's the final day of Launch Week and we're back with one last launch...

Introducing Encore.ts Worker Pooling

Encore.ts now provides Worker Pooling mode — a brand new way of running CPU-intensive JavaScript workloads that provides even more performance and scalability than has been possible before.

It works by combining the multi-threaded nature of Encore.ts' high-performance Rust runtime with multiple worker threads in NodeJS.

This means your applications are no longer constrained by JavaScript's single-threaded event loop. Instead, Encore.ts is now able to orchestrate and coordinate workloads across multiple event loops, providing a dramatic performance boost for CPU-intensive workloads.

While this might remind you of using node:worker_threads or node:child_process, there are some major advantages compared to these approaches, which we will dig into below.

5x Performance improvement

In our tests, real-world applications that reach the limits of NodeJS' single-threaded performance have achieved up to a 5x performance improvement when using Encore.ts Worker Pooling, compared to Encore.ts running in single-threaded mode.

And this is on top of the already huge performance benefits that Encore.ts provides compared to other frameworks.

See a live demo and performance benchmark in the video above. Click here to jump straight to the benchmark part of the video.

How it works

When enabled via a simple configuration in your Encore project, all worker thread management is handled automatically by Encore.ts.

You don't need to write any thread management code, create worker pools, or handle thread coordination yourself — Encore.ts takes care of creating and orchestrating worker threads based on your application's needs.

The architecture

The Encore.ts Worker Pooling architecture involves a single process, consisting of the multi-threaded Encore.ts Rust runtime, and multiple independent worker threads in NodeJS.

Beyond distributing and load-balancing incoming HTTP requests, Encore.ts also automatically distributes incoming Pub/Sub messages to multiple worker threads.

At first glance, this architecture is not too different from existing solutions for JavaScript multithreading, like using the node:worker_threads module directly, or sharing a TCP listening port across multiple processes via SO_REUSEPORT:

However, these approaches have significant drawbacks when you want to share resources between threads, like database connection pools, HTTP client connections, or observability integrations. The complexity of sharing these resources safely often leads to a simpler but inefficient solution, where each process maintains its own separate resource pools. This results in unnecessary resource duplication and reduced performance:

Encore.ts Worker Pooling provides significant benefits over these approaches.

The Encore.ts Rust runtime is shared between Workers, providing much more efficient sharing of resources like database connection pools, HTTP client connections, observability integrations like Distributed Tracing, and more:

Considerations: No shared state

When using Worker Pooling in Encore.ts, the system automatically detects the available CPUs and allocates a worker thread for each. This means you can deploy your applications without needing extensive configuration changes. For most applications, no additional setup is necessary.

However, it’s important to remember that worker threads operate independently and do not share state. This means that global state management becomes more complex, and if your application relies on shared state across workers you will need to adapt your design before activating woker pooling.

Try it yourself

If you're already using Encore, update using encore version update.

If you're new to Encore, install using the instructions below and then create an example app using encore app create.

macOS
Windows
Linux
Brew
$ brew install encoredev/tap/encore

If you have questions or just want to hang out with other Encore developers, join our community on Discord.

Contents
Introducing Encore.ts Worker Pooling
5x Performance improvement
How it works
The architecture
Considerations: No shared state
Try it yourself
Encore

Automated infrastructure for humans and agents

Let agents build and validate features with real infrastructure in the dev loop. Encore automatically provisions infrastructure, from local dev to production in your cloud on AWS/GCP.

Get started
Encore

This blog is presented by Encore, automated infrastructure for humans and agents. Let agents build and validate features with real infrastructure in the dev loop, from local dev to production in your cloud on AWS/GCP.

Like this article? Get future ones straight to your mailbox.

You can unsubscribe at any time.

Related Articles

Development
08/18/26 / 15 Min Read
Development
08/18/26 / 15 Min Read
We rebuilt the Linux microVM stack on Apple Silicon
What it takes to boot the same microVMs on Apple's hypervisor, and the one capability Apple will not let you have.
Ivan Cernja
Development
07/28/26 / 5 Min Read
Development
07/28/26 / 5 Min Read
Your SQS consumer can hang forever by default
The AWS Rust SDK ships no request timeout by default, so one SQS receive on a dead connection can hang a whole consumer with nothing in the logs.
Ivan Cernja
Development
07/21/26 / 8 Min Read
Development
07/21/26 / 8 Min Read
Sandboxing an agent's code isn't the same as trusting it
A sandbox keeps an agent's code contained. It can't tell you the code is correct, which for backend code is the harder problem.
Ivan Cernja