I mentioned before how good varnish is, and it is true, it is a fantastic customizable cache which you can serve a bunch of your websites traffic straight out of memory.
The lure of more speed and getting an immediate result might make you want to Google search and copy and paste. This is a great way to have no idea what is going on with your varnish configuration, and to that end not only have a sub-optimal to disastrous result; but you definitely will have very little chance of fixing your configuration when a problem is revealed.
Varnish does pretty much exactly what you tell it to do, and if you copy someone's configuration you will have varnish doing what is right for their particular use case, or worse yet it never worked for them either. So the best way to get a good handle on what is going on is to start from scratch with your own configuration, use varnishtest and ensure that everything happens as you expect it to. Test it before it goes to production on staging environments and pay special attention to varnishlog, varnishstat and varnishtop. These are pretty neat tools that organize the same information in different ways.
Use the varnish book to figure out what is going on with varnish, seriously this resource is invaluable and when we at GR set up our first vcl this is where almost all of the knowledge was gained.
As I post more about varnish and how it can scale your web application I will not normally post configurations, because of the risk of it being copied and pasted. So, if you are adding severe speed to your web application take the time to make the configuration good, exactly what you need and varnish will reward you for it.
No comments:
Post a Comment