Home > mysql-proxy-cache

mysql-proxy-cache

Mysql-proxy-cache is a project mainly written in ..., based on the BSD-3-Clause license.

Forked from clofresh

Dependencies:

  • MySQL Proxy (http://dev.mysql.com/downloads/mysql-proxy/index.html)
  • memcached (http://www.danga.com/memcached/)
  • LuaRocks (http://www.luarocks.org/) - to install the md5 and luasocket libraries
  • md5.lua (http://www.keplerproject.org/md5/)
  • Memcached.lua (http://luamemcached.luaforge.net/)
  • LuaSocket (http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/)

Usage:

Assuming you have mysql and memcache instances running locally listening at their respective default ports, you can just run the following commands:

mysql-proxy --proxy-lua-script=mysql-proxy-cache.lua

Then, point your application to mysql proxy on port 4040 instead of 3306. Make sure you specify 127.0.0.1 as the host instead of localhost, otherwise you won't connect to mysql proxy.

Default Timeout for data is 30 seconds. To change this, as it is rather low, and set this way for testing, edit the variable cache_timeout it mysql-proxy-cache.lua

Also :

Change your code to point to the mysql-proxy port (4040 by default)

Beware of LUA_PATH and LUA_CPATH env vars, which are pain for the script to work

For Debian 4/5/6 : See debian.install file

Previous:AppMarket