Mailing List Archive

C Compiler requirement
So as I understand it, when Varnish runs, it reads in the VCL script
(basically the configuration file that I have written) and generates C
source from that code, that is then compiled into a shared object to be
called by the accelerator. Is there any way Varnish can compile that
beforehand, and then have that Shared Object used on the next launch
instead of having it rebuilt again? I'm still going around with having
a C compiler on Production boxes, and am waiting for a decision from
security, but I was wondering about this. Once configured we're not
going to change the VCL ever, so if we could have it built once, and
then use that, we wouldn't need a C complier on the Prod box. I may be
way off, but just an idea I wanted to discuss, as it would make using
Varnish easier for enterprises that don't understand Varnish's
philosophy.

Thanks

P

If you are not the intended recipient of this message (including attachments), or if you have received this message in error, immediately notify us and delete it and any attachments. If you no longer wish to receive e-mail from Edward Jones, please send this request to messages at edwardjones.com. You must include the e-mail address that you wish not to receive e-mail communications. For important additional information related to this e-mail, visit www.edwardjones.com/US_email_disclosure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.linpro.no/pipermail/varnish-misc/attachments/20071101/b6f2e279/attachment.htm
C Compiler requirement [ In reply to ]
In message <3ECD7F7DDE95BA4FA598E8DDE71F1A5104CACEF8 at nwpsrv08.edj.ad.edwardjone
s.com>, "Cryer,Phil" writes:

>Is there any way Varnish can compile that
>beforehand, and then have that Shared Object used on the next launch
>instead of having it rebuilt again?

It's not inherently impossible, but does raise som concerns about
version skew between the compiled VCL and the varnishd binary.

It shouldn't be too much work to implement I think.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
C Compiler requirement [ In reply to ]
>>Is there any way Varnish can compile that beforehand, and then have
>>that Shared Object used on the next launch instead of having it
rebuilt
>>again?

> It's not inherently impossible, but does raise som concerns about
version skew between
> the compiled VCL and the varnishd binary.
> It shouldn't be too much work to implement I think.

So where is the shared object that Varnish creates on startup?
Secondly, is there a DAEMON_OPTS variable I can set to make Varnish use
an existing shared object instead of regen'ing a new one on startup? I
suspect that last one would be the only functionality missing currently.
True, the version issue will be there, but again, I'm thinking of a way
to make enterprise implementation easier, and companies are usually
pretty strict on new versions. With the proper upgrade path they should
know to update the .so and move it in with the install, otherwise a
version check on startup could do the trick (make sure 1.1.1 is the
version called out in the vcl for example).

Thanks

Phil

If you are not the intended recipient of this message (including attachments), or if you have received this message in error, immediately notify us and delete it and any attachments. If you no longer wish to receive e-mail from Edward Jones, please send this request to messages at edwardjones.com. You must include the e-mail address that you wish not to receive e-mail communications. For important additional information related to this e-mail, visit www.edwardjones.com/US_email_disclosure
C Compiler requirement [ In reply to ]
If you are not the intended recipient of this message (including attachments), or if you have received this message in error, immediately notify us and delete it and any attachments. If you no longer wish to receive e-mail from Edward Jones, please send this request to messages at edwardjones.com. You must include the e-mail address that you wish not to receive e-mail communications. For important additional information related to this e-mail, visit www.edwardjones.com/US_email_disclosure

-----Original Message-----


From: varnish-misc-bounces@projects.linpro.no
[mailto:varnish-misc-bounces at projects.linpro.no] On Behalf Of Cryer,Phil
Sent: Monday, November 05, 2007 1:44 PM
To: varnish-misc at projects.linpro.no
Subject: RE: C Compiler requirement

>>Is there any way Varnish can compile that beforehand, and then have
>>that Shared Object used on the next launch instead of having it
rebuilt
>>again?

> It's not inherently impossible, but does raise som concerns about
version skew between
> the compiled VCL and the varnishd binary.
> It shouldn't be too much work to implement I think.

Replying to myself:
|| So where is the shared object that Varnish creates on startup?


bash-3.00# ls -l /var/lib/varnish/`hostname`
total 48
-rwxr-xr-x 1 root root 19800 Nov 5 14:03 bin.XXpiVDV1
-rw------- 1 root root 22836 Nov 5 14:03 _.c
-rw-r--r-- 1 root root 8389176 Nov 5 14:03 _.vsl
bash-3.00# file *
bin.XXpiVDV1: ELF 64-bit LSB shared object, AMD x86-64, version 1
(SYSV), not stripped
_.c: ASCII C program text
_.vsl: data


So I know where the current shared obj is, now I just need to figure out
(or have implemented):

||[...] is there a DAEMON_OPTS variable I can set to make Varnish use an
existing shared
||object instead of regen'ing a new one on startup? I suspect that last
one would be the only
||functionality missing currently.

Thanks

Phil