Skip to content

Implement ContainerPilot telemetry #3

Open
@misterbisson

Description

@misterbisson

ContainerPilot 2.0 introduced a telemetry feature that would be very useful for monitoring this application.

The system's free RAM as a decimal from 0-1 (excluding filesystem buffers and cache):

echo "scale=2; ( $(free -m | awk '/Mem/{print $3}') - $(free -m | awk '/Mem/{print $6}') - $(free -m | awk '/Mem/{print $7}') ) / $(free -m | awk '/Mem/{print $2}')" | bc

EDIT: this is much shorter and probably more efficient:

free -m | awk 'NR==2 {printf("%.2f\n", ($3 - $6 - $7) / $2 )}'

More specific stats can be found from Memcached itself:

$ echo stats | nc 127.0.0.1 11211 
STAT pid 1222
STAT uptime 11066484
STAT time 1460951850
STAT version 1.4.4
STAT pointer_size 64
STAT rusage_user 18140.265260
STAT rusage_system 36461.835958
STAT curr_connections 24
STAT total_connections 91434
STAT connection_structures 182
STAT cmd_get 694913325
STAT cmd_set 757666708
STAT cmd_flush 0
STAT get_hits 599513796
STAT get_misses 95399529
STAT delete_misses 13041164
STAT delete_hits 429308
STAT incr_misses 0
STAT incr_hits 16047
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 486625034028
STAT bytes_written 1339052653983
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 60768161
STAT curr_items 58347
STAT total_items 190874836
STAT evictions 167781776
END

From those, these items look most promising

  • bytes / limit_maxbytes
  • evictions (which is an internal counter, but would need to be presented as a gauge...or turned into a more useful counter)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions