Xmemcached异常超时:Timed out waiting for operation
Hi:
XMemcached版本:1.4.3
使用spring管理,创建连接时使用MemcachedClientBuilder。
查询时:client.get(searchPkgNameList, 5);
其中searchPkgNameList会很大,一次大概有300个key。
异常信息:
-- Timed out waiting for operation java.util.concurrent.TimeoutException: Timed out waiting for operation at net.rubyeye.xmemcached.XMemcachedClient.getMulti0(XMemcachedClient.java:1245) at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1119) at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1157) at com.*.appserver.service.AppSearchService.searchAppType(AppSearchService.java:46) at com.*.appserver.controller.AppController.searchAppType(AppController.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606)
我调整了超时时间,但还是异常。难道是我的一次查的key太多?
另外:warn:
[net.rubyeye.xmemcached.XMemcachedClient] - You are using connection pool for xmemcached client,it's not recommended unless you have test it that it could increase performance in your app.
是否是不应该使用MemcachedClientBuilder来创建连接?还请帮助。多谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
官方:
https://github.com/killme2008/xmemcached/issues/30
好像没解决
请问问题处理了吗?我也遇见了!
t com.palmcity.memached.MemcacheManager.get(MemcacheManager.java:410)
at com.palmcity.bus.handler.thrift.ThriftBusArrivalHandler.handler(ThriftBusArrivalHandler.java:48)
at com.palmcity.bus.handler.thrift.ThriftServerImpl.sendCommand(ThriftServerImpl.java:51)
at com.palmcity.bus.servers.ThriftCommandService$Processor$sendCommand.getResult(ThriftCommandService.java:175)
at com.palmcity.bus.servers.ThriftCommandService$Processor$sendCommand.getResult(ThriftCommandService.java:1)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:225)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.concurrent.TimeoutException: Timed out(50000 milliseconds) waiting for operation while connected to 192.168.3.101:12000
at net.rubyeye.xmemcached.XMemcachedClient.latchWait(XMemcachedClient.java:2536)
at net.rubyeye.xmemcached.XMemcachedClient.fetch0(XMemcachedClient.java:644)
at net.rubyeye.xmemcached.XMemcachedClient.get0(XMemcachedClient.java:1058)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1016)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1027)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1049)
at com.palmcity.memached.MemcacheManager.get(MemcacheManager.java:406)
... 10 more
java.lang.Exception: 读取缓存超时key=xxxxxx
at com.palmcity.memached.MemcacheManager.get(MemcacheManager.java:410)
at com.palmcity.bus.handler.thrift.ThriftBusArrivalHandler.handler(ThriftBusArrivalHandler.java:48)
at com.palmcity.bus.handler.thrift.ThriftServerImpl.sendCommand(ThriftServerImpl.java:51)
at com.palmcity.bus.servers.ThriftCommandService$Processor$sendCommand.getResult(ThriftCommandService.java:175)
at com.palmcity.bus.servers.ThriftCommandService$Processor$sendCommand.getResult(ThriftCommandService.java:1)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:225)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.concurrent.TimeoutException: Timed out(5000 milliseconds) waiting for operation while connected to 192.168.3.101:12000
at net.rubyeye.xmemcached.XMemcachedClient.latchWait(XMemcachedClient.java:2536)
at net.rubyeye.xmemcached.XMemcachedClient.fetch0(XMemcachedClient.java:644)
at net.rubyeye.xmemcached.XMemcachedClient.get0(XMemcachedClient.java:1058)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1016)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1027)
at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1049)
at com.palmcity.memached.MemcacheManager.get(MemcacheManager.java:406)
... 10 more
多谢,是使用Builder来创建client,目前已经来回调整了配置,继续观察情况。