Open JacksonRGB opened 1 year ago
@minchenzz Can you post pprof/trace data?
My immediate question for you is whether you are using Ed25519 for signature verification. In my experience, that's a quick and easy win for performance.
@lthibault Thanks for your help! I didn't use ED25519. I want to remove duplicates by using msgID.
sha256ID
pprof/trace
pprof/profile
xxhashID
pprof/trace
pprof/profile
randomID
pprof/trace
pprof/profile
I don't see anything obvious there. You might also consider running a CPU and memory allocation profile to see if there's anything there.
I am currently using pubsub with grpc proxy, and the maximum TPS tested in the same AWS availability zone is 800. When continuously sending data of 20kb, the transmission bandwidth is about 16MB/s, and when continuously sending data of 40kb, the transmission bandwidth is about 32MB/s. The CPU usage is always less than 200% on a 4-core CPU.
The configuration I am using is:
Found the reason: the custom msgID function was consuming too much time.
this is my function
if I do this, I got a test result of 72MB/s (3600TPS).
I have tried many hash functions such as xxhash, and during the benchmark test xxHash was 30 times faster than sha256. However, in actual testing, TPS remained at 800.
update:
If I read the pubsub.Message, it becomes very slow.(800TPS)