Skip to content

multicore http server#250

Draft
missinglink wants to merge 8 commits intomasterfrom
better-sqlite3-v2-plus-libpostal-service-plus-multicore
Draft

multicore http server#250
missinglink wants to merge 8 commits intomasterfrom
better-sqlite3-v2-plus-libpostal-service-plus-multicore

Conversation

@missinglink
Copy link
Copy Markdown
Member

@missinglink missinglink commented Mar 17, 2020

This draft PR is #249 plus a single commit to add multi-core support to the http server via the cluster module.

When using the node-postal 'module' adapter it is recommended to set the env var CPUS=1 to force the server single-threaded.

@missinglink
Copy link
Copy Markdown
Member Author

@orangejulius I did some basic testing on this and found that using multicore and libpostal service resulted in worse performance than running it single-threaded using the npm module.

Maybe there's an error in how I'm using the async code or something else going on?

@orangejulius
Copy link
Copy Markdown
Member

Yeah, I recall experiencing and reading about poor performance from the cluster2 module in the past.

After all, it's essentially a load balancing layer where different Node.js processes are communicating with each other. I imagine it's not nearly as efficient as say, Nginx in front of several identical Node.js processes reading from the same SQLite DB.

@missinglink missinglink force-pushed the better-sqlite3-v2-plus-libpostal-service-plus-multicore branch 2 times, most recently from afc85ab to d4678cf Compare March 20, 2020 15:09
@missinglink missinglink force-pushed the better-sqlite3-v2-plus-libpostal-service-plus-multicore branch from d4678cf to dadecb7 Compare March 20, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants