読者です 読者をやめる 読者になる 読者になる

python-libmemcached をインストールする

Fedora10 に python-libmemcached をインストールするまでの手順です。


1. libmemcachedのインストール
1-1. ソースコードをcloneできるようにする

$ sudo easy_install -ZU mercurial
$ mkdir www_repo
$ hg clone http://hg.tangent.org/libmemcached/ libmemcached-read-only
$ cd libmemcached-read-only
$ ./configure
$ make
$ sudo make install

2. python-libmemcachedのインストール

$ sudo easy_install -ZU pyrex
$ cd www_repo
$ svn checkout http://python-libmemcached.googlecode.com/svn/trunk/ python-libmemcached-read-only
$ cd python-libmemcached-read-only
$ python setup.py build
$ sudo python setup.py install

3. testしてみる

$ memcached -vv
$ python benckmark.py
Benchmarking cmemcached...
/usr/lib/python2.5/site-packages/python_libmemcached-0.13.2-py2.5-linux-i686.egg/cmemcached.py:3: UserWarning: Module cmemcached was already imported from /usr/lib/python2.5/site-packages/python_libmemcached-0.13.2-py2.5-linux-i686.egg/cmemcached.pyc, but /home/kuma8/www_repo/python-libmemcached-read-only is being added to sys.path
import sys, pkg_resources, imp
test_set: 0.178262 seconds
test_set_get: failed or not supported
test_random_get: 0.572200 seconds
test_set_same: 0.094636 seconds
test_set_big_object (100 objects): 1.285484 seconds
test_set_get_big_object (100 objects): failed or not supported
test_set_big_string (100 objects): 1.319010 seconds
test_set_get_big_string (100 objects): failed or not supported
test_get: failed or not supported
test_get_big_object (100 objects): failed or not supported
test_get_multi: failed or not supported
test_get_list: failed or not supported
total_time is 3.449592

4. test2 groongaでも

$ groonga -s test
Benchmarking cmemcached...
/usr/lib/python2.5/site-packages/python_libmemcached-0.13.2-py2.5-linux-i686.egg/cmemcached.py:3: UserWarning: Module cmemcached was already imported from /usr/lib/python2.5/site-packages/python_libmemcached-0.13.2-py2.5-linux-i686.egg/cmemcached.pyc, but /home/kuma8/www_repo/python-libmemcached-read-only is being added to sys.path
import sys, pkg_resources, imp
test_set: 0.145236 seconds
test_set_get: failed or not supported
test_random_get: 0.358786 seconds
test_set_same: 0.105772 seconds
test_set_big_object (100 objects): 0.016154 seconds
test_set_get_big_object (100 objects): failed or not supported
test_set_big_string (100 objects): 0.010782 seconds
test_set_get_big_string (100 objects): failed or not supported
test_get: failed or not supported
test_get_big_object (100 objects): failed or not supported
test_get_multi: failed or not supported
test_get_list: failed or not supported
total_time is 0.636730
$ tail /var/log/groonga/groonga.log
2009-02-26 08:17:12.676340|n| connection closed..
2009-02-26 08:17:12.676626|e| illegal header: 115
2009-02-26 08:17:12.676645|n| connection closed..
2009-02-26 08:17:12.678701|e| illegal header: 115
2009-02-26 08:17:12.678722|n| connection closed..
2009-02-26 08:17:12.679400|e| illegal header: 115
2009-02-26 08:17:12.679419|n| connection closed..
2009-02-26 08:17:12.681648|e| illegal header: 115
2009-02-26 08:17:12.681668|n| connection closed..
2009-02-26 08:17:13.684911|n| thread start (0/1)

failed or not supported が気になりますが、とりあえず動いているようです。

2009-02-26 08:17:12.681648|e| illegal header: 115 はエラーメッセージかな
あとでソース見てみよう。


現在のポスト数 13 / 100