You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
27 lines
600 B
JavaScript
27 lines
600 B
JavaScript
import { createClient } from '@redis/client';
|
|
import { setTimeout } from 'node:timers/promises';
|
|
|
|
const client = createClient();
|
|
client.on('error', err => console.error(err));
|
|
|
|
await client.connect();
|
|
|
|
await client.set('key', 'a'.repeat(1_000));
|
|
|
|
throw 'a';
|
|
|
|
while (true) {
|
|
const promises = [];
|
|
for (let i = 0; i < 20_000; i++) {
|
|
promises.push(client.sendCommand(['HMSET', `aa${i.toString()}`, 'txt1', Math.random().toString()]));
|
|
}
|
|
|
|
await Promise.all(promises);
|
|
console.log(
|
|
await client.dbSize(),
|
|
(await client.info('MEMORY')).split('\n')[1]
|
|
);
|
|
|
|
await setTimeout(1000);
|
|
}
|