1

有效负载大小 291KB

放置 = 500 键

Get = 40000(在相同的 500 个键上,即每个键 80 个)50 个线程

放置速度很快

但是获取速度很慢

PUT STATS LongSummaryStatistics{count=500, sum=151, min=0, average=0.302000, max=41} GET STATS LongSummaryStatistics{count=40000, sum=4492495, min=0, average=112.312375, max=1393}

<ehcache:cache alias="30">
        <ehcache:key-type>java.lang.String</ehcache:key-type>
        <ehcache:value-type>byte[]</ehcache:value-type>
        <ehcache:expiry>
            <ehcache:tti unit="seconds">1800</ehcache:tti>
        </ehcache:expiry>
        <ehcache:resources>
            <ehcache:heap unit="entries">5</ehcache:heap>
            <ehcache:offheap unit="MB">5</ehcache:offheap>
            <ehcache:disk persistent="false" unit="MB">320</ehcache:disk>
        </ehcache:resources>
        <ehcache:disk-store-settings thread-pool="cache2Pool" writer-concurrency="2"/>

        </ehcache:cache>

多个线程卡在这个位置

"getter-47" #89 prio=5 os_prio=31 tid=0x00007fb6a0984000 nid=0xab03 waiting for monitor entry [0x0000700010268000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.ehcache.impl.internal.concurrent.ConcurrentHashMap.computeIfPresent(ConcurrentHashMap.java:1839)
        - waiting to lock <0x000000079c2f2ff8> (a org.ehcache.impl.internal.concurrent.ConcurrentHashMap$Node)
        at org.ehcache.impl.internal.store.heap.SimpleBackend.computeIfPresent(SimpleBackend.java:130)
        at org.ehcache.impl.internal.store.heap.OnHeapStore.evict(OnHeapStore.java:1589)
        at org.ehcache.impl.internal.store.heap.OnHeapStore.enforceCapacity(OnHeapStore.java:1556)
        at org.ehcache.impl.internal.store.heap.OnHeapStore.resolveFault(OnHeapStore.java:787)
        at org.ehcache.impl.internal.store.heap.OnHeapStore.getOrComputeIfAbsent(OnHeapStore.java:707)
        at org.ehcache.impl.internal.store.tiering.CompoundCachingTier.getOrComputeIfAbsent(CompoundCachingTier.java:102)
        at org.ehcache.impl.internal.store.tiering.TieredStore.get(TieredStore.java:87)
        at org.ehcache.core.Ehcache.doGet(Ehcache.java:90)
        at org.ehcache.core.EhcacheBase.get(EhcacheBase.java:127)
        

我知道磁盘访问速度很慢,但我使用的是 SSD,预计平均约为 35 毫秒。

4

0 回答 0