Skip to content
New issue

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

scaling NodeJS #10

Open
linclark opened this issue Jul 12, 2014 · 1 comment
Open

scaling NodeJS #10

linclark opened this issue Jul 12, 2014 · 1 comment

Comments

@linclark
Copy link
Contributor

e.g. start with bad program does things like fs.*Sync calls then provide simulated traffic and test using benchmark… hint at various performance techniques e.g. always async, in-memory caching, leveldb, horizontal scaling with cluster and modularising app across multiple processes.

suggested in nodeschool/discussions#181

Does anyone have a suggested outline for the lesson?

@grabbou
Copy link

grabbou commented May 6, 2015

Hey,

what about creating a single http server in every problem which our solution would test in terms of performance (number of concurrent requests) and if the number is higher than the required by the problem, the solution would pass?

It would be also nice to expose some other benchmark results like averageResponseTime or numberOfTimedoutRequests just to show the students how different techniques can affect relatively simple CRUD server performance.

Introduction - Horizontal/Vertical scaling - what it is, cluster module - short overview
First problem - Preparations, clustering a single http server we gonna use in next problems
Second problem - A get endpoint with a sync filesystem call
Third problem - All sync methods converted to async ones
Fourth problem - Eliminating filesystem call by keeping first lookup results in-memory
Fifth problem - Keeping in-memory cache persistent during restarts (e.g. leveldb)

To make the results and differences more visible, we can consider passing a special blocking readFile method that contains either a timeout or a sleep inside, just to make it a bit slower.

Some potentially useful modules:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants