I'm testing the performance of testnet, but I cannot get higher than 530 tps on token swap smart contracts (enabling parallel executions by deploying multiple instances). It seems that the test validator only uses 4 cores (I have 256 cores). I have the same tps using RAM or SSD to store the chain, so it's not a storage bottleneck. Is there a default performance limitation of the local testnet?
1 Answer
There are a lot of factors that might be limiting TPS on your testnet.
Block limits: a Solana block can only have a maximum of 48 million CUs (as of this writing), and one particular account can only be written for 12 million CUs. Check to see how many CUs your program is consuming. The banking stage only uses 4 threads, with 12 million CUs per block per banking thread.
Client limits: the client sending the transaction might be limited in the number of transactions it can sign and send, so make sure the client machine is sending enough transactions
Networking limits: due to stake-weighted quality-of-service, clients are limited in the amount of connections they get with a validator. You may need to increase the receive window of your validator, or send the transactions directly from the same machine so that the client uses all possible connections.
So go through these and see which you hit!