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

Confused about caching solution: MemCache, Varnished, mod_cache, else?

I have a very heavy site in my server. The load of the server is always about 30-50 and sometimes it become even 150 and server work really hard. I'm looking for a caching solution that can increase performance of server and decrease the server…
bman
  • 219
  • 4
  • 13
4
votes
2 answers

PHP serving blank pages to <1% of users

We recently migrated our site to a load balanced apache cluster behind varnish. Since that time a very small subset of users is reporting they cannot view any pages. I have narrowed the issue down quite a bit. This issue was not present before…
WerkkreW
  • 5,969
  • 3
  • 24
  • 32
4
votes
3 answers

http benchmarking?

im running varnish->nginx(php-fpm) and im using ab but it keeps messing up. [root@localhost src]# ab -k -n 100000 -c 750 http://192.168.135.12/index.php This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam…
Sam Williams
  • 69
  • 1
  • 4
4
votes
1 answer

Varnish doesn't seem to be caching

I've setup a Varnish cache mirror to sit in front of a file server, but it seems to be endlessly re-downloading data from my file server. There's about 100GB of data in total, but so far Varnish has downloaded 800GB from my file server. I'm using…
anonymous coward
  • 282
  • 2
  • 13
4
votes
1 answer

How to utilize Varnish for A/B Testing and Feature Rollout?

Today we have our web layer exposed to the world. We would like to add Varnish in front of our web layer to accelerate the site and reduce calls to the backend. However, we have some concerns and i was wondering how most people approach them: A/B…
Ken
  • 181
  • 1
  • 4
4
votes
3 answers

Ignoring GET parameters in Varnish VCL

Okay: I've got a site set up which has some APIs we expose to developers, which are in the format /api/item.xml?type_ids=34,35,37®ion_ids=1000002,1000003&key=SOMERANDOMALPHANUM In this URI, type_ids is always set, region_ids and key are…
JamesHarrison
  • 51
  • 2
  • 3
4
votes
2 answers

How to setup Nginx with Varnish

I'd like to see how to configure Nginx and Varnish. I'm running several PHP sites and Rack-Sinatra sites as virtual hosts across two IP's. I'd like to prevent Nginx from having to serve static files, since I'm noticing some delays. Edit: I've…
arbales
  • 527
  • 1
  • 4
  • 16
3
votes
2 answers

Does Varnish 5.0 support HTTP/2 for backend connections?

I have the following infrastructure: 80 -> Varnish -> Backend (NGINX, port 8080) 443 -> NGINX (SSL-Termination with HTTP/2 enabled) -> Varnish -> Backend (NGINX, port 8080) I know that it is possible to enable HTTP/2 protocol for frontend…
manifestor
  • 6,079
  • 7
  • 27
  • 39
3
votes
1 answer

Allow location in NGINX based on IP - request comes from Varnish

If Varnish is set as the default Cache in front of my NGINX backend, how can I check in the NGINX backend for the clients original IP and make a decision based on that? I want to allow a certain directory only to certain IPs. Varnish being in front…
manifestor
  • 6,079
  • 7
  • 27
  • 39
3
votes
1 answer

Redirect HTTP to HTTPS using Varnish 4.1

I have been trying to config the redirection of www HTTP to non-www HTTPS with Varnish 4.1, Nginx, PHP7.0.15, but it's not successful. Really appreciate your insight on the issue: The purpose: to redirect http://example.com to…
greentealeaf
  • 181
  • 1
  • 9
3
votes
1 answer

Check Varnish ACL via X-Forwarded-For when behind one or more(!) reverse proxies

I have Varnish running behind a reverse proxy (running on localhost, for SSL offloading). The proxy sets the X-Forwarded-For header or adds itself to it if the header already exists. When I do ACL checks of course I want to check against the…
Martijn Heemels
  • 7,728
  • 7
  • 40
  • 64
3
votes
1 answer

Nginx proxy response time is very slow

Recently we added nginx in front of varnish for ssl offloading. We were about to rewrite all our http requests to https. But then we found out that there was a significant increase in response time even for the http calls when it is served by nginx.…
Vijai Durairaj
  • 31
  • 1
  • 1
  • 3
3
votes
1 answer

Is it possible to return a JSON response by varnish if backend is down?

A JSON response something like as shown below should be returned if the underlying backend is down or something. { "msg" :{ "status": 2 } } Is this possible with varnish ?
Yasser Shaikh
  • 391
  • 1
  • 3
  • 7
3
votes
2 answers

How to drop varnishncsa log if req.url matches

I've got a few load balancers that all perform health checks on a number of varnish instances. The health check on the varnish side consists of matching the request method and URL to return a 200 response. if (req.method == "GET" && req.url ==…
3
votes
1 answer

Varnish - behind, in front of, or instead of load balancer(HAProxy/nginx)

I intend to run a few tiny ARM "physical cloud" servers behind a load balancer(either HAProxy or nginx itself), but i can't decide where to put Varnish in the whole mess. I can either have it on each instance, doing the job locally, but seeing that…