Friday, February 05, 2010

Dalesa Web Cache (Dcache) Howto

Why do I need Dalesa Web Cache?

Dalesa web cache is a cooperative web caching platform based on peer – to – peer computing. Dalesa web cache exposes your local cache to a peer – to – peer network of such caches. Ones your cache joins the network you will be downloading fresh content from your peers rather than from the origin server if they have already visited the same site and the content cached in them is fresh enough. By exposing your web cache to the network Dalesa lets you to experience a faster web.


How Dalesa find web content stored in peers?

Dalesa web caceh uses a peer – to – peer document lookup protocol which multicasts UDP datagrams. On top of these datagrams the cache sends lookup messages in XML format posing a question similar to “who has URL X which is fresh enough for consuming”? Receiving nodes of this message will check their local cache index and multicast a message indicating the availability of the requested URL if it is already in it's cache. If the requester receives the response within a preset time slot then the content will be accessed through the peer node by making the peer node a parent cache, otherwise it will fetch the file from the origin server. (Implementation actually uses SHA1 hash of X instead of real URL to ensure constant message lengths and privacy)


How to install Dalesa Web Cache?

As of this writing Dalesa works well on Linux (we have tested on Debian and Fedora based systems). It also works on windows but very unstable at the moment. On Linux you can first get the the source of Dalesa from SVN at https://dalesa.svn.sourceforge.net/svnroot/dalesa. Use following command to get it svn co https://dalesa.svn.sourceforge.net/svnroot/dalesa dalesa. This will create a directory named dalesa. You can start by building the code in the trunk.

Prior to compiling dalesa it is wise to install lighttpd, MySQL, PHP, and PHP PDO drivers for both MySQL and Sqlite. However it is perfectly ok to go without installing these stuff as missing components are being revealed by the cofigure script.

Once you have done this move to trunk directory and start compiling. If cofigure script complains you about missing libraries and software then install those dependencies and rerun the script.

  • ./autogen.sh

  • ./configure --prefix=/usr

  • make

  • sudo make install

Now it is time to run and configure Dalesa. Configuring Dalesa is very easy since it uses a web based user interface to interact with user. Dalesa doesn't need changing any configuration file to do this.

Start Dalesa

  • sudo dcache

Now use your web browser and go to following URL http://127.0.0.1:8085/

Now create a user account and login to the system with it.

In the above interface click on edit to change settings. Set listen interface and the port appropriately so that Dalesa will use that configuration. If you are not already behind a proxy then set next node field to false. In the MySQL configuration section insert a valid MySQL user account which has permissions to create databases. Once you are done with the interface then click Save data, unfortunately at the moment the UI is incapable of restarting the server with new parameters. Therefore you have to manually restart Dalesa by using the command given below.


  • sudo killall dcache

  • sudo dcache

Now Dalesa is ready to work, but you have to configure your browser before using Dalesa. Open your browser's proxy settings dialogue (depends on the browser you use) and set proxy address and port to IP address of the interface you have selected and the port you have entered in the configuration web interface. From now onwards you will be accessing the web through Dalesa P2P web cache.

When you click on caching status button you will see many different options to visualize your caching statistics.

1 comment:

Anonymous said...

I am trying this software on Windows XP. It does crash; but not as offen. I would like to know what are the steps in getting it back up again quickly instead of restarting the PC itself.
Thanks