Planet Varnish

  • 2016-08-23 16:38 rsingh@varnish-software.com (Raj Singh)
    Want to make the most of your Varnish installation? Join us for the opportunity to get the best Varnish training available. The unique thing about our courses are that they are not taught by a trainer, Varnish core developers deliver our courses.
    by Varnish Software Blog at 2016-08-23 16:38
  • 2016-08-11 22:30 Mattias Geniar

    The post Mark a varnish backend as healthy, sick or automatic via CLI appeared first on ma.ttias.be.

    This is a useful little command for when you want to perform maintenance on a Varnish installation and want to dynamically mark backends as healthy or sick via the command line, without restarting or reloading varnish.

    See varnish backend health status

    To see all backends, there are 2 methods: a debug output and a normalized output.

    $ varnishadm -S /etc/varnish/secret -T localhost:6082 backend.list Backend name Refs Admin Probe backend1(127.0.0.1,,80) 1 probe Sick 0/4 fallback(172.16.80.5,,80) 12 probe Healthy (no probe) $ varnishadm -S /etc/varnish/secret -T localhost:6082 debug.health Backend backend1 is Sick Current states good: 0 threshold: 2 window: 4 Average responsetime of good probes: 0.000000 Oldest Newest ================================================================ ---------------------------------------------------------------- Happy

    The backend.list shows all backends, even those without a probe (= healtcheck) configured.

    The debug.health command will show in-depth statistics on the varnish probes that are being executed, including the IPv4 connect state, whether a send/receive has worked and if the response code was HTTP/200.

    For instance, a healthy backend will be shown like this, with each state of the check (IPv4, send, receive & HTTP response code) on a seperate line.

    $ varnishadm -S /etc/varnish/secret -T localhost:6082 debug.health Backend backend1 is Healthy Current states good: 5 threshold: 4 window: 5 Average responsetime of good probes: 0.014626 Oldest Newest ================================================================ 4444444444444444444444444444444444444444444444444444444444444444 Good IPv4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Good Xmit RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR Good Recv HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH Happy

    Now, to change backend statuses.

    Mark a varnish backend as healthy or sick

    In order to mark a particular backend as sick or healthy, thus overriding the probe, you can do so like this.

    $ varnishadm -S /etc/varnish/secret -T localhost:6082 backend.set_health backend1 healthy

    The above command will mark the backend named backend1 as healthy. Likewise, you can mark a backend as sick to prevent it from getting traffic.

    $ varnishadm -S /etc/varnish/secret -T localhost:6082 backend.set_health backend1 sick

    If you have multiple Varnish backends and they're configured in a director to load balance traffic, all traffic should gracefully be sent to the other backend(s). (see the examples in mattiasgeniar/varnish-4.0-configuration-templates)

    If you mark a backend explicitly as sick, the backend.list output changes and the admin column removes the 'probe' and marks it as 'sick' explicitly, indicating it was changed via CLI.

    $ varnishadm -S /etc/varnish/secret -T localhost:6082 backend.list Backend name Refs Admin Probe backend1(127.0.0.1,,80) 1 sick Sick 0/4 fallback(172.16.80.5,,80) 12 probe Healthy (no probe)

    You can also change it back to let Varnish decide the backend health.

    Mark the backend as 'varnish managed', let probes decide the health

    To let Varnish decide the health itself, by using it probes, mark the backend to be auto again:

    $ varnishadm -S /etc/varnish/secret -T localhost:6082 backend.set_health backend1 auto

    So to summarise: the backend.set_healthy command in varnishadm allows you to manipulate the backend health state of varnish backends, overriding the result of a probe.

    Useful when you're trying to gracefully update several backend servers, by marking backends as sick one by one without waiting for the probes to discover that backends are sick. This method allows you to do things gracefully before the update.

    The post Mark a varnish backend as healthy, sick or automatic via CLI appeared first on ma.ttias.be.

    by Mattias Geniar at 2016-08-11 22:30
  • 2016-08-10 15:45 ingvar

    The Varnish Cache project recently released varnish-4.1.3. I have pushed updates for Fedora, and updated copr builds for epel5, epel6, and epel7.

    varnish-modules-0.9.1 was also released a few weeks ago. I have wrapped it for Fedora, and am waiting for its review in BZ #1324863. Packages for epel5, epel6, and epel7 are in copr as well.

    Fedora updates for varnish-4.1.3 may be found at https://bodhi.fedoraproject.org/updates/?packages=varnish

    The Copr repos for epel are here: https://copr.fedorainfracloud.org/coprs/ingvar/varnish41/

    Test and reports are very welcome.

    Varnish Cache is a powerful and feature rich front side web cache. It is also very fast, and that is, fast as in powered by The Dark Side of the Force. On steroids. And it is Free Software.

    Redpill Linpro is the market leader for professional Open Source and Free Software solutions in the Nordics, though we have customers from all over. For professional managed services, all the way from small web apps, to massive IPv4/IPv6 multi data center media hosting, and everything through container solutions, in-house, cloud, and data center, contact us at www.redpill-linpro.com.

    by Ingvar Hagelund at 2016-08-10 15:45
  • 2016-08-10 15:45 ingvar

    The Varnish Cache project recently released varnish-4.1.3. I have pushed updates for Fedora, and updated copr builds for epel5, epel6, and epel7.

    varnish-modules-0.9.1 was also released a few weeks ago. I have wrapped it for Fedora, and am waiting for its review in BZ #1324863. Packages for epel5, epel6, and epel7 are in copr as well.

    Fedora updates for varnish-4.1.3 may be found at https://bodhi.fedoraproject.org/updates/?packages=varnish

    The Copr repos for epel are here: https://copr.fedorainfracloud.org/coprs/ingvar/varnish41/

    Test and reports are very welcome.

    Varnish Cache is a powerful and feature rich front side web cache. It is also very fast, and that is, fast as in powered by The Dark Side of the Force. On steroids. And it is Free Software.

    Redpill Linpro is the market leader for professional Open Source and Free Software solutions in the Nordics, though we have customers from all over. For professional managed services, all the way from small web apps, to massive IPv4/IPv6 multi data center media hosting, and everything through container solutions, in-house, cloud, and data center, contact us at www.redpill-linpro.com.

    by Planet Varnish at 2016-08-10 15:45
  • 2016-08-03 17:00 Erika Wolfe

    All this year, Varnish Software has been celebrating the ten-year anniversary of Varnish Cache. One of the best traits of Varnish Cache is its flexibility - and throughout its decade of existence, we have been consistently surprised by the creative ways our users have deployed Varnish. To capture and share with the entire community some of these use cases, we launched the Varnish Awards. We invited Varnish users to submit their stories in two categories, innovation and value, and then empaneled a group of judges to choose the best of the best. The value category award winner will be announced shortly - stay tuned. The winners in each category will share their stories on September 22 at the Varnish Summit in Los Angeles.

    by Varnish Software Blog at 2016-08-03 17:00
  • 2016-07-28 15:15 Mattias Geniar

    The post Varnish Agent: an HTML frontend to manage & monitor your varnish installation appeared first on ma.ttias.be.

    I've been using Varnish for several years, but I only just recently learned of the Varnish Agent. It's a small daemon that can connect to a running Varnish instance to help manipulate it: load new VCLs, see statistics, watch the varnishlog, flush caches, ...

    If you're new to Varnish, this is an easier way of getting started than by learning all the CLI tools.

    Installing Varnish Agent

    The installation is pretty straight forward, assuming you're already using the Varnish repositories.

    $ yum install varnish-agent

    If you don't have the package available in your repositories, clone the source from varnish/vagent2 on Github and compile it yourself.

    After that, start the service and it will bind on port :6085 by default.

    $ systemctl start varnish-agent

    By default, the web interface is protected by a simple HTTP authentication requiring username + password. Those get randomly generated during the installation and you can find them in /etc/varnish/agent_secret.

    $ cat /etc/varnish/agent_secret varnish:yourpass

    After that, browse to $IP:6085, log in and behold Varnish Agent.

    What does Varnish Agent look like?

    To give you an idea, here's a screenshot of the Varnish agent running on this server.

    (As you can see, it's powered by the Bootstrap CSS framework that I also used on this site.)

    A couple of features are worth diving into even further.

    Cache invalidation via Varnish Agent

    One of the very useful features is that the Varnish Agent offers you a simple form to purge the cache for certain URLs. In Varnish terminology, this is called "banning".

    There are limits though: you pass the URL parameters, but you can't (yet?) pass the host. So if you want to ban the URL /index.html, you'll purge it for all the sites on that Varnish instance.

    See cache misses

    Another useful one is the parsing of varnishtop right in the web frontend.

    It instantly shows you which URLs are being fetched from the backend and are thus cache misses. These are probably the URLs or HTTP calls to focus on and see where cacheability can be improved.

    Inline VCL editor

    I consider this a very dangerous feature but a lifesaver at the same time: the web frontend allows you to edit the VCL of Varnish and instantly load it in the running Varnish instance (without losing the cache). If you're hit by a sudden traffic spike or need to quickly manipulate the HTTP requests, having the ability directly modify the Varnish VCL is pretty convenient.

    Important to know is that the VCL configs aren't persisted on disk: they are passed to the running Varnish instance directly, but restarting the server (or the Varnish service) will cause the default .vcl file to be loaded again.

    Varnishstat: statistics, graphs & numbers

    The CLI tool varnishstat shows you number of hits/misses, connections per second, ... from the command line. But it isn't very useful to see historical data. That's usually handled by your monitoring system which fetches those datapoints and shows them in a timeline.

    The Varnish Agent can parse those numbers and show you a (limited) timeline about how they evolved. It looks like this.

    The use case is limited, but it helps for a quick glance of the state of your Varnish instance.

    Conclusion

    While I personally still prefer the command line, I see the benefits of a simple web interface to quickly assess the state of your Varnish instance.

    Having a built-in form to perform cache invalidation is useful and prevents having to create your own varnish URL purger.

    If you're going to run Varnish Agent, make sure to look into firewalling the Varnish Agent port so only you are allowed access.

    The post Varnish Agent: an HTML frontend to manage & monitor your varnish installation appeared first on ma.ttias.be.

    by Mattias Geniar at 2016-07-28 15:15
  • 2016-07-20 16:18 Lasse Karstensen

    Varnish Cache will try to write as much of the response headers and body to the client as fast as it can accept it. We do this using writev() to let the kernel handle this for us, instead of tying up a worker thread for it.

    by Varnish Software Blog at 2016-07-20 16:18
  • 2016-07-11 15:00 rsingh@varnish-software.com (Raj Singh)
    Varnish Software now offers Professional Services within Europe.
    by Varnish Software Blog at 2016-07-11 15:00
  • 2016-07-06 14:30 Erika Wolfe

    Insights from Inside Analysis’s “Caching a wave: Varnish CTO Per Buer Q&A”

    by Varnish Software Blog at 2016-07-06 14:30
  • 2016-07-05 14:30 Reza Naghibi

    Recently I had someone ask me if it's possible to have Varnish Cache support brotli compression. After giving it some thought, my answer was yes, Varnish Cache can serve brotli encoded responses and it can do so without native support for brotli.

    by Varnish Software Blog at 2016-07-05 14:30

Pages