manual-lookup revision
| From: | Wez Furlong | Date: | Wed, 14 May 2003 00:36:23 +0000 |
| Subject: | manual-lookup revision | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-17595@lists.php.net to get a copy of this message | ||
The manual function lookup code was creating quite a lot of load on
www.php.net due to a large number of stat() syscalls.
To alleviate this problem, we've put in place an SQLite database to cache
the directory structure of the manual pages. This, combined with some
other tweaks to that machine has helped reduce the load to sane levels.
SQLite [1] is an embedded SQL database implementation that has very high
performance for applications with low write concurrency, making it ideal
for our particular problem.
The database has simple support for typos by using metaphone()s to match
the next best guess for a search word.
If you are running a mirror:
============================
The sqlite database is pre-generated by our rsync server and will appear
in your phpweb/backend directory when you next sync.
To take advantage of the database, you need to compile PHP with sqlite
support. You can do use one of the following methods:
1. PECL (unix):
If you configured you php installation with pear support, you can
issue the following command:
% pear install SQLite
Check that extension=sqlite.so is listed in your php.ini,
then restart your web server.
2. PECL (win32):
[Not sure if anyone is insane enough to try this configuration]
Download the php_sqlite.dll from
http://snaps.php.net/win32/PECL_STABLE/php_sqlite.dll
Add "extension=php_sqlite.dll" to your php.ini, then restart
your web server.
3. Manual compile (unix)
Check out sqlite from cvs into the ext directory of your php source
tree:
cd php4/ext
cvs -d :pserver:cvsread@cvs.php.net:/repository -z3 co -d sqlite \
pear/PECL/sqlite
cd ..
./buildconf
./configure --with-sqlite ...
Once you have the sqlite extension built into your web server, the
phpweb should detect it and make use of it automatically.
If you do not have sqlite support, the original search code will be used
instead. If you do nothing about this, nothing will break :)
--Wez.
[1] SQLite: http://www.sqlite.org