我们有一个单线程 Java 进程,它将消息写入编年史队列。队列 ( SingleChronicleQueue ) 配置有 RollCycle HOURLY。在每小时标记处,当文件滚动发生时,编年史写入需要超过一秒(通常为 1-2 秒),这似乎发生在更大的文件大小(~50-90 GB)上。我们使用的是 4.5.x 编年史队列版本。关于如何解决这个问题的任何想法?
我使用 jstack 工具进行了线程转储,以查看线程卡在哪里。
at sun.nio.ch.FileChannelImpl.unmap0(Native Method)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.openhft.chronicle.core.OS.unmap(OS.java:345)
at net.openhft.chronicle.core.OS$Unmapper.run(OS.java:434)
at sun.misc.Cleaner.clean(Cleaner.java:143)
at net.openhft.chronicle.bytes.NativeBytesStore.performRelease(NativeBytesStore.java:501)
at net.openhft.chronicle.bytes.NativeBytesStore$$Lambda$68/1804441305.run(Unknown Source)
at net.openhft.chronicle.core.ReferenceCounter.release(ReferenceCounter.java:81)
at net.openhft.chronicle.bytes.NativeBytesStore.release(NativeBytesStore.java:265)
at net.openhft.chronicle.bytes.MappedFile.performRelease(MappedFile.java:296)
at net.openhft.chronicle.bytes.MappedFile$$Lambda$63/90346768.run(Unknown Source)
at net.openhft.chronicle.core.ReferenceCounter.release(ReferenceCounter.java:81)
at net.openhft.chronicle.bytes.MappedFile.release(MappedFile.java:277)
at net.openhft.chronicle.bytes.MappedBytes.performRelease(MappedBytes.java:209)
at net.openhft.chronicle.bytes.AbstractBytes$$Lambda$65/18179709.run(Unknown Source)
at net.openhft.chronicle.core.ReferenceCounter.release(ReferenceCounter.java:81)
at net.openhft.chronicle.bytes.AbstractBytes.release(AbstractBytes.java:395)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.resetWires(SingleChronicleQueueExcerpts.java:233)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.setCycle2(SingleChronicleQueueExcerpts.java:210)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.rollCycleTo(SingleChronicleQueueExcerpts.java:579)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.writingDocument(SingleChronicleQueueExcerpts.java:273)
at net.openhft.chronicle.wire.MarshallableOut.writingDocument(MarshallableOut.java:55)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.writeBytes(SingleChronicleQueueExcerpts.java:117)