[
https://issues.apache.org/jira/browse/CASSANDRA-11571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15246352#comment-15246352
]
Dikang Gu commented on CASSANDRA-11571:
---------------------------------------
[~krummas], this patch works well in our production, what do you think of it?
> Optimize the overlapping lookup, by calculating all the bounds in advance.
> --------------------------------------------------------------------------
>
> Key: CASSANDRA-11571
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11571
> Project: Cassandra
> Issue Type: Improvement
> Components: Compaction
> Reporter: Dikang Gu
> Assignee: Dikang Gu
> Fix For: 3.x
>
> Attachments:
> 0001-Optimize-the-overlapping-lookup-by-calculating-all-t.patch
>
>
> When L0 sstable backs up (because of repair or other reasons), I find that a
> lot of CPU is using to construct the Bounds.
> {code}
> "CompactionExecutor:223" #1557 daemon prio=1 os_prio=4 tid=0x00007f88f401d800
> nid=0x2303ab runnable [0x00007f824d735000]
> java.lang.Thread.State: RUNNABLE
> at
> org.apache.cassandra.dht.AbstractBounds.strictlyWrapsAround(AbstractBounds.java:86)
> at org.apache.cassandra.dht.Bounds.<init>(Bounds.java:44)
> at
> org.apache.cassandra.db.compaction.LeveledManifest.overlapping(LeveledManifest.java:533)
> at
> org.apache.cassandra.db.compaction.LeveledManifest.overlapping(LeveledManifest.java:520)
> at
> org.apache.cassandra.db.compaction.LeveledManifest.getCandidatesFor(LeveledManifest.java:595)
> at
> org.apache.cassandra.db.compaction.LeveledManifest.getCompactionCandidates(LeveledManifest.java:349)
> - locked <0x00007f8e11e67900> (a
> org.apache.cassandra.db.compaction.LeveledManifest)
> at
> org.apache.cassandra.db.compaction.LeveledCompactionStrategy.getNextBackgroundTask(LeveledCompactionStrategy.java:97)
> - locked <0x00007f8e11b1d780> (a
> org.apache.cassandra.db.compaction.LeveledCompactionStrategy)
> at
> org.apache.cassandra.db.compaction.WrappingCompactionStrategy.getNextBackgroundTask(WrappingCompactionStrategy.java:78)
> - locked <0x00007f8e110931a0> (a
> org.apache.cassandra.db.compaction.WrappingCompactionStrategy)
> at
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionCandidate.run(CompactionManager.java:250)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> From the code, we may construct the bounds multiply times, my patch optimizes
> it by calculating it in advance.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)