sway
October 17, 2023, 10:23pm
1
Is there any node statistic method where I can calc TPS of Fuel?
Hi there!
The graphql endpoint contains relevant information about blocks timestamp that can be used for getting the avg TPS.
const getLatestBlocks = async () => {
let response = await fetch("https://beta-4.fuel.network/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
query: LATEST_BLOCKS_QUERY,
}),
});
const json = await response.json();
const timestamps = json.data.blocks.nodes.map(block=>block.header.time)
const average = timestamps.reduce((a, b) => a + b, 0) / timestamps.length;
console.log("Average tx ms", average)
};
With this query
const LATEST_BLOCKS_QUERY = `
query LatestBlocks {
blocks(last: 5) {
nodes {
id
header{
height
time
}
}
}
}
`
3 Likes
nick
October 23, 2023, 11:50am
3
Preface: TPS is a horrible measure of performance for blockchain.
That being said, in our Fuel client, which is nowhere near optimized, we are getting 20-25,000 TPS on a single core for simple transfers.
With an 8-core, optimizations and full parallelism enabled that could easily be multiplied by a factor of 8, so 160k TPS.
Note, this is just what the client can process on a powerful CPU locally. Bandwidth is usually a primary constraining factor, IO typically second to that.
With Ethereum 4844, we can use around 1mb every 13 seconds. This would give us around 400 TPS on a 200 byte transaction size until the next phase of sharding is implemented using pure Ethereum DA.
Reference:
FuelLabs:master
← FuelLabs:Voxelot/tx-throughput-bench
opened 12:02AM - 21 Oct 23 UTC
fixes: #1410
Adds some basic benchmarks for a single node involving transfer … scripts with 2 inputs & 2 outputs.
This includes:
- signed coin transfers
- noop predicate transfers
- eck1 verifying predicate transfers
On a Ryzen 5950X I got the following results:
```
signed transfers/100 time: [3.8326 ms 3.8560 ms 3.8862 ms]
thrpt: [25.732 Kelem/s 25.933 Kelem/s 26.092 Kelem/s]
signed transfers/500 time: [19.983 ms 20.106 ms 20.245 ms]
thrpt: [24.698 Kelem/s 24.869 Kelem/s 25.021 Kelem/s]
signed transfers/1000 time: [40.451 ms 40.885 ms 41.354 ms]
thrpt: [24.182 Kelem/s 24.459 Kelem/s 24.721 Kelem/s]
signed transfers/1500 time: [62.526 ms 62.943 ms 63.368 ms]
thrpt: [23.671 Kelem/s 23.831 Kelem/s 23.990 Kelem/s]
predicate transfers/100 time: [3.6510 ms 3.6999 ms 3.7461 ms]
thrpt: [26.695 Kelem/s 27.028 Kelem/s 27.390 Kelem/s]
predicate transfers/500 time: [19.011 ms 19.109 ms 19.222 ms]
thrpt: [26.011 Kelem/s 26.166 Kelem/s 26.301 Kelem/s]
predicate transfers/1000 time: [38.979 ms 39.273 ms 39.627 ms]
thrpt: [25.236 Kelem/s 25.463 Kelem/s 25.655 Kelem/s]
predicate transfers/1500 time: [60.765 ms 62.232 ms 64.057 ms]
thrpt: [23.417 Kelem/s 24.103 Kelem/s 24.685 Kelem/s]
predicate transfers eck1/100 time: [3.8533 ms 3.8765 ms 3.8980 ms]
thrpt: [25.654 Kelem/s 25.796 Kelem/s 25.952 Kelem/s]
predicate transfers eck1/500 time: [19.910 ms 20.061 ms 20.207 ms]
thrpt: [24.744 Kelem/s 24.923 Kelem/s 25.113 Kelem/s]
predicate transfers eck1/1000 time: [41.045 ms 41.489 ms 41.976 ms]
thrpt: [23.823 Kelem/s 24.103 Kelem/s 24.363 Kelem/s]
predicate transfers eck1/1500 time: [63.361 ms 63.941 ms 64.802 ms]
thrpt: [23.147 Kelem/s 23.459 Kelem/s 23.674 Kelem/s]
```
Interestingly the throughput difference between noop predicates and eck1 verification is fairly minimal, indicating the bottlenecks are in other areas besides tx validity checking (i.e. db performance). However the results show that a fuel-core node can easily process roughly 20k tps at full throttle without any p2p or block timing restrictions.
1 Like