5

我有一个包含 1 亿个字符串的列表,每行一个。文件大小为 1.66 Gb。每个字符串大约 20 个字符长。

我开始将数据插入到小实例中并得到最大内存错误。那时只插入了 100 万条记录。

Micro
Micro Cache Node (cache.t1.micro): 213 MB memory, Up to 2 ECU (for short periodic bursts), 64-bit platform, Low I/O Capacity
Standard
Small Cache Node (cache.m1.small): 1.3 GB memory, 1 ECU (1 virtual core with 1 ECU), 64-bit platform, Moderate I/O Capacity
Medium Cache Node (cache.m1.medium): 3.35 GB memory, 2 ECU (1 virtual core with 2 ECUs), 64-bit platform, Moderate I/O Capacity
Large Cache Node (cache.m1.large): 7.1 GB memory, 4 ECUs (2 virtual cores with 2 ECUs each), 64-bit platform, High I/O Capacity
Extra Large Cache Node (cache.m1.xlarge): 14.6 GB of memory, 8 ECUs (4 virtual cores with 2 ECUs each), 64-bit platform, High I/O Capacity

一个小的缓存节点是否能够存储数据,或者我会用完空间吗?如何计算一个实例可以处理的记录数?

4

2 回答 2

3

据此:http ://redis.io/topics/faq

当你有很多小键时,它会使用 5-6 倍于存储在 redis 中的数据大小的内存。

您可能需要大约 8-10 GB 的内存来存储您的数据集。这将限制您使用 cache.m1.xlarge。

于 2014-03-30T02:09:01.213 回答
3

2^32 键

等于 4,294,967,296。基本上你应该说需要多少内存来保存这么多数据!平均而言,每个键有 8 个字符将占用 32GB 内存!与值的大小相加,您将需要很多!

来源:https ://redis.io/topics/faq

于 2020-02-17T13:43:18.620 回答