Closed fengyindiehun closed 7 years ago
首先:
json串如下 {"request_type":1,"adtag_list":[{"index_id":1,"bid_type":"cpt","ad_tag":"test"},{"assets":[1,2,3,4,5],"ad_tag":"mt_smaato","bid_tag":[{"bid_url":"http:\/\/b.comb.bidex.cn\/bifrost\/bid?adxid=30062&debug=true&see=adx&see=bsw","dsp_id":"mt_smaato","deal_id":["123"]}],"index_id":2,"ad_type":"native","bid_type":"pmp"},{"assets":[1,2,3,4,5],"ad_tag":"mt_inmobi","index_id":3,"ad_type":"native","bid_type":"s2s"}],"bundle":"com.meitu.xiuxiu","channel":"Developer Demo","ip":"","location":{"country":"other","city":"other","province":"other","area_code":"10267"},"area_id":"1","idfa":"966BF9CB-0D5A-4FBA-8943-7A332FAB06E2","idfv":"67D5B657-9E5E-45B9-BA81-F13B8A8A9D9A","device_id":"966BF9CB-0D5A-4FBA-8943-7A332FAB06E2","device_model":"x86_64","os_type":"iOS","position":"40","ua":"curl/7.43.0","w":375,"h":277,"session_id":"1005215020892173337635","os_version":"10.3","android_id":"","sdk_version":"3.0.0","sdk_version_code":"2010000","app_version":"2.1.0","mac_addr":"78:4F:43:70:30:11","resolution":"375x667","filtermask":"0","network":"wifi","mcc":"0","language":"en","assets":[{"asset_type":1,"h":100,"w":100},{"asset_type":2,"h":360,"w":710},{"asset_type":3,"len":30},{"asset_type":4,"len":100},{"asset_type":5,"len":10}]} 每次都能复现
经过大约2s server才会收到请求,打开sofa的log发现时间都耗在了sofa里面
你应该提供 sofa-pbrpc 的版本,RpcServerOptions 的具体配置,你也可以尝试运行 sample 里的 echo,看看是否同样会延迟 2s
@neverchanje 说得不错,你应当使用类似sample样例的程序,让我们可以复现。你可以在自己的github项目下开个分支,然后把用于复现的代码放上去(或者模拟测试程序),发给我们分析。
找到规律了 当以http发送数据包大于1k时就有问题,小与1k时就没啥问题,怀疑是否是内部设置的某个buffer大小导致的
...curl的问题
@fengyindiehun 具体是curl的什么问题?分享一下
大包先发Expect: 100-continue?
后来有解决这个问题吗?
我是猜的,是不是要等原作者确定。
因为我也遇到过这个问题,后来设置curl的属性
headers = curl_slist_append(headers, "Expect:");
就可以了。
@fengyindiehun 反馈一下?
@qinzuoyan 确实如@DerrickChina所说 对大包curl会 Expect: 100-continue
很好,多谢@fengyindiehun 的反馈
不知道是json字段太多导致的还是json数据包太大导致的 请问谁能帮忙回答下吗