【发布时间】:2013-06-27 14:14:44
【问题描述】:
我们目前正在使用ab 工具进行一些压力测试。单个插入在 cassandra 中运行良好。但是,当涉及到批量插入时,我目前正在处理 java 内存不足错误:Java Heap Space。
我有一台安装了 Ubuntu 服务器 13.04 的虚拟机,内存为 2G
我对cassandra的内部配置了解不多。
我只是在做一个大小为 100 的批量插入(在 BATCH 中插入 100 个)。
在我看到这个错误之后,我不再有 cqlsh 访问权限,几乎 1 小时都没有 nodetool 访问权限。
如何在重载时修复此错误?
注意:在带有 HTTP POST 请求的单个插入中不会发生这种情况。
注意:在我的列族中,我有一个 TimeUUIDType 键,列值为 int s 和 varchar s
更新:测试结果显示在 6000 个请求之前我没有任何问题。但是,当涉及到 7000 时,php 代码会抛出以下内容;
Error connecting to 127.0.0.1: Thrift\Exception\TTransportException: TSocket: timed out reading 4 bytes from 127.0.0.1:9160
此外,cassandra 会在繁重的负载中记录以下内容;
WARN [ScheduledTasks:1] 2013-06-28 03:43:07,931 GCInspector.java (line 142)
Heap is 0.9231763795560355 full. You may need to reduce memtable and/or cache sizes.
Cassandra will now flush up to the two largest memtables to free up memory. Adjust
flush_largest_memtables_at threshold in cassandra.yaml if you don't want Cassandra to
do this automatically
【问题讨论】:
-
虚拟机上的JVM好像有问题,你给它分配了多少内存?
-
@LyubenTodorov 我在哪里可以知道 jvm 使用了多少?是用
cassandra-env.sh写的吗? -
检查我的更新,但是它在
cassandra-env.sh!