9

I've a couple of questions:

I'm running a the node-template on a machine that has 8 cores and 64GB of RAM and its using an SSD. I have some pallets working there and I'm using the python client to submit multiple transactions and check how the node is performing. Running the substrate sub-flood service, I got around 94 TPS and registered around 600 tx per block (but not filled it completely). The first question is, how many extrinsics can a single node handle? Does it depend on the machine specs (checking machine cpu usage it didn't reach even half of the max)? Am I getting a reasonable amount of TPS?

I'm able to submit something between 3000~5000 tx with no issue on the first run, but as time goes by, if I continue to submit this number of transactions, the node tends to slow block production (which is not what anyone would want), and its only able to keep the block production rate constant if I go down to 1000 extrinsics per batch (a single batch per block). At the time, I'm estimating the extrinsic weights using this approach Parameterizing over database accesses as I'm unable to create benchmarks for now.

I'm using the utility pallet to submit batches.

This is an example of what I'm getting. enter image description here

The second question would be, are nodes prepared to receive this amount of transactions per block? I know blocks can only store a certain amount of extrinsics based on their weight, but If a set the extrinsic weight to 0, I can store any number tbh.

I guess block production is slowed because I'm not setting the right weights, but are there any other possibilities that make the block production rate slow besides that?

3
  • 1
    The node under pressure is not using more than 2 cpus at the time, which is nice. The rust-analyzer uses all the cpus so I had to disable it.
    – andresvsm
    Commented Jul 5, 2022 at 12:49
  • Parameterizing over database accesses is now a broken link Commented Dec 22, 2022 at 13:39
  • yep, this question was posted before the recent update of the substrate web page, but I was not able to find the same content there
    – andresvsm
    Commented Jan 9, 2023 at 8:51

1 Answer 1

4

After writing some benchmarks and making some code changes, I was able to make the block production constant. At the time, I'm able to handle ~1000tx per block (6s), which is not bad at all. To make block production constant it was a matter of writing benchmarks simulating the worst case scenario for each extrinsic on my chain and setting the right weights on each one of them. I had another issue that was causing the block production to slow down after ~30k tx, the issue was related to the way I was pushing new data on a vector, but as soon as I started using append, the issue disappeared.

1
  • 1
    nice findings. swap remove is a speedy way of removing from a vec btw if you don't need to preserve ordering.
    – Squirrel
    Commented Jul 5, 2022 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.