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_children 5 startup=1 idle=2 concurrency=50


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.


Last modified 6 months ago Last modified on Jun 9, 2015, 4:33:57 PM