读取时CPU使用率很高

时间:2013-07-25 14:32:48

标签: cassandra

我正在使用cassandra 1.2.5,在群集中有4个节点。每个节点为m1.large,系统内存为8GB。对我们来说,阅读会更多。我的列族中有50,000行。当我尝试从该列族读取数据时,每次node3或node4 cpu使用率都很高。我已经给出了下面的日志。

对于这个问题,我们可以将LeveledCompactionStrategy和sstable_size_in_mb的压缩策略设置为10。这会有帮助吗?

还有其他解决办法吗?

日志:

 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,660 StatusLogger.java (line 95) Cache Type                     Size                 Capacity               KeysToSave                                                         Provider
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,660 StatusLogger.java (line 96) KeyCache                   18523284                 52428800                      all      
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,661 StatusLogger.java (line 102) RowCache                          0               1073741824                      all              org.apache.cassandra.cache.SerializingCacheProvider
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,661 StatusLogger.java (line 109) ColumnFamily                Memtable ops,data
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,661 StatusLogger.java (line 112) system.local                              0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,661 StatusLogger.java (line 112) system.peers                          60,8040
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,662 StatusLogger.java (line 112) system.batchlog                           0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,671 StatusLogger.java (line 112) system.NodeIdInfo                         0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,671 StatusLogger.java (line 112) system.LocationInfo                       0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,671 StatusLogger.java (line 112) system.Schema                             0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,671 StatusLogger.java (line 112) system.Migrations                         0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,672 StatusLogger.java (line 112) system.schema_keyspaces                 8,251
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,672 StatusLogger.java (line 112) system.schema_columns               332,21903
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,672 StatusLogger.java (line 112) system.schema_columnfamilies           352,21775
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,672 StatusLogger.java (line 112) system.IndexInfo                          0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,672 StatusLogger.java (line 112) system.range_xfers                        0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,673 StatusLogger.java (line 112) system.peer_events                        0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,673 StatusLogger.java (line 112) system.hints                              0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,673 StatusLogger.java (line 112) system.HintsColumnFamily                  0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,673 StatusLogger.java (line 112) GEN_GEN.feedserver_dependentFeeds                 0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,673 StatusLogger.java (line 112) GEN_GEN.feedserver_componentName       18648,1048576
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,674 StatusLogger.java (line 112) GEN_GEN.feedserver_FeedScheduler      128952,2097152
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,739 StatusLogger.java (line 112) GEN_GEN.feedserver_feedType                 0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,739 StatusLogger.java (line 112) GEN_GEN.feedserver_itemDef                 0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,739 StatusLogger.java (line 112) GEN_GEN.feedserver_Feed         66629,2097152
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,740 StatusLogger.java (line 112) system_auth.users                         0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,740 StatusLogger.java (line 112) OpsCenter.events                          0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,740 StatusLogger.java (line 112) OpsCenter.rollups60                       0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,740 StatusLogger.java (line 112) OpsCenter.settings                        0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,740 StatusLogger.java (line 112) OpsCenter.pdps                            0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,741 StatusLogger.java (line 112) OpsCenter.rollups86400                    0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,741 StatusLogger.java (line 112) OpsCenter.events_timeline                 0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,741 StatusLogger.java (line 112) OpsCenter.rollups300                      0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,741 StatusLogger.java (line 112) OpsCenter.rollups7200                     0,0
 INFO [ScheduledTasks:1] 2013-07-25 12:59:04,741 StatusLogger.java (line 112) system_traces.sessions                    0,0

1 个答案:

答案 0 :(得分:1)

如果您在阅读过程中看到内存压力,您可能会一次读取太多行。跟踪请求可以更清楚地了解正在发生的事情:http://www.datastax.com/dev/blog/tracing-in-cassandra-1-2