a few intro to Varnish questions

linuxsupport lin.support at gmail.com
Fri Jan 14 12:21:01 CET 2011

Hi Jason,

see below,

On Thu, Jan 6, 2011 at 12:42 AM, Jason T. Slack-Moehrle <slackmoehrle at me.com
> wrote:

> Hello All,
> I was told about Varnish today. I have a growing Apple fan website that as
> more and more videos get added my thought is to keep the most popular videos
> in cache.
> The machine this site is running on is CentOS 5.5 64 bit, Apache, PHP,
> MySQL 5. It is a dual core machine with 12gb of RAM, max is 16gb and I
> will max it out over the next month or so probably as I find good
> deals on 4gb DDR3 sticks.
> The site's size will be about 300gb (about 60gb now) I have LVM
> running with 300gb allotted to /var/www/html. I have a MySQL backend that
> stores paths and data about the video's, the videos themselves are housed on
> the filesystem.
> Can anyone provide insight on setup and optimization of Varnish?
> I have some confusion.
> 1. Looking at:
> http://www.varnish-cache.org/docs/2.1/tutorial/putting_varnish_on_port_80.html

> So I have to run varnish on 80 and my site on an alternate port (8080 as
> example)? Or do they both run on port 80?
Yes, you need to run varnish on port 80, so that all requests hit Varnish
first, Varnish will then fetch contents from your Apache server running on
any other port ie. 8080, cache it and send response to requesting client.

> 2. Apache listens on my public IP and Varnish should too, correct? or do I
> use
Varnish should run on public IP, Apache can also run on public IP as long as
ports are different, but simply you could run on

> 3. I must make additions to vcl_recv I assume to cache what I want?
In vcl_recv, you can select what you want to serve from cache, you might
want to serve php pages directly and cache only static contents, depending
on your requirements, in vcl_fetch  you need to set how long you want
content to be cached, setting TTL, you can also set TTL based on content
types, please read the doc first http://www.varnish-cache.org/docs/2.1/

> 4. Do I have to make changes to my web pages to add meta-tags to trigger
> Varnish?
that depends, you may and you many not, http headers can also be set in

> Best,
> -Jason
> PS - I see 2 addresses for this list: varnish-misc at projects.linpro.no and
> varnish-misc at varnish-cache.org a ping shows different IP's although I
> suppose that would not be a definitive answer.

> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

-- Aniruddh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110114/3073a5c5/attachment-0003.html>

More information about the varnish-misc mailing list