Homework 5 - Measuring Performance
Measuring app speed
Due: Friday, December 1, 2023 at 3:00:00 PM
Quickstart: To create a new repository under your own GitHub account, you can create a new private repository from this template. Sharing your code, intentionally or unintentionally, is a violation of the academic integrity policy in this course.
Description
- You are given a basic script, that is inherently slow (In terms of concurrent requests being satisfied) Your task for this assignment is fairly straightforward.
- Given the basic
server.js
update the code to make it more performant. - Look out for the section in the code which you think, if optimized, will result in a performance boost.
- The motivation for the assignment is to elucidate the tools/tricks that can be brought into play to measure your application performance and thus making it better.
- Given the basic
Tools / Techniques Used in the Assignment
-
Flame graphs: Flame graphs are a CPU profiling visualization technique that helps to spot at glance the most frequently used function, and most importantly the time they need to run.
-
0x: A tool to generate flame-graphs for node.js
-
Artillery: Artillery.io, an open-source, modern, powerful, and flexible load testing toolkit. Artillery is designed to help developers and testers assess the performance and scalability of their systems.
-
MongoDB: Open source NoSQL database management program.
Assignment expects you to have a running MongoDB server.
- Installation on Linux/Ubuntu: Check here
- Rest Check here
Install the dependencies using npm install
- This will also populate the MongoDB document for you as a postInstall script
load.js
. - Your
server.js
will then be communicating with the datastore.
Deliverables
- Optimize server.js.
- Generate flame-graph using
npm run flame-graph
- Do the perf testing using
npm run load-test
. You need to have a running server for this. Run bynode server.js
- Submit the following merged as a
SINGLE PDF
- Flame-graph
- Screenshot for Artillery summary As shown below
- Generated test-run-report (HTML)