我的 Cassandra 线程之一占用了我 100% 的 CPU。我不知道这个线程做了什么,也不知道它为什么会满负荷运行?我应该给它更多资源还是减少数据大小等?您可以在线程 ID 14809 中看到这一点。
我附上了我的 Htop 输出。
谢谢你的帮助。
编辑:
我重新启动了服务器,所以上面的线程 ID 可能与下面的线程堆栈不同,但线程是相同的。这是我相关的线程堆栈:
Attaching to process ID 6364, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.102-b14
Deadlock Detection:
No deadlocks found.
Thread 9955: (state = IN_JAVA)
- java.util.HashMap$HashIterator.nextNode() @bci=95, line=1441 (Compiled frame; information may be imprecise)
- java.util.HashMap$KeyIterator.next() @bci=1, line=1461 (Compiled frame)
- com.google.common.collect.Iterators$3.next() @bci=4, line=163 (Compiled frame)
- java.util.AbstractCollection.contains(java.lang.Object) @bci=40, line=106 (Compiled frame)
- com.google.common.base.Predicates$InPredicate.apply(java.lang.Object) @bci=5, line=497 (Compiled frame)
- com.google.common.base.Predicates$NotPredicate.apply(java.lang.Object) @bci=5, line=312 (Compiled frame)
- com.google.common.base.Predicates$CompositionPredicate.apply(java.lang.Object) @bci=14, line=536 (Compiled frame)
- com.google.common.collect.Iterators$7.computeNext() @bci=27, line=647 (Compiled frame)
- com.google.common.collect.AbstractIterator.tryToComputeNext() @bci=9, line=143 (Compiled frame)
- com.google.common.collect.AbstractIterator.hasNext() @bci=61, line=138 (Compiled frame)
- com.google.common.collect.TransformedIterator.hasNext() @bci=4, line=43 (Compiled frame)
- java.util.AbstractCollection.addAll(java.util.Collection) @bci=10, line=343 (Compiled frame)
- java.util.HashSet.<init>(java.util.Collection) @bci=10, line=118 (Compiled frame)
- com.google.common.collect.Sets.newHashSet(java.lang.Iterable) @bci=15, line=218 (Interpreted frame)
- com.datastax.bdp.hadoop.cfs.compaction.CFSCompactionStrategy.removeKeys(java.lang.Iterable) @bci=116, line=337 (Interpreted frame)
- com.datastax.bdp.hadoop.cfs.compaction.CFSCompactionStrategy.add(org.apache.cassandra.io.sstable.SSTableReader, boolean) @bci=81, line=293 (Compiled frame)
- com.datastax.bdp.hadoop.cfs.compaction.CFSCompactionStrategy.handleNotification(org.apache.cassandra.notifications.INotification, java.lang.Object) @bci=18, line=227 (Interpreted frame)
- org.apache.cassandra.db.DataTracker.notifyAdded(org.apache.cassandra.io.sstable.SSTableReader) @bci=43, line=531 (Interpreted frame)
- org.apache.cassandra.db.DataTracker.replaceFlushed(org.apache.cassandra.db.Memtable, org.apache.cassandra.io.sstable.SSTableReader) @bci=130, line=179 (Interpreted frame)
- org.apache.cassandra.db.compaction.AbstractCompactionStrategy.replaceFlushed(org.apache.cassandra.db.Memtable, org.apache.cassandra.io.sstable.SSTableReader) @bci=9, line=234 (Interpreted frame)
- org.apache.cassandra.db.ColumnFamilyStore.replaceFlushed(org.apache.cassandra.db.Memtable, org.apache.cassandra.io.sstable.SSTableReader) @bci=6, line=1540 (Interpreted frame)
- org.apache.cassandra.db.Memtable$FlushRunnable.runMayThrow() @bci=73, line=336 (Interpreted frame)
- org.apache.cassandra.utils.WrappedRunnable.run() @bci=1, line=28 (Interpreted frame)
- com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(java.lang.Runnable) @bci=5, line=297 (Interpreted frame)
- org.apache.cassandra.db.ColumnFamilyStore$Flush.run() @bci=163, line=1134 (Interpreted frame)
- java.util.concurrent.Executors$RunnableAdapter.call() @bci=4, line=511 (Compiled frame)
- java.util.concurrent.FutureTask.run() @bci=42, line=266 (Compiled frame)
- java.util.concurrent.Executors$RunnableAdapter.call() @bci=4, line=511 (Compiled frame)
- java.util.concurrent.FutureTask.run() @bci=42, line=266 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=745 (Compiled frame)