Closed GoogleCodeExporter closed 9 years ago
将你的xml配置贴出来,我估计是你设置了太大的连接池了
Original comment by killme2...@gmail.com
on 29 Jun 2012 at 4:57
<bean name="memcachedClientBuilder"
class="net.rubyeye.xmemcached.XMemcachedClientBuilder">
<constructor-arg>
<list>
<bean class="java.net.InetSocketAddress">
<constructor-arg>
<value>192.168.1.24</value>
</constructor-arg>
<constructor-arg>
<value>12000</value>
</constructor-arg>
</bean>
<bean class="java.net.InetSocketAddress">
<constructor-arg>
<value>192.168.1.88</value>
</constructor-arg>
<constructor-arg>
<value>12000</value>
</constructor-arg>
</bean>
</list>
</constructor-arg>
<constructor-arg>
<list>
<value>1</value>
<value>2</value>
</list>
</constructor-arg>
<!-- <property name="authInfoMap"> <map> <entry key-ref="server1"> <bean
class="net.rubyeye.xmemcached.auth.AuthInfo" factory-method="typical"> <constructor-arg
index="0"> <value>cacheuser</value> </constructor-arg> <constructor-arg index="1">
<value>123456</value> </constructor-arg> </bean> </entry> </map> </property> -->
<!-- nio connection pool size -->
<property name="connectionPoolSize" value="5"></property>
<!-- Use binary protocol,default is TextCommandFactory -->
<property name="commandFactory">
<bean class="net.rubyeye.xmemcached.command.TextCommandFactory"></bean>
</property>
<property name="sessionLocator">
<bean class="net.rubyeye.xmemcached.impl.KetamaMemcachedSessionLocator"></bean>
</property>
<property name="transcoder">
<bean class="net.rubyeye.xmemcached.transcoders.SerializingTranscoder" />
</property>
<property name="bufferAllocator">
<bean class="net.rubyeye.xmemcached.buffer.SimpleBufferAllocator"></bean>
</property>
</bean>
<bean name="memcachedClient" class="net.rubyeye.xmemcached.MemcachedClient" factory-bean="memcachedClientBuilder"
factory-method="build" destroy-method="shutdown" />
对了memcached那边我用了magent做代理
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 5:00
<property name="connectionPoolSize" value="5"></property>
将它设置1试试,并且设置opTimeout达到3000左右,1000通常来说��
�不够的,测试还是可以。
Original comment by killme2...@gmail.com
on 29 Jun 2012 at 5:08
还是一样
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 5:16
郁闷,我重启下magent就Ok了,会是什么原因呢?
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 5:21
而当我尝试不同的操作时也会经常报这个错,需要重启magent
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 5:26
我不知道什么是magent。这个的意思是操作超时了,默认是1秒�
��时,你有设置opTImeout到3000,也就是3秒吗?
Original comment by killme2...@gmail.com
on 29 Jun 2012 at 5:28
设置了,设置多少都没有,magent就是个memcached的代理罗https://
code.google.com/p/memagent/
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 5:35
你设置成多少,我看看,怎么设置的,不可能没用的。
Original comment by killme2...@gmail.com
on 29 Jun 2012 at 5:48
memcachedClient.setOpTimeout(3000);
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 5:58
那只能说你的数据是不是太大,或者magent有没有什么问题,��
�致经常超时。可以将这个时间调长,或者直接链接memcached看�
��。
Original comment by killme2...@gmail.com
on 29 Jun 2012 at 6:03
确实去掉magent就没问题了,我想请问下如果不用magent,怎么��
�现memcached的负载均衡和单点故障?又或者在xmemcached里已有相
关解决方案?
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 6:19
搜索memcached proxy,选择很多吧。
不过memcached的分布一般也都是在客户端做,一般都不搞proxy。
当然,代价就是缓冲命中率在故障时候下降。
Original comment by killme2...@gmail.com
on 29 Jun 2012 at 6:22
多谢
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 8:13
我改了用twitter的twemproxy做proxy,一次操作也没成功过,一直��
�是java.util.concurrent.TimeoutException,郁闷
Original comment by sw5201...@gmail.com
on 29 Jun 2012 at 9:46
Original comment by killme2...@gmail.com
on 16 Jul 2012 at 11:49
Original issue reported on code.google.com by
sw5201...@gmail.com
on 29 Jun 2012 at 4:56