转至元数据结尾
转至元数据起始


超时介绍

页面限制的时间是当前月。这几天是下旬。每天7w的数据量。每每点击“查询”按钮时,汇总行都会超时。见下面贴图。


程序log

sql开始2024-09-25 18:05:21.105 [server-provider-10.244.6.230] [TID:d439059c74224cf0bdb5122dd0351596.196.17272587210972673] [DubboServerHandler-10.244.6.230:20880-thread-107] DEBUG c.e.t.p.m.p.m.PaymentOrderMapper.transAmtTotal:? - ==> Preparing: SELECT count(*) AS total, sum(amount) AS 'amtTotal', sum(fee) AS 'feeAmtTotal', sum(CASE status WHEN 'PAY_SUCCESS' THEN fee ELSE 0 END) AS 'successfulFeeAmtTotal', sum(CASE status WHEN 'PAY_SUCCESS' THEN amount ELSE 0 END) AS 'successfulAmtTotal' FROM trans_payment_order WHERE create_time BETWEEN ? AND ? ORDER BY id DESC
sql参数2024-09-25 18:05:21.107 [server-provider-10.244.6.230] [TID:d439059c74224cf0bdb5122dd0351596.196.17272587210972673] [DubboServerHandler-10.244.6.230:20880-thread-107] DEBUG c.e.t.p.m.p.m.PaymentOrderMapper.transAmtTotal:? - ==> Parameters: 2024-09-01 00:00:00(String), 2024-09-25 23:59:59(String)
【sql执行中...】
RPC超时异常

2024-09-25 18:05:36.119 [system-10.244.7.155] [TID:d439059c74224cf0bdb5122dd0351596.196.17272587210972673] [http-nio-9903-exec-8] ERROR c.e.zhenghe.common.filters.ClientExceptionFilter:? - [RPC_CALL_RPC_EXCEPTION]An RPC call exception, such as a handle timeout, occurs with the RPC call.org.apache.dubbo.rpc.RpcException:

Failed to invoke the method transAmtTotal in the service com.emax.trans.rpcapi.payment.service.PaymentService.

Tried 1 times of the providers [10.244.6.230:20880] (1/2) from the registry 10.0.2.8:2181 on the consumer 10.244.7.155 using the dubbo version 3.1.11. Last error is: Invoke remote method timeout. method: transAmtTotal, provider: DefaultServiceInstance{serviceName='zhenghe-trans-provider', host='10.244.6.230', port=20880, enabled=true, healthy=true, metadata={dubbo.endpoints=[{"port":20880,"protocol":"dubbo"}], dubbo.metadata-service.url-params={"connections":"1","timeout":"15000","version":"1.0.0","dubbo":"2.0.2","release":"3.1.11","side":"provider","port":"20880","protocol":"dubbo"}, dubbo.metadata.revision=90d1589d7c588b43e10cd541925f8a6e, dubbo.metadata.storage-type=local, instance.zone=unknown, timestamp=1726745180809}}, service{name='com.emax.trans.rpcapi.payment.service.PaymentService',group='prod',version='null',protocol='dubbo',port='20880',params={side=provider, release=3.1.11, methods=confirmPay,getStdAvailableBalance,handlePayCallback,list,page,payConfirm,payConfirmByImport,payConfirmBySceneLevy,paymentStatusQuery,queryByOrderNo,queryPaymentStatus,queryPaymentStatusLocal,queryReceiptBySceneOrderNo,queryReceiptUrlByOrderNo,queryReceiptUrlByOrderNoList,syncPaymentStatus,transAmtTotal,updateRefundOrderStatus,updateTransOrderByScene, deprecated=false, dubbo=2.0.2, threads=500, interface=com.emax.trans.rpcapi.payment.service.PaymentService, service-name-mapping=true, threadpool=eager, timeout=15000, register-mode=instance, generic=false, revision=1.0.1-SNAPSHOT, serialize.check.status=DISABLE, corethreads=200, application=zhenghe-trans-provider, background=false, queues=1000, dynamic=true, anyhost=true, group=prod},}, cause: org.apache.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan timer. start time: 2024-09-25 18:05:21.107, end time: 2024-09-25 18:05:36.117, client elapsed: 0 ms, server elapsed: 15010 ms, timeout: 15000 ms


从程序log可以看到,查询汇总的sql执行时间超过了RPC等待时间15s。→ RPC超时,页面报错。


优化后

通过在sql执行性能方面打patch,接口响应耗时缩短为5s。



编写评论...