mass-redirect similar to how "tinyurl"-sites works

Freja Borginger freja.borginger at portsit.se
Thu Jun 25 12:00:22 CEST 2015


Hi!

I'm going to setup a mass-redirect server and I'm wondering which, if any, of my plans are going to work. The redirects are similar to those "tinyurl"-like websites where a short unique string leads to a full URL.

This is what I know I'm faced with:

Over 1,500,000 different redirects.
300 visitors per second.
70 redirects added per hour.

Plan A:
One if-section for each URL to redirect.
Will 1,500,000 if-sections-lookup slow down Varnish?
Will compiling via varnishadm be slow? If so, will it be faster to split the configurations in several .vcl and only compile the changed ones if possible?

Plan B:
Let varnish cache 301 redirects forever. Let aria2 and visitors populate the cache when varnish is started.
Populating will probably take a long time. I'm hoping the backend of squid+squirm will handle the 300 lookups/s from visitors otherwise visitors will use another backend which is already populated.
Anyway, will the lookup in cache be faster than plan A where lookup is done in if-sections?

Plan C:
Use vmod-sql to issue queries to a database. I think this will be way too slow because I don't think I can cache those. Sadly I didn't find much documentation on this vmod.

I saw there was a similar question asked before. From that one I gathered that the if-sections-lookup will be faster than non-cached redirects from a squid+squirm backend, hence why I'd cache those responses in plan B.

Freja Borginger
IT

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150625/46d066d1/attachment.html>


More information about the varnish-misc mailing list