jboss42 / hibernate-memcached

Automatically exported from code.google.com/p/hibernate-memcached
0 stars 0 forks source link

So many Threads waiting for the get method #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I catch some problems recently. Our website come very slowly in pick time
and i dump the jvm and find there have hundreds of Thread in
TIMED_WAITING(parking) status. the cpu and memory usaged is not very high.
Here is the detail information:

 "ActiveMQ Session Task" prio=10 tid=0x00002aabbd798800 nid=0x6f63 waiting
on condition [0x000000006aa60000..0x000000006aa60d90]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00002aaac5385f20> (a
java.util.concurrent.CountDownLatch$Sync)
        at
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
        at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(Abstr
actQueuedSynchronizer.java:947)
        at
java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(Abst
ractQueuedSynchronizer.java:1239)
        at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:253)
        at
net.spy.memcached.MemcachedClient$OperationFuture.get(MemcachedClient.java:1486)
        at
net.spy.memcached.MemcachedClient$GetFuture.get(MemcachedClient.java:1539)
        at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:758)
        at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:778)
        at
com.googlecode.hibernate.memcached.spymemcached.SpyMemcache.get(SpyMemcache.java
:29)
        at
com.googlecode.hibernate.memcached.MemcachedCache.memcacheGet(MemcachedCache.jav
a:124)
        at
com.googlecode.hibernate.memcached.MemcachedCache.get(MemcachedCache.java:153)
        at
org.hibernate.cache.NonstrictReadWriteCache.get(NonstrictReadWriteCache.java:69)
        at
org.hibernate.cache.impl.bridge.EntityAccessStrategyAdapter.get(EntityAccessStra
tegyAdapter.java:55)
        at
org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(Defaul
tLoadEventListener.java:524)
        at
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener
.java:397)
        at
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.j
ava:165)
        at
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventLis
tener.java:223)
        at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener
.java:126)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:835)
        at
com.crushorflush.service.notification.serializer.HibernateEntitySerializer.unSer
ialize(HibernateEntitySerializer.java:32)
        at
com.crushorflush.service.notification.impl.activemq.ActiveMQManager.notifyListen
ers(ActiveMQManager.java:156)
        at
com.crushorflush.service.notification.impl.activemq.ActiveMQLoginAgent$1.onMessa
ge(ActiveMQLoginAgent.java:70)
        at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.jav
a:1021)
        - locked <0x00002aab4a084a78> (a java.lang.Object)
        at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.jav
a:122)
        at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java
:192)
        at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
        at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8
86)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

So we need to restart the web servers and then it works well. It happens
some times every several days.

  I use the Hibernate-memcached 1.1.0 and with memcached 1.2.6 in Red Hat
Enterprise Linux Server release 5.3 (Tikanga). The JDK is 1.6.0_11.
  I check the source code and have no idea what's happened. It worked well
for a long time.
  does anyone else catch the same problem? or have any comments on that?
  Thanks very much.

Hogan

Original issue reported on code.google.com by hoga...@gmail.com on 14 Sep 2009 at 7:33

GoogleCodeExporter commented 9 years ago
the configration in the hibernate.properties as follows:
 hibernate.cache.use_second_level_cache true
 hibernate.cache.provider_class com.googlecode.hibernate.memcached.MemcachedCacheProvider
 ibernate.memcached.servers localhost:11211
hibernate.memcached.cacheTimeSeconds  3000
hibernate.memcached.keyStrategy 
com.googlecode.hibernate.memcached.Md5KeyStrategy
#hibernate.memcached.readBufferSize      16384
#hibernate.memcached.operationQueueLength 16384
hibernate.memcached.operationTimeout 500
#hibernate.memcached.hashAlgorithm KETAMA_HASH
#hibernate.memcached.clearSupported false
#hibernate.memcached.[region-name].cacheTimeSeconds 
#hibernate.memcached.[region-name].keyStrategy
#hibernate.memcached.[region-name].clearSupported
#hibernate.memcached.dogpilePrevention  true
#hibernate.memcached.dogpilePrevention.expirationFactor 2

Original comment by hoga...@gmail.com on 14 Sep 2009 at 7:34

GoogleCodeExporter commented 9 years ago
You should open this up on the spymemcached project.
http://code.google.com/p/spymemcached/

I'm not sure what the issue here would be.

Original comment by raykrue...@gmail.com on 14 Sep 2009 at 2:41

GoogleCodeExporter commented 9 years ago
thanks raykrueger, I will post this problem to the spymemcached project.

Hogan

Original comment by hoga...@gmail.com on 15 Sep 2009 at 1:31

GoogleCodeExporter commented 9 years ago

Original comment by raykrue...@gmail.com on 6 Apr 2011 at 5:04