Description:
This is a module for amxmodx that allows operations from HLDS to the Redis data store.
Required:
Data store server application supporting Redis protocol.
- Redis
- Valkey
- KeyDB
- Microsoft Garnet
- DragonflyDB
Usage for plugins:
This is in its infancy and there are few functions available at this time.
You must also build the module yourself.
See
https://github.com/AoiKagase/Amxx-Module-Redis
A little test:
I took a simple benchmark using Redis.
In one cycle, I did a SET/GET/DEL against a hash table and processed 100,000 cases.
The result was 14 seconds, or 0.00014 per cycle.
Needless to say, since we ran 100,000 cycles in FOR logic, the CPU usage was 100% during that time.
PHP Code:
server_print("[REDIS] BENCHMARK START");
new start = get_systime();
new iResult = 0;
for (new i = 0; i < 100000; i++)
{
redis_hset_integer("REDIS_TEST_HASH", "INTEGER", i);
iResult = redis_hget_integer("REDIS_TEST_HASH", "INTEGER");
redis_hdel_field("REDIS_TEST_HASH", "INTEGER");
// server_print("[REDIS] %d", iResult);
}
new bench = get_systime() - start;
server_print("[REDIS] %d", iResult);
server_print("[REDIS] BENCHMARK %d SEC", bench);
Code:
[REDIS] BENCHMARK START
[REDIS] 99999
[REDIS] BENCHMARK 14 SEC
__________________