Evgeny Stepanischev asked me yesterday why there is no PECL extension providing interface to
Trivial DB (TDB), which is used in Samba. I didn't know what to answer, so I...
wrote it =)
The TDB itself looks like a perfect solution for temporary data storage (caches, sessions and the like), but it might be also useful for something more complex, taking into account its transactions support.
Being curious of how it would perform comparing to
Memcached on localhost (using
PECL/memcache, of course) I did a quick benchmark.
It's purely syntetic (just 1 000 000 operations in a loop), but the numbers show clear difference.
These are the results:
Impressive, huh?
If you'd plug TDB into the Memcached daemon (or write a daemon yourself) I expect Memcached to be much faster because that is an in-memory hash table vs the on-disk (?) database of TDB.
I'd like to see how TDB compares to ConstantDB and QDBM. You could probably provide it as an extra dba handler in PHP's DBA module as an alternative to the 11 handlers that are already in there
Regards,
Mauro.
Here are some hints on how to compile TDB itself:
http://news.php.net/php.pecl.dev/4832
sorry - I am just looking for opportunity to ask about: how to compile pecl-memcache with hardened php5 (with suhosin patch). Now on my machine runs OpenBSD 4.0.
When apache starts in log I found:
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled without Hardening-Patch, module API=20050922, debug=0,
thread-safety=0
PHP compiled with Hardening-Patch=1002051106, module API=20050922,
debug=0, thread-safety=0
These options need to match
Please help me if Anybody know how
Regards,
Artur
# phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
# ./configure
somethings missing, so:
...
# apt-get install tdb-dev
Wähle vormals abgewähltes Paket libtdb1.
(Lese Datenbank ... 32708 Dateien und Verzeichnisse sind derzeit installiert.)
Entpacke libtdb1 (aus .../libtdb1_1.0.6-13_i386.deb) ...
Wähle vormals abgewähltes Paket tdb-dev.
Entpacke tdb-dev (aus .../tdb-dev_1.0.6-13_i386.deb) ...
Richte libtdb1 ein (1.0.6-13) ...
Richte tdb-dev ein (1.0.6-13) ...
...
# ./configure (no problems)
# make
/bin/sh /root/tdb-0.0.1/libtool --mode=compile gcc -I. -I/root/tdb-0.0.1 -DPHP_ATOM_INC -I/root/tdb-0.0.1/include -I/root/tdb-0.0.1/main -I/root/tdb-0.0.1 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr//include -DHAVE_CONFIG_H -g -O2 -c /root/tdb-0.0.1/tdb.c -o tdb.lo
mkdir .libs
gcc -I. -I/root/tdb-0.0.1 -DPHP_ATOM_INC -I/root/tdb-0.0.1/include -I/root/tdb-0.0.1/main -I/root/tdb-0.0.1 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr//include -DHAVE_CONFIG_H -g -O2 -c /root/tdb-0.0.1/tdb.c -fPIC -DPIC -o .libs/tdb.o
/root/tdb-0.0.1/tdb.c: In function 'zm_startup_tdb':
/root/tdb-0.0.1/tdb.c:88: error: 'TDB_NOSYNC' undeclared (first use in this function)
/root/tdb-0.0.1/tdb.c:88: error: (Each undeclared identifier is reported only once
/root/tdb-0.0.1/tdb.c:88: error: for each function it appears in.)
/root/tdb-0.0.1/tdb.c:89: error: 'TDB_SEQNUM' undeclared (first use in this function)
/root/tdb-0.0.1/tdb.c: In function 'zif_tdb_unlock':
/root/tdb-0.0.1/tdb.c:478: error: void value not ignored as it ought to be
make: *** [tdb.lo] Fehler 1
I took & built it directly from Samba sources.
good to see such progress with the PECL extension!
But I am wondering when new Windows builds will be available again?
The last version at
http://pecl4win.php.net/ext.php/php_memcache.dll
is 2.2.0 (build date is 2007-10-17).
Keep up the good work,
René
It's maintained by Mikael Johansson these days and he seems to deal with it very well.
Regarding pecl4win builds, it seems that the extension wasn't built for a long time, I'll ask Edin what's wrong with his automatic builds.