twemproxy, aka nutcracker is a fast and lightweight proxy for memcached and redis protocol. It reduces the number of connections to the caching servers on the backend. This, together with protocol pipelining and sharding enables you to horizontally scale your distributed caching architecture.

Prerequisite

For Virtual machines, install the Linux agent.

Configuring the credentials

Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml

twemproxy:
- name: twemproxy
  user: <username>
  pwd: <Password>
  encoding-type: plain
  labels:
    key1: val1
    key2: val2
  

Configuring the application

Virtual machine

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml

- name: twemproxy
  instance-checks:
    service-check:
      - nutcracker
    process-check:
      - nutcracker
    port-check:
      - 22222
  

Docker environment

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml

- name: twemproxy
  container-checks:
    image-check:
      - twemproxy
    port-check:
      - 22222
  

Kubernetes environment

Configure the application in config.yaml

- name: twemproxy
  container-checks:
    image-check:
      - twemproxy
    port-check:
      - 22222  
  

Validate

Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.

Metrics

OpsRamp MetricMetric Display NameUnitDescription
twemproxy_curr_connectionsCurr ConnectionsConnectionsNumber of current connections
twemproxy_total_connectionsTotal ConnectionsConnections/secondRate of new connections
twemproxy_client_eofClient EofErrors/secondnumber of eof on client connections
twemproxy_client_errClient ErrErrors/secondnumber of errors on client connections
twemproxy_client_connectionsClient ConnectionsConnectionsnumber of active client connections
twemproxy_server_ejectsServer EjectsEventsnumber of times backend server was ejected
twemproxy_forward_errorForward Errorerrors/secondnumber of times we encountered a forwarding error
twemproxy_fragmentsFragmentsrequests/secondnumber of fragments created from a multi-vector request
twemproxy_in_queueIn Queuerequests/secondnumber of requests in incoming queue
twemproxy_out_queueOut Queuerequests/secondnumber of requests in outgoing queue
twemproxy_in_queue_bytesIn Queue Bytesbytes/secondcurrent request bytes in incoming queue
twemproxy_out_queue_bytesOut Queue Bytesbytes/secondcurrent request bytes in outgoing queue
twemproxy_server_connectionsServer ConnectionsConnectionsnumber of active server connections
twemproxy_server_errServer Errerrors/secondnumber of errors on server connections
twemproxy_server_timedoutServer TimedoutTimeoutsnumber of timeouts on server connections
twemproxy_server_eofServer Eoferrors/secondnumber of eof on server connections
twemproxy_responsesResponsesresponses/secondnumber of responses
twemproxy_requestsRequestsrequests/secondnumber of requests
twemproxy_response_bytesResponse Bytesbytes/secondtotal response bytes
twemproxy_request_bytesRequest Bytesbytes/secondtotal request bytes