Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 PHP Redis ( Predis ) 中执行此查询:
for ($i=0; $i < 10000000; $i++) { $client->SADD('key:'.$i, $i); }
这段代码需要很长时间,但它不应该耗尽内存,此外,我已经编辑了我的php.ini文件并更改memory_limit为5000M!
php.ini
memory_limit
5000M
但是,在更改之后,我仍然收到此错误:
致命错误:允许的内存大小 xxxxxxxxxxxx 已用尽。
Redis 是内存存储中的一个键值,即它使用 ram 来存储。您更改了 php 而不是 Redis 的内存限制。该 sadd 功能正在添加到 Redis。尝试查找Redis如何使用ram进行存储