Questions tagged [varnish]

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

Filter by
Sorted by
Tagged with
152 votes
13 answers
184k 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/...
Continuation's user avatar
  • 3,130
55 votes
5 answers
26k 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 ...
Joel K's user avatar
  • 5,903
27 votes
2 answers
75k views

where can i find varnish log files? /var/log/varnish is empty

I'm trying to read log files of Varnish server in Ubuntu environment. I actually never used Varnish before. so...I cd to /var/log/varnish, but the folder is empty. it tells me that I have to ...
Moon's user avatar
  • 2,143
24 votes
2 answers
35k 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 ...
Ade's user avatar
  • 709
22 votes
5 answers
31k views

Prevent port change on redirect in nginx

I currently have nginx setup to serve content through Varnish. Nginx listens on port 8000 and varnish connects users' requests from 80 to 8000. The problem is, on some occasions, particularly when ...
arbales's user avatar
  • 527
22 votes
2 answers
11k views

Is Varnish with nginx better than just using nginx? [closed]

I see a lot of talk about using nginx with Varnish and I do not understand why. Isn't nginx enough? Nginx has SSI, has reverse proxy cache, is lightweight, has SSL, can work with cgi, fpm, etc. ...
Bogdan Cosmin's user avatar
21 votes
3 answers
31k 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 do ...
knorv's user avatar
  • 1,819
18 votes
4 answers
7k views

Best practice for proxying package repositories

I have a collection of CentOS servers in my corporate network. For security reasons, most servers do not have general outbound internet access unless it is a core functional requirement for the server....
Dave Smith's user avatar
17 votes
2 answers
11k views

Main differences between SSI (Server Side Include) and ESI (Edge Side include)

I need to include dynamic content into static pages at web server level. The 2 options I have found so far are Server Side Include (SSI) and Edge Side Include (ESI). While the origins of SSI seem ...
Max's user avatar
  • 3,563
15 votes
2 answers
22k views

Custom 503 Error Page With Varnish

How can I tell Varnish to show a custom html error page instead of the default "Guru Meditation" message?
Christian Davén's user avatar
15 votes
1 answer
24k 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 plain ...
javipas's user avatar
  • 1,362
13 votes
2 answers
35k views

Purge varnish cache for a single url using varnishadm

Varnish is being used in a Wordpress website. I would like to purge Varnish for a single URL instead of a whole domain. With this command I can restart Varnish for the whole domain: varnishadm -T :...
rfc1484's user avatar
  • 201
13 votes
4 answers
8k views

Nginx Varnish Nginx Django?

I have a django app and I want to to setup Varnish on a server in front of it. In another serverfault thread somebody suggested putting Nginx in front of Varnish. Should I put Nginx in front of ...
Enrico's user avatar
  • 491
13 votes
2 answers
5k views

Varnish versus other reverse proxies

I'm working with an organisation that has deployed Varnish as a caching reverse proxy for all of their web traffic. Their traffic make up is a lot of customer-generated dynamic websites, with the ...
womble's user avatar
  • 97k
12 votes
6 answers
38k views

Simple way of restarting crashed processes?

I need to monitor several processes running on my webserver. For some reason, varnish currently crashes once every day or two. I'm using monit to supposedly restart varnish automatically, but it doesn'...
Lin's user avatar
  • 2,939
11 votes
5 answers
23k views

Does Varnish require much RAM?

Other than virtual memory, How about RAM usage for Varnish? Is it much RAM needed?
user avatar
11 votes
2 answers
13k views

varnish daemon not listening on configured port

I'm trying to install varnish on ubuntu 16.04, I read several article none are working. From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd). Now on ...
Bruno's user avatar
  • 213
11 votes
2 answers
7k views

How to install a Varnish module on Ubuntu

I want to install an additional module for Varnish Cache, the Shield module. How can I do that? I installed Varnish 3.0 from the Ubuntu repositories. How do I get the Varnish source which the module ...
Tobe's user avatar
  • 151
11 votes
7 answers
5k views

How can I balance incoming web traffic amongst N apache servers?

I am looking to use something like Heartbeat/Squid/Varnish/etc to balance the amount of incoming traffic amongst the internal apache instances. This would have to be software and not hardware as all ...
user avatar
11 votes
4 answers
11k views

Varnish "FetchError no backend connection" error

Varnishlog: 0 CLI - Rd ping 0 CLI - Wr 200 19 PONG 1340829925 1.0 12 SessionOpen c 79.124.74.11 3063 :80 12 SessionClose c EOF 12 StatSess c 79.124.74.11 3063 ...
anon-123's user avatar
  • 119
10 votes
2 answers
8k views

How to Read a Varnish Histogram?

How is a varnishhist histogram/graph read? I understand that the x-axis is a log scale. Specifically: I see 9 "|"s or cache hits occur around y=1e-4, what does each "|" refer to? Page? File? I see ...
KM.'s user avatar
  • 1,796
10 votes
7 answers
9k 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 ...
Zoran Zaric's user avatar
10 votes
4 answers
20k views

Why cache static files with Varnish, why not pass

I have a system runnning nginx / php-fpm / varnish / wordpress and amazon s3. Now I have looked at a lot of configuration files while setting up the system, and in all of them I found something like ...
Saif Bechan's user avatar
9 votes
1 answer
7k views

What are the commands to get top MISSES and HITS from Varnish 4?

For work I am using Varnish 3 on CentOS, but at home I am using Varnish 4 on Ubuntu 14.04. At work I use these commands: Top hits: varnishtop -i rxurl Top Misses: varnishtop -i txurl But for some ...
jnbdz's user avatar
  • 947
9 votes
2 answers
5k views

How do I set a varnish response TTL dynamically?

my php script is sending a header X_Cache_ttl: 1h and in my varnish config file I have sub vcl_fetch { if(beresp.http.X-Cache-ttl){ set beresp.ttl = beresp.http.X-Cache-ttl; } } ...
DiverseAndRemote.com's user avatar
9 votes
3 answers
6k views

AWS ELB as backend for Varnish Accelerator

I am working on a large deployment on AWS that has high uptime requirements and variable loads throughout the day. Obviously, this is the perfect use case for ELB (Elastic Load Balancer) and ...
addisonj's user avatar
  • 318
9 votes
1 answer
6k views

How does Varnish deal with running out of storage?

I am using Varnish 3.0.3 (the latest as of this writing) with more or less the default install, using the following for storage: # # Cache file location VARNISH_STORAGE_FILE=/var/lib/varnish/...
user174548's user avatar
8 votes
3 answers
25k views

Use Varnish Cache only on-disk

The situation is: I' m building a PHP application and need http caching. Varnish is great and lots of people tell me that Varnish stores the cached data in RAM. I want it to cache on hard disk. Is ...
user avatar
8 votes
3 answers
3k views

Does it makes sense from a security perspective to remove the Server HTTP header?

I'm using Varnish and I'm not quite sure if I should also remove the Server: nginx HTTP header. Why do someone needs to know that I'm using NGINX? Is it ok to remove this HTTP header from the response ...
manifestor's user avatar
  • 6,399
8 votes
2 answers
12k views

Is it possible to run varnish with both memory and disk storage?

I'm interested in maximizing cache hits and efficiency for a slow-changing site. The virtual host doesn't have a huge amount of RAM, but I'd like to use what's available for varnish, but to fall back ...
user67641's user avatar
  • 1,302
8 votes
2 answers
3k views

Force request to miss cache but still store the response

I have a slow web app that I've placed Varnish in front of. All of the pages are static (they don't vary for a different user), but they need to be updated every 5 minutes so they contain recent data. ...
Tom Marthenal's user avatar
8 votes
3 answers
9k views

Let varnish send old data from cache while it's fetching a new one?

I'm caching dynamically generated pages (PHP-FPM, NGINX) and have varnish in front of them, this works very well. However, once the cache timeout is reached, I see this: new client requests page ...
mark's user avatar
  • 1,526
8 votes
5 answers
8k views

Which reverse-proxies support HTTP/1.1 ETag and If-None-Match headers?

I'm developing a caching system for an ecommerce platform that will use a reverse proxy for caching. I plan to handle invalidation by using proper HTTP/1.1 headers. That is, I will set an ETag on ...
ColinM's user avatar
  • 721
8 votes
3 answers
7k views

Getting 503 error from Varnish but varnishlog doesn't tell much

Running Varnish 4 and I'm occasionally getting 503 errors which I can't put my finger in. I've tried curling the backend directly and it's returning a response everytime so it doesn't look like the ...
Axsuul's user avatar
  • 101
8 votes
2 answers
3k views

Varnish running out of open ports, lots of SYN_SENT connections

Recently we've been experiencing issues with our Varnish (3x) -> Apache (3x) setup, resulting in a huge spike in SYN_SENT connections. The spike itself is due to the amount of new traffic hitting the ...
user150997's user avatar
7 votes
6 answers
15k views

How many reverse proxies (nginx, haproxy) is too many?

I'm setting up a HA (high availability) cluster using nginx, haproxy & apache. I've been reading great things about nginx and haproxy. People tend to choose one or the other but I like both. ...
user avatar
7 votes
2 answers
11k 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....
Ali Hasanzade's user avatar
7 votes
2 answers
5k views

reverse proxy that caches post requests

I understand that varnish caches "GET" and "HEAD" requests by default. My backend servers fail when I do a get request that is too long, so I made them respond to POST instead of GET. This works ...
nurettin's user avatar
  • 378
7 votes
4 answers
11k views

Running Varnish on Windows 7

We are planning on using Varnish Cache 3.0.2 (latest version) for our production environment, however, for development we would like to run Varnish on our local computers, some of us have Win7. The ...
miguelr's user avatar
  • 201
7 votes
4 answers
6k views

Increase varnish timeout for a specific path

I have a set of scripts on the /admin path that can take a while to execute, and cause Varnish to hit the timeout limit. Is there a way to increase the timeouts for a particular path rather than for ...
LS55321's user avatar
  • 171
7 votes
2 answers
11k views

nginx proxy_cache: limit parallel requests to a backend

I am using nginx as a reverse proxy to my backend(s). Configuration is pretty basic, e.g. the core is just: upstream myservice { server 127.0.0.1:80; server 123.123.123.123:80; } location / {...
Jeroen Ooms's user avatar
  • 2,239
7 votes
3 answers
13k views

Configuring Varnish to rewrite Expires/Cache-Control headers for client-side caching

How do I configure Varnish so that all responses to requests matching say "*.css" gets cached in the client's browser for 30 days? What I'm trying to achieve is making Varnish set the correct "...
knorv's user avatar
  • 1,819
7 votes
2 answers
8k views

How do I block an IP address or network block with Varnish VCL?

How does one block either IP address of network range inside of Varnish's VCL file?
alexus's user avatar
  • 13.4k
7 votes
2 answers
6k views

Set default TTL in Varnish 4.0?

I am new to Varnish, and I am running v4.0 on Debian Wheezy. I would like to set a default TTL across my cache of 4 weeks (very static content). From reading the docs I think the answer is to set ...
Richard's user avatar
  • 263
7 votes
1 answer
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 ...
Sean Clark Hess's user avatar
7 votes
1 answer
2k views

Varnish returning 503, FetchError (could not get storage)

On the current setup we're running into a problem with Varnish, we're running a CentOS 5.7 x86_64 xenpv, with Cpanel WHM, hosted at VPS.net. Sometimes we will recieve a Guru Meditation from Varnish, ...
Archan's user avatar
  • 71
6 votes
4 answers
11k views

How do I get varnish to return in the http response header from which backend it took the response?

I have three servers in the backend, with a round robin director. I would like varnish to write a X-Server-By header with the name or ip of the server from which the response was fetched, how can ...
user avatar
6 votes
2 answers
12k views

Get varnishlog to log only 503 errors into file

I tried everything: service varnishlog start - logs everything varnishlog -D -c -m TxStatus:503 > /var/log/varnish/varnish.log - doesn't seem to be doing anything varnishlog -c -m TxStatus:503 &...
Eduard Luca's user avatar
6 votes
2 answers
5k views

Extract Configuration From a Running Varnish Instance

Is there a way to extract a vcl configuration file from a running instance of varnish? That is, I'm debugging varnish on a system I haven't been involved with up until now. There's a lot of ...
Alana Storm's user avatar
6 votes
1 answer
5k views

How to Enforce SSL in Varnish 4

I am aiming to redirect clients to a SSL-version of a site using Varnish. In Varnish 3 this could be done by the following in the VCL: sub vcl_recv { if ( (req.http.host ~ "^(?i)somesite.org" || ...
Taylor Taff's user avatar

1
2 3 4 5
19