Skip to content

Commit c318da6

Browse files
committed
cachedb_perfd: new CacheDB backend for the perfcached daemon
perfd://[:secret@]host:port[,host:port...]/collection[?opts] reaches a perfcached node or cluster through libperfd (0.7.5 or later, MIT): Noise-authenticated binary protocol, member discovery from a seed, per-key routing to the owning node, standby connections and failover. - get/set/remove/add/sub/counter_fetch over the core Key-Value API - cache_raw_query(): MGET, EXISTS, EXPIRE, JSON.SET/GET/DEL - perfd_fetch(): asynchronous fetch from an async() statement - lazy, pid-stamped per-process connections (fork safe); the Noise key is derived once in the parent and inherited by the workers Excluded from the default build like the other modules that need an external client library.
1 parent 804e092 commit c318da6

5 files changed

Lines changed: 1807 additions & 1 deletion

File tree

‎Makefile.conf.template‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#cachedb_dynamodb= Implementation of a cache system designed to work with Dynamodb servers | libaws-cpp-sdk-core and libaws-cpp-sdk-dynamodb
88
#cachedb_memcached= Implementation of a cache system designed to work with a memcached server. | Memcached client library, typically libmemcached
99
#cachedb_mongodb= Implementation of a cache system designed to work with a MongoDB server. | libjson and the mongo-c-driver
10+
#cachedb_perfd= Implementation of a cache system designed to work with perfcached servers | perfcached client library, libperfd 0.7.5 or higher
1011
#cachedb_redis= Implementation of a cache system designed to work with Redis servers | Redis client library, hiredis
1112
#carrierroute= Provides routing, balancing and blacklisting capabilities. | libconfuse, a configuration file parser library
1213
#cgrates= Provides integration with the CGRateS billing/rating engine. | JSON library, libjson
@@ -76,7 +77,7 @@
7677
#uuid= UUID generator | uuid-dev
7778

7879
# Modules omitted from the default build, generally due to external dependencies.
79-
exclude_modules?= aaa_diameter aaa_radius auth_jwt auth_web3 b2b_logic_xml cachedb_cassandra cachedb_couchbase cachedb_dynamodb cachedb_memcached cachedb_mongodb cachedb_redis carrierroute cgrates compression cpl_c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_sqlite db_unixodbc dialplan emergency event_rabbitmq event_kafka event_sqs h350 httpd http2d identity jabber json launch_darkly ldap lua mi_xmlrpc mmgeoip opentelemetry osp perl pi_http presence presence_dialoginfo presence_mwi presence_reginfo presence_xml presence_dfks proto_ipsec proto_sctp proto_tls proto_wss pua pua_bla pua_dialoginfo pua_mi pua_reginfo pua_usrloc pua_xmpp python regex rabbitmq_consumer rest_client rls rtp.io siprec sngtc snmpstats stir_shaken tls_mgm tls_openssl tls_wolfssl uuid xcap xcap_client xml xmpp
80+
exclude_modules?= aaa_diameter aaa_radius auth_jwt auth_web3 b2b_logic_xml cachedb_cassandra cachedb_couchbase cachedb_dynamodb cachedb_memcached cachedb_mongodb cachedb_perfd cachedb_redis carrierroute cgrates compression cpl_c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_sqlite db_unixodbc dialplan emergency event_rabbitmq event_kafka event_sqs h350 httpd http2d identity jabber json launch_darkly ldap lua mi_xmlrpc mmgeoip opentelemetry osp perl pi_http presence presence_dialoginfo presence_mwi presence_reginfo presence_xml presence_dfks proto_ipsec proto_sctp proto_tls proto_wss pua pua_bla pua_dialoginfo pua_mi pua_reginfo pua_usrloc pua_xmpp python regex rabbitmq_consumer rest_client rls rtp.io siprec sngtc snmpstats stir_shaken tls_mgm tls_openssl tls_wolfssl uuid xcap xcap_client xml xmpp
8081

8182
# Modules forced into the build, even when also listed in exclude_modules.
8283
include_modules?=

‎modules/cachedb_perfd/Makefile‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# cachedb_perfd - perfcached client through libperfd
3+
#
4+
# WARNING: do not run this directly, it should be run by the master Makefile
5+
#
6+
# libperfd (0.7.5 or later) is linked, never compiled in: install
7+
# libperfd-dev, or run `make install-lib` in perfcached; pkg-config finds it.
8+
# PERFD_STATIC=1 links libperfd.a instead of libperfd.so; PKG_CONFIG_PATH
9+
# points at a libperfd in another prefix.
10+
include ../../Makefile.defs
11+
auto_gen=
12+
NAME=cachedb_perfd.so
13+
14+
ifeq ($(filter clean proper realclean distclean,$(MAKECMDGOALS)),)
15+
ifeq ($(shell pkg-config --atleast-version=0.7.5 libperfd && echo yes),)
16+
$(error cachedb_perfd needs libperfd 0.7.5 or later - install libperfd-dev, or `make install-lib` in perfcached and set PKG_CONFIG_PATH)
17+
endif
18+
endif
19+
DEFS+=$(shell pkg-config --cflags libperfd 2>/dev/null)
20+
ifeq ($(PERFD_STATIC),1)
21+
LIBS+=$(shell pkg-config --variable=libdir libperfd 2>/dev/null)/libperfd.a -lsodium -lpthread
22+
else
23+
LIBS+=$(shell pkg-config --libs libperfd 2>/dev/null)
24+
endif
25+
26+
include ../../Makefile.modules

0 commit comments

Comments
 (0)