grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

when send 89M request body,it is cost 6 second? after user gzip,also

Open topherli opened this issue 10 months ago • 3 comments

hello i deploy a grpc client an a grpc server on the same linux pc i send 89M req to server ,i find it very time-consuming,about 6~10 second i guess it is network limit,so i use gzip,but is same problem so i guess serialization cost so long time ,i print log below image image image image i print log at onMessage serverintercepter,i think serialization is before onMessage and generateobjnames is handle funtion i find that during after onMessage and the handle funtion of generateobjnames is most cost time,why? i think it memory opration

please help me ? thank you very mush

topherli avatar Apr 26 '24 09:04 topherli

Your log is showing that the time is being spent in some interceptor. The log message in generateObjNames happens at the beginning, so the time is spent before that. You have 3 1/2 seconds between Serialization time and when generateObjNames is called. The code snippet you included has only Deserialization time methods, so there must be some other part of your code where the serialization is happening and that seems to be where the time is spent.

larry-safran avatar Apr 30 '24 01:04 larry-safran

Your log is showing that the time is being spent in some interceptor. The log message in generateObjNames happens at the beginning, so the time is spent before that. You have 3 1/2 seconds between Serialization time and when generateObjNames is called. The code snippet you included has only Deserialization time methods, so there must be some other part of your code where the serialization is happening and that seems to be where the time is spent.

thank you very much,this is server intercepter,i think that it only have Deserialization time(binary to proto objects),why has Serialization time? if has Serialization time,i think that grpc self done?

topherli avatar May 06 '24 02:05 topherli

I wonder if this is a question about HTTP/2 frame transmission, with the request headers arriving first at the server interceptor, followed by the request body, and all the time spent on transferring the request body Otherwise, I can't imagine deserialization taking so long, because it only takes a few hundred milliseconds for me to convert from a Java object to a Proto object.

topherli avatar May 07 '24 06:05 topherli