We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.1.32-canary.21+ae8de1926
Microsoft Windows NT 10.0.26100.0 x64
(app.js)
import { Hono } from 'hono'; import cluster from 'node:cluster'; import os from 'node:os'; import dotenv from 'dotenv'; dotenv.config(); const numCPUs = os.cpus().length; const MaxCPUs = 8; const port = process.env.PORT; if (cluster.isPrimary) { console.log(`Primary ${process.pid} is running`); for (let i = 0; i < Math.min(Math.max(numCPUs, 1), MaxCPUs); i++) cluster.fork(); cluster.on('exit', (_) => cluster.fork()); process.on('SIGINT', () => { process.exit(0); }); } else if (cluster.isWorker) { const app = new Hono(); console.log(cluster.worker.id, process.pid); app.get('/id', (c) => { // console.log(cluster.worker.id); return c.text(cluster.worker.id); }); Bun.serve({ fetch: app.fetch, port, reusePort: true, development: false }); console.log(`Server running on http://127.0.0.1:${port}`); }
(index.js)
Bun.spawn(["bun", "./app.js"], { stdio: ["inherit", "inherit", "inherit"], env: { ...process.env }, });
run: bun index.js
bun index.js
i never had this worked since v1.1.2 before (i start using bun at v1.1.2) but it works if run with nodejs.
this made bun is not faster than nodejs (bun is slower 1-5%) due the clusters dont work
No response
The text was updated successfully, but these errors were encountered:
i have also tried using native bun serve (from: here) but still the same thing
Sorry, something went wrong.
my old issue
(another test)
No branches or pull requests
What version of Bun is running?
1.1.32-canary.21+ae8de1926
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
(app.js)
(index.js)
run:
bun index.js
What is the expected behavior?
i never had this worked since v1.1.2 before (i start using bun at v1.1.2) but it works if run with nodejs.
What do you see instead?
this made bun is not faster than nodejs (bun is slower 1-5%) due the clusters dont work
Additional information
No response
The text was updated successfully, but these errors were encountered: