Questions tagged [varnish]

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

Varnish is primarily a caching reverse proxy, but also exhibits load-balancing and backend checking mechanisms and is very widely used on high traffic websites.

Varnish was designed from the ground to be a high performance reverse caching proxy and to not compete with the operating system on managing resources like memory. Most recent versions of Varnish support storing cache on memory or disk, and serving old content in case of backend fail (saint mode), among other features.

Varnish is written by Poul-Henning Kamp (PHK), and his Architect Notes are available about varnish design. PHK is also a well known FreeBSD kernel developer and mantainer.

937 questions
4
votes
1 answer

How to set Varnish so that it doesn't cache a specific URL with a query string?

Server setup: Ubuntu 12.10, Varnish 3.0.2, Nginx 1.3.14, with a WordPress 3.5.1 install. We are using the "Random Redirect" plugin which shows a random blog post at the URL http://example.com/?random I would like to set Varnish to not cache the…
Kevin Worthington
  • 327
  • 2
  • 6
  • 19
4
votes
1 answer

does varnish config include statement support wildcards?

After googling and briefly browsing varnish docs, I could not find a reference to this. Can I do for example the following in varnish vcl? include sites-enabled/*.vcl
4
votes
2 answers

Auto restart server if virtual memory is too low

There are quite number of software running on my server: httpd, varnish, mysql, memcache, java.. Each of them is using a part of the virtual memory and varnish was configured to be allocated 3GB of memory to run. Due to high traffic load which is…
Sukhjinder Singh
  • 393
  • 1
  • 4
  • 12
4
votes
2 answers

Why is Varnish not caching?

I am troubleshooting the setup of Varnish 3.x on my Ubuntu server. I'm running Drupal 7 on two sites set up on the box, via named-based vhosts. Before trying to get Varnish to play nice with Drupal I'm trying to just get Varnish to a PNG from…
Justin
  • 915
  • 3
  • 13
  • 26
4
votes
1 answer

Stripping Google Cookies With Varnish

Im setting up varnish on my server and have been studying the VCL ( which I think is very neat ) and I have the following in the vcl_recv I am writing which I don't understand why it would be necessary. if (req.url ~…
Casben79
  • 41
  • 2
4
votes
5 answers

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. I've played around with just about every…
Gavin
  • 186
  • 7
4
votes
2 answers

Can varnish cache files without specific extension or residing in specific directory

I have a varnish installation to cache (MANY) images that my service serves. It is about 200 images of around 4k per second and varnish happily serves them according to the following rule: if (req.request == "GET" && req.url ~…
pataroulis
  • 143
  • 1
  • 2
  • 11
4
votes
1 answer

Monitoring Varnish with Heartbeat and Pacemaker

I have a pair of servers setup as high availability load balancers/reverse proxies. Each runs Ubuntu 12.04 x64 Server, Varnish, Heartbeat and Pacemaker, with Varnish load balancing traffic to back-end servers. If either of the load balancers falls…
jetboy
  • 912
  • 2
  • 11
  • 25
4
votes
7 answers

Scaling large file downloads?

We currently deliver large (1GB+) files via a single Apache server, but our Apache server is extremely disk-IO-bound and we need to scale. My first idea was to simply duplicate this Apache server, however our file library is too big to simply…
jme
4
votes
1 answer

Custom VCL prevents varnish from starting

Operating System: CentOS 6 (x86_64) I have installed and configured varnish however it now is unable to start. # service varnish restart Stopping Varnish Cache: [FAILED] Starting Varnish Cache: …
George Reith
  • 673
  • 2
  • 12
  • 22
4
votes
4 answers

Varnish 3.0.2 to Apache2 sometimes return error 503

Hey guys I hope you can help me out here. I have an Ngingx parsing http and https to a varnish cache(3.0.2). From the varnish it is sent to apache2. Now I have for some time been tracking some strange 503 errors. But I cant seem to find the silver…
Ronnie Jespersen
  • 221
  • 5
  • 14
4
votes
1 answer

Combining Heroku with custom external services (e. g. Varnish or Postgres on EC2)

I'm planning to set up a Django site on Heroku. It will run on Heroku's Cedar stack, which allows Python apps, but doesn't include or support HTTP upstream caching with Varnish like the other stacks do. It will be a very read-heavy site and I'd like…
mkai
  • 43
  • 2
4
votes
1 answer

Is it normal to see two varnishd processes?

I'm running Varnish 3.x on a RHEL5 server. After starting varnish, ps ax |grep varnish gives: [root@ip-... ec2-user]# ps ax |grep varnish 2747 ? Ss 0:00 /usr/sbin/varnishd -P /var/run/varnish.pid -a :80 -T localhost:6082 -f…
Nic Cottrell
  • 1,302
  • 16
  • 32
4
votes
3 answers

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 ( css, js , image pdf etc ) accessible from multiple…
Rianto Wahyudi
  • 493
  • 3
  • 11
4
votes
2 answers

ratelimit POST requests

I'm running a large WordPress multiuser site. I have a varnish cache in front of the WordPress application server. As it makes no sense to cache POST requests, I am vulnerable to DDoS using lots of POSTs against the varnish cache server. I have…