Skip to content

diegohce/dcached

Repository files navigation

Go Report Card GitHub release Github all releases GPLv3 license Maintenance HitCount Generic badge

dcached(1)

NAME

dcached - Distributed and masterless cache cluster.

SYNOPSIS

dcached

DESCRIPTION

dcached can run as a standalone node or as a cluster of nodes. Config file at /etc/dcached.conf defines dcached behaviour.

CONFIG FILE

cache:
  ip: "" #leave blank
  port: "9009" #listen port for cache service.
  gc_freq: 3600 #seconds, cache subsystem garbage collector
  mode: "standalone" # "cluster"

siblings:
  address: "224.0.0.1:9999" #multicast group.
  beacon_freq: 2 #seconds
  max_datagram_size: 128 #bytes, hostname MUST fit here.
  ttl: 5 #seconds, time to expire siblings registrar.
  beacon_interface: "" #Network interface to use to send the multicast beacon

Cache Operations

Dcached differs from others cache systems as it does not use a key-value based model, it uses a key-key-value model as in application_name-key-value. So several applications can use the same dcached cluster without key collision amongst applications.

  • Set
  • Get
  • Remove
  • Stats

Set

HTTP POST to /cache/set

{
	"appname":"my-awesome-service",
	"key": "unique-key-for-this-app",
	"value": "some-frequent-value",
	"ttl": 120
}

Get

HTTP POST to /cache/get

{
	"appname":"my-awesome-service",
	"key": "unique-key-for-this-app"
}

Remove

Remove Operations

  • key
  • application
  • all

Remove key

HTTP POST to /cache/remove/key

{
	"appname":"my-awesome-service",
	"key": "unique-key-for-this-app"
}

Remove application

HTTP POST to /cache/remove/application

{
	"appname":"my-awesome-service",
	"key": "unique-key-for-this-app"
}

Remove all

HTTP POST to /cache/remove/all

{
	"appname":"all"
}

Stats

  • local (requested node) HTTP GET to /cache/stats/local

  • all (all cluster nodes) HTTP GET to /cache/stats/all

FILES

/etc/dcached.conf

/etc/default/dcached

AUTHORS

Maintained by Diego Cena diego.cena@gmail.com. Up-to-date sources and binaries can be found at https://github.com/diegohce/dcached and bugs/issues can be submitted there.