You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -452,11 +439,7 @@ async function runExample() {
452
439
runExample().catch(console.error);
453
440
```
454
441
455
-
The application writes keys in the format `foo<number>` with their corresponding numeric values, using batched `MSET` operations for better performance. The `MSET` command accepts an array of alternating keys and values. So if you run the program the result is batches of `MSET` commands:
The application writes keys in the format `foo<number>` with their corresponding numeric values using individual `SET` operations. This approach ensures compatibility with cluster deployments where keys may be distributed across different nodes based on their hash slots.
460
443
461
444
The program includes comprehensive error handling to display errors instead of
462
445
crashing, so all cluster operations are wrapped in try-catch blocks.
@@ -476,12 +459,7 @@ The **counter initialization section** reads a counter so that when we restart t
476
459
we don't start again with `foo0`, but continue from where we left off.
477
460
The counter is stored in Valkey itself using the key `__last__`.
478
461
479
-
The **main processing loop** sets keys in batches using `MSET` operations
480
-
for better performance, processing 100 keys at a time and displaying progress or
481
-
any errors that occur.
482
-
you'll get the usually 10k ops/second in the best of the conditions).
483
-
484
-
you'll get optimal performance).
462
+
The **main processing loop** sets keys sequentially using individual `SET` operations, updating progress every 1000 keys and displaying any errors that occur.
485
463
486
464
Starting the application produces the following output:
0 commit comments