Skip to content

Commit 01f008d

Browse files
docs(developer): Add ddev debug section about redis and memcached
1 parent c84b85d commit 01f008d

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/DEVELOPER.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,51 @@ cp .ddev/config_overrides/config.crowdsec.yaml .ddev/config.crowdsec.yaml
349349
ddev restart
350350
```
351351

352+
#### Redis debug
353+
354+
You should enter the `Redis` container:
355+
356+
```bash
357+
ddev exec -s redis redis-cli
358+
```
359+
360+
Then, you could play with the `redis-cli` command line tool:
361+
362+
- Display keys and databases: `INFO keyspace`
363+
364+
- Display stored keys: `KEYS *`
365+
366+
- Display key value: `GET [key]`
367+
368+
- Remove a key: `DEL [key]`
369+
370+
#### Memcached debug
371+
372+
@see https://lzone.de/cheat-sheet/memcached
373+
374+
First, find the IP of the `Memcached` container:
375+
376+
```bash
377+
ddev find-ip memcached
378+
```
379+
380+
Then, you could use `telnet` to interact with memcached:
381+
382+
```
383+
telnet <MEMCACHED_IP> 11211
384+
```
385+
386+
- `stats`
387+
388+
- `stats items`: The first number after `items` is the slab id. Request a cache dump for each slab id, with a limit for
389+
the max number of keys to dump:
390+
391+
- `stats cachedump 2 100`
392+
393+
- `get <mykey>` : Read a value
394+
395+
- `delete <mykey>`: Delete a key
396+
352397

353398
## Quick start guide
354399

0 commit comments

Comments
 (0)