Seed up build process
Paul A. Procacci
pprocacci at datapipe.com
Fri Feb 15 03:08:20 CET 2013
You could write a vmod for it. Out of curiosity I just wrote
a vmod that enters null terminated strings into a critbit
tree.
The strings are essentially `key=value\0'.
I added/compiled 100,000 unique strings in 103.76 seconds on
an 800mhz processor.
>From there, it's just a little vcl magic:
I.E.:
############################
import critbit;
backend test {
/** Your backend definitions. */
}
sub vcl_recv {
if(req.http.host){
set req.http.X-REDIRECT = critbit.get(req.http.host + "=");
if(req.http.X-REDIRECT){
/* Perform redirect stuff */
}
}
}
############################
Hope this helps, and if anything, gives you some ideas. If
you want my vmod code, certainly I'll provide it, but I must
warn it only had the 2 seconds of testing coming up with the
concept and isn't very dev friendly. ;)
~Paul
On Thu, Feb 14, 2013 at 02:33:53PM -0800, Damon Snyder wrote:
> If all you are doing is redirects what about the possibility of putting
> nginx in front of varnish to do that portion of the request? I would
> imagine that HUP'ing nginx would be a lot faster for this kind of thing.
>
> Damon
>
>
> On Tue, Feb 12, 2013 at 2:47 AM, Tobias Eichelbr?nner <
> tobias.eichelbroenner at lamp-solutions.de> wrote:
>
> > Hi,
> >
> > I have got plenty of vcl code mainly containing redirect information for
> > hundreds of domains.
> >
> > All together there are about 34 MB of vcl text files containing 70000
> > rules for redirection. Varnish generates about 158MB c-code out of it,
> > that is compiled into a 90MB shared object.
> >
> > My problem is, that it takes more than one and a half hour to parse the
> > vcl code into c-code and than compiling it on an Intel Xeon W3530.
> >
> > Does anyone has an idea how to speed up the process?
> > Is there for example a possibility to tell the parser to pass any
> > optimization steps while generating the c code?
> >
> > I could store all information in a database and call it in realtime, but
> > that would cause heavy IO on the database.
> >
> > Sincerely,
> >
> > Tobias
> >
> > _______________________________________________
> > varnish-misc mailing list
> > varnish-misc at varnish-cache.org
> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
> >
________________________________
This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.
More information about the varnish-misc
mailing list