show cache
Show cache status.
Description
Query the Runtime API with show cache
to display cache information.
Examples
Create a cache in your HAProxy Enterprise config file and attach the cache to a backend:
cache mycache
total-max-size 4095 # MB
max-object-size 10000 # bytes
max-age 30 # seconds
backend be_api
# Get from cache / put in cache
http-request cache-use mycache
http-response cache-store mycache
# server list
server s1 172.25.0.10:8080 check
Use socat
to query the HAProxy Enterprise Runtime API:
$ echo "show cache" | \
sudo socat stdio unix-connect:/var/run/hapee-2.0/hapee-lb.sock
0x7fcad7c9603a: api_cache (shctx:0x7fcad7c96000, available blocks:4193280)
0x7fcad7c960c0 hash:3075548050 size:363 (1 blocks), refcount:0, expire:10
These two lines of output are explained in the tables below.
The first line breaks down as follows:
0x7fcad7c9603a: api_cache (shctx:0x7fcad7c96000, available blocks:4193280)
Output | Description |
---|---|
| pointer to the cache structure |
| cache name |
| pointer to the mmap area (shctx) |
| number of blocks available for reuse in the shctx |
The second line of output breaks down as:
0x7fcad7c960c0 hash:3075548050 size:363 (1 blocks), refcount:0, expire:10
Output | Description |
---|---|
| pointer to the cache entry |
| first 32 bits of the hash |
| size of the object in bytes |
| number of blocks used for the object |
| number of transactions using the entry |
| expiration time, can be negative if already expired |
See also
Next up
show cli level