Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Multitreaded TPS benchmarking subcommand #63

Closed
wants to merge 3 commits into from
Closed

Multitreaded TPS benchmarking subcommand #63

wants to merge 3 commits into from

Conversation

nourharidy
Copy link
Contributor

Since the main value proposition of Plasma is high TPS, I added a new subcommand: plasma-chain benchmark which launches a transaction spamming worker for each CPU and displays TPS rate in realtime.

benchmark behaves similar to testSwarm but removes the delay between txs, uses benchmark.js to collect stats, and displays it every 100ms.

Also made some necessary changes to test/mock-accounts.js but the exports interface is the same, so it should not affect the rest of the codebase.

@smartcontracts
Copy link
Contributor

👍, I like it. Wonder if we can have all of the bin/... stuff moved into a single program that uses these modules as sub-programs.

Copy link
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments, nothing blocking.

cluster.fork();
}

cluster.setMaxListeners(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this? To avoid accidentally creating unnecessary listeners?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using event listeners to send messages between workers and master processes. Node has a default max event listener limit set to 11 to avoid potential memory leaks. Setting it to 0 allows for unlimited listeners (and workers/CPUs) since the master process will use 1 event listener for each worker/CPU. A memory leak is not really possible because one would need to have a really high number of CPUs.

bin/plasma-chain-benchmark.js Outdated Show resolved Hide resolved
bin/plasma-chain-benchmark.js Show resolved Hide resolved
@nourharidy
Copy link
Contributor Author

Moved to #69

@nourharidy nourharidy closed this Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants