// Stay in touch?
Products
Encore CloudEncore Cloud
Encore.tsEncore.ts
Encore.goEncore.go
PricingPricing
Book a DemoBook a Demo
Use Cases
AI-Powered DevelopmentAI-Powered Development
Event-Driven SystemsEvent-Driven Systems
Distributed SystemsDistributed Systems
Case StudiesCase Studies
ShowcaseShowcase
Resources
DocsDocs
InstallInstall
Example AppsExample Apps
Demo videoDemo video
ArticlesArticles
ResourcesResources
GitHub ReleasesGitHub Releases
Systems Operational
Company
About UsAbout Us
Swag ShopSwag Shop
ContactContact
JobsJobs
PressPress
TermsTerms
Privacy PolicyPrivacy Policy
Data Processing AgreementData Processing Agreement
Enterprise SLAEnterprise SLA
Encore
© 2026 EncoreAll rights reserved
© 2026 Encore All Rights Reserved
GitHubDiscordYouTube

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

Launch Week Day 5

Dec 13, 2024
3 Min Read
André Eriksson
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

A development platform for your own cloud on AWS & GCP

Encore automates infrastructure management, observability, and documentation. Your team can focus on shipping product.

Encore

This blog is presented by Encore, the backend framework for building robust type-safe distributed systems with declarative infrastructure.

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

You can unsubscribe at any time.

Related Articles

AI
05/20/26 / 14 Min Read
AI
05/20/26 / 14 Min Read
Are TypeScript backend frameworks ready for AI agents?
We set out to run one benchmark across five TypeScript backend frameworks. Reading the diffs sent us into two more runs, and the picture changed each time.
Ivan Cernja
Infrastructure
05/04/26 / 7 Min Read
Infrastructure
05/04/26 / 7 Min Read
What is distributed tracing?
An interactive guide to debugging real backend issues
Ivan Cernja
Tutorial
04/29/26 / 7 Min Read
Tutorial
04/29/26 / 7 Min Read
Sentry + Encore
Error tracking for your backend services
Ivan Cernja