Obsolete:Tugela

From Wikitech
Jump to navigation Jump to search

Tugelacache is a drop-in replacement for memcached, but uses a Berkeley DB as second level data store. First level is memory, like with memcached. Second level is persistent so that one doesn't lose the cache content by restarting.

Tugela is started by /usr/local/bin/run-tugela.sh, which is called from /etc/rc.local. Depending on the hosts setting, several instances are started:

#!/bin/bash

/usr/local/bin/tugela -m 128  -p 11000 -d -u tugela -f /tmp/tugela0.db -s 20
/usr/local/bin/tugela -m 128  -p 11001 -d -u tugela -f /tmp/tugela1.db -s 21
/usr/local/bin/tugela -m 128  -p 11002 -d -u tugela -f /tmp/tugela2.db -s 22
/usr/local/bin/tugela -m 128  -p 11003 -d -u tugela -f /tmp/tugela3.db -s 23

Tugelas options:

tugela 0.1
-p <num>      port number to listen on
-l <ip_addr>  interface to listen on, default is INDRR_ANY
-d            run as a daemon
-r            maximize core file limit
-u <username> assume identity of <username> (only when run as root)
-m <num>      cache memory to use for items in megabytes, default is 64 MB
-c <num>      max simultaneous connections, default is 1024
-f <file      filename of database
-s <num>          sync this often seconds
-v            verbose (print errors/warnings while in event loop)
-vv           very verbose (also print client commands/reponses)
-h            print this help and exit
-i            print dbcached and libevent license

The sync time is set to different values to ensure that the syncs don't happen at the same time for all caches.