dice icon indicating copy to clipboard operation
dice copied to clipboard

Support for DEBUG POPULATE & INFO command

Open rohanverma94 opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

Since DiceDB is not TELNET compatible, in order to send the command, one has to serialize the commands as per RESP spec and then send it over the wire. Thus, sending the commands for mass insertion or deletion becomes a high labor task for a mere performance or diagnostics test. A workaround is to use any redis-compatible language driver and perform the operation. However, the latter solution is external to DB and introduces the side effects and non-conforming delays even on loopback interface. Another problem is related to the monitoring since we are already based on event loops i.e. a kernel space operation, hence attaching debug probes/breakpoints in code that is in userspace doesn't really help to know the behavior of DB with respect to various memory footprints such as network, spikes during insertions, etc.

Describe the solution you'd like For the first problem. the solution I propose is to introduce a DEBUG POPULATE command, which doesn't have to cross any network boundaries to generate keys for any diagnostics test.

This should work as follows-

DEBUG POPULATE <number-of-keys-to-generate> <key-size-in-bytes>

for instance, the below command should generate 3 million keys with 2kb string or integer keys

DEBUG POPULATE 3000000 2000

For the second problem, I propose INFO command. Below should provide info on all buffers related to Networking

INFO network

The same way, below should provide statistics on keys, how many are dirty, expired, and peak memory, committed (AOF), etc.

INFO store

Describe alternatives you've considered For key generations - Redis-compatible drivers. For INFO - debug probes and profilers

Additional context Why all this hard work, can't we use alternatives? Because printf() is the best debugger on the planet!!

rohanverma94 avatar Oct 29 '22 20:10 rohanverma94