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 NameUnit
twemproxy_curr_connections

Number of current connections
Curr ConnectionsConnections
twemproxy_total_connections

Rate of new connections
Total ConnectionsConnections/second
twemproxy_client_eof

number of eof on client connections
Client EofErrors/second
twemproxy_client_err

number of errors on client connections
Client ErrErrors/second
twemproxy_client_connections

number of active client connections
Client ConnectionsConnections
twemproxy_server_ejects

number of times backend server was ejected
Server EjectsEvents
twemproxy_forward_error

number of times we encountered a forwarding error
Forward Errorerrors/second
twemproxy_fragments

number of fragments created from a multi-vector request
Fragmentsrequests/second
twemproxy_in_queue

number of requests in incoming queue
In Queuerequests/second
twemproxy_out_queue

number of requests in outgoing queue
Out Queuerequests/second
twemproxy_in_queue_bytes

current request bytes in incoming queue
In Queue Bytesbytes/second
twemproxy_out_queue_bytes

current request bytes in outgoing queue
Out Queue Bytesbytes/second
twemproxy_server_connections

number of active server connections
Server ConnectionsConnections
twemproxy_server_err

number of errors on server connections
Server Errerrors/second
twemproxy_server_timedout

number of timeouts on server connections
Server TimedoutTimeouts
twemproxy_server_eof

number of eof on server connections
Server Eoferrors/second
twemproxy_responses

number of responses
Responsesresponses/second
twemproxy_requests

number of requests
Requestsrequests/second
twemproxy_response_bytes

total response bytes
Response Bytesbytes/second
twemproxy_request_bytes

total request bytes
Request Bytesbytes/second