wiki:WikiStart
Last modified 2 years ago Last modified on 07/25/12 12:14:59

Volta

What is volta?

Volta is a high performance, low resource URI rewriter for use with the Squid caching proxy server (or alternatively Polipo!) With it, you can dynamically alter URI requests that pass through Squid based on various criteria.

It uses a state machine to parse URIs and rules, and a constant database to store and access those rules. It can then either perform conditional rewrites internally, or by evaluating Lua scripts.

Why is it called "volta"?

It's a type of old Italian music written in triple-time. Quick!

How fast is it?

On a 2Ghz Xeon 5130, it can process a million squid requests against 10000 rules in less than 8 seconds, using about 800k of ram. On an 1.8Ghz Intel E4300, it can do it in 3 seconds.

Your mileage may vary, but for most all intents and purposes the answer is "definitely fast enough."

Configuring squid

You must enable url rewriting from within the squid.conf file.

url_rewrite_program /usr/local/bin/volta

... and that's it. You may need some additional customization, like where the volta database is stored on disk:

url_rewrite_program /usr/local/bin/volta -f /var/db/squid/volta.db

Busy servers:

While Volta is lightweight enough to simply increase the amount of rewriter children, it also supports Squid's rewrite_concurrency format if you find that to be more efficient for your environment. Adjust to taste.

url_rewrite_concurrency 60
url_rewrite_children 5

Usage

See the installation instructions for how to build volta.

Volta reads its rewrite rules from a local database. You can create the rules in a text editor, then convert it to the database like so:

% volta -c rules.txt

You'll be left with a "volta.db" file in the current directory. Put it wherever you please, and use the -f flag to point to it.

Rules file syntax can be found here. Information on using Lua rules is over here.

Download