Varnish is a high-performance reverse proxy and load-balancer package for Linux/Unix systems.

learn more… | top users | synonyms

124
votes
12answers
129k views

How to set up Nginx as a caching reverse proxy?

I heard recently that Nginx has added caching to its reverse proxy feature. I looked around but couldn't find much info about it. I want to set up Nginx as a caching reverse proxy in front of Apache/...
32
votes
5answers
17k views

Ordering: 1. nginx 2. varnish 3. haproxy 4. webserver?

I've seen people recommend combining all of these in a flow, but they seem to have lots of overlapping features so I'd like to dig in to why you might want to pass through 3 different programs before ...
16
votes
3answers
13k views

How to check if chosen Varnish cache size is ideal?

I've configured my Varnish cache to use a cache size of 512 MB, using: varnishd ... -s file,/var/cache/varnish.cache,512M Questions: How do I monitor if 512 MB is too small, too big or okay? How ...
18
votes
2answers
18k views

Varnish Cache - default TTL?

I have discovered that I can set the TTL in Varnish as follows in my VCL file: sub vcl_fetch { # 1 minute set obj.ttl = 1m; } But what is the default setting (assuming the backend server is ...
3
votes
1answer
2k views

Configuring HTTPD behind Varnish on a 512mb VPS

I am hosting a website for a client on a dedicated VPS that has 512mb of RAM. Within the last 2 weeks, it has hosed up twice due to 0% free memory (or free swap). The site is pretty database intensive,...
12
votes
1answer
13k views

The strange case of Mr. Time To First Byte

I've got a webserver on a Linode 1024 VPS based on Ubuntu 11.10 Nginx 1.0.5 PHP 5.3.6 (with PHP-FPM, APC) Varnish 3.0.2 And a couple of blogs there based on WordPress 3.3.1. One of them is a ...
8
votes
7answers
6k views

Varnish -> Nginx -> Apache a good idea?

I'm thinking about the architecture for a new Webserver. Would having Varnish as a cache in front of Nginx as a reverse-proxy and serving static files in front of apache for all heavy lifting be a ...
7
votes
1answer
2k views

Poor load balancer performance on rackspace and centos

I am load testing different options for load balancing, and am getting poor results from Nginx, haproxy, and varnish. I have one 4GB load balancer at Rackspace, hitting 4x1GB app servers. I'm ...
4
votes
2answers
5k views

How to make Varnish ignore, not delete cookies

I want to use Varnish to cache certain pages even in the presence of cookies. There are 3 possibilities that I need to take care of: An anonymous user is viewing some page A logged in user is ...
3
votes
1answer
570 views

How can I log timestamps with Varnish health probes?

I'm using Varnish 3.0.3 on RHEL 6 as a caching load balancer in front of several Apache web servers and want to keep a log of when Varnish sees the back-ends change from healthy to sick and back again....
6
votes
3answers
3k views

Tools for introspecting Varnish

Has anyone developed, or does anyone know of, any third-party tools (or non-obvious uses of the stock tools) to help a poor systems administrator determine what's going on with requests that are ...
4
votes
2answers
2k views

Change varnish 4 503 error

How can i change varnish 503 error? How can i customize it ? i'm using varnish v 4 it's now work sub vcl_synth { set resp.http.Content-Type = "text/html; charset=utf-8"; set resp.http....
2
votes
1answer
238 views

HAProxy/Varnish: redirecting a percentage of traffic

I'm trying to measure separate statistics for two different versions of a web page. So I need to redirect a certain percentage of my web traffic to a different page than the one requested (i.e. 20% of ...
1
vote
3answers
2k views

varnish demon error: libvarnish.so.1 not found

In order to try out varnish for an upcoming project I installed it on an ubuntu server using this tutorial: http://varnish-cache.org/wiki/InstallationOnUbuntuDapper The build process worked without ...
0
votes
1answer
923 views

Why is Varnish 4 getting slow after some time?

We've migrated Varnish from Version 3 to Version 4.0.1 (via Debian packages). Nearly the same configuration and memory setup runs flawlessly on varnish 3. However, with Varnish 4 there are large ...
0
votes
3answers
689 views

Architecture question: adding SSL into the mix

Currently we have a configuration that at the highest level looks like this: [Traffic] -> Varnish (caching) -> HaProxy (load balancing) -> Apache (content and services) There are (obviously?) ...
4
votes
3answers
2k views

Varnish only cache assets from single session

Currently I manage to configure varnish to cache items from 1 user, but the when the second users comes in varnish fetch another asset from Apache. How can I cache static assets behind magento ( ...
4
votes
5answers
1k views

Apache/Varnish/PHP: Just to confirm, is it possible to automatically update $_SERVER['REMOTE_ADDR'] to have the real client's IP?

I just cannot seem to get the real client IP to show in PHP's $_SERVER['REMOTE_ADDR']. It shows in $_SERVER['X_FORWARDED_FOR'], but the $_SERVER['REMOTE_ADDR'] always points to the Varnish service IP....
3
votes
2answers
886 views

nginx > varnish > hhvm

I have nginx on the front end interpreting ssl and redirecting all non https traffic to https: server { listen 80; server_name example.com www.example.com; return 301 https://www.example....
3
votes
3answers
2k views

Load balancing: Nginx, Varnish and HTTP sessions

I have to setup a load balancing system. At the moment I have two machines running Nginx 0.8.52, PHP-FPM (on unix socket) and an application based on PHP Symfony 1.4.11. On a third machine, I have to ...
3
votes
1answer
1k views

Varnish purge on POST or PUT

In my application stack, I'm using CouchDB (in this scenario, to all intents and purposes it's a simple REST server) and I want to put Varnish in front of it to alleviate read load. I know that ...
2
votes
2answers
4k views

Avoiding Varnish Hitting Magento Cookies - VCL

Hello to serverfault users, I would like to kindly ask someone to help me configure varnish for magento. Using command: varnishtop -i TxHeader -I Cookie , following info show: TxHeader Cookie: ...
1
vote
1answer
342 views

Varnish send while cache

I wanted the varnish download the file to the cache while sends to client. From what I am seeing, it first download and then send the file, and that with very large files, is slow. (sorry for english,...
1
vote
1answer
389 views

How to log a request to apache access log if it's cached by Varnish

I have a service based on parsing apache access logs, so I need to log there even when Vanish is turned on. No I just simply tell Varnish to do not cache specific urls: if (req.url ~ "(foo|bar)") ...
0
votes
2answers
2k views

how to redirect from www to non-www varnish

How do I go about automatically redirect any link of the type www.example.com to example.com. I would like to do this for all link that hits the varnish instance (so i don't have to individually ...
0
votes
1answer
926 views

Varnish redirects to apache backend port 8000

I set up an apache and a varnish on a dedicated server, which runs on debian squeeze. Sometimes the varnish redirects to the apache backend port 8000. In this case the browser show i.e. mydomain.com:...
0
votes
1answer
327 views

IP bases access control list script

I would like to setup ACL (python script or any ready made Centos compatible scipt) & limit rate for all IP addresses, who are hitting the site very frequently. For example crawlers, bots (except ...
0
votes
1answer
2k views

Unable to compile latest Varnish on Debian 6

I just cloned the latest varnish git-repository to try and apply an enhancement (from git://github.com/varnish/Varnish-Cache.git) All the dependencies listed on the website have been installed. I ...
-1
votes
1answer
530 views

How to arrange web servers with Varnish? [closed]

I am wondering what it the best (most stable with the least memory footprint) arrangment for a busy php+mysql app? request > Varnish > Apache requests > Varnish > Nginx > php5-fpm ...