Archive for the ‘ Administration ’ Category

A Practical Guide to Varnish – Why Varnish Matters

A Practical Guide to Varnish – Why Varnish Matters

What is Varnish?

Varnish is an open source, high performance http accelerator that sits in front of a web stack and caches pages.  This caching layer is very configurable and can be used for both static and dynamic content.

One great thing about Varnish is that it can improve the performance of your website without requiring any code changes.  If you haven’t heard of Varnish (or have heard of it, but haven’t used it), please read on.  Adding Varnish to your stack can be completely noninvasive, but if you tweak your stack to play along with some of varnish’s more advanced features, you’ll be able to increase performance by orders of magnitude.

Some of the high profile companies using Varnish include: TwitterFacebookHeroku and LinkedIn.

Our Use Case

One of Factual’s first high profile projects was Newsweek’s “America’s Best High Schools: The List”. After realizing that we had only a few weeks to increase our throughput by tenfold, we looked into a few options. We decided to go with Varnish because it was noninvasive, extremely fast and battlefield tested by other companies. The result yielded a system that performed 15 times faster and a successful launch that hit the front page of  Varnish now plays a major role in our stack and we’re looking to implement more performance tweaks designed with Varnish in mind.

A Simple Use Case

The easiest and safest way to add Varnish to your stack is to serve and cache static content.  Aside from using a CDN, Varnish is probably the next best thing that you can use for free.  However, dynamic content is where you can squeeze real performance out of your stack if you know where and how to use it.  This guide will only scratch the surface on how Varnish can drastically improve performance.  Advanced features such as edge side includes and header manipulation allow you to leverage Varnish for even higher throughput.  Hopefully, we’ll get to more of these advanced features in future blog posts, but for now, we’ll just give you an introduction.

CouchDB – New Features in Replication

CouchOne – Blog – What’s new in Apache CouchDB 0.11 — Part Three: New Features in Replication.

Afficher l'image en taille réelle

Without a doubt, replication is CouchDB’s coolest feature. It allows you to synchronise any two databases, local or remote. There is no role-distinction between databases, no master-slave limitations, everybody is a master (if you want master-slave, simply don’t write to one master and thus make it a slave).

This allows you to build a replication infrastructure that fits your application and deployment needs best: two offices with an ocean in between, no problem; large server cluster in one or more data centres, no problem. And anything in between really.

Replication is not new, it has been baked into CouchDB from the beginning. Today, I’ll show you some of the nifty features we added to the 0.11 replicator to make your life a little easier.

To recap, here is how you trigger replication from CouchDB running on your local machine to synchronise a local database with a remote database:

curl -X POST 
-d '{"source":"database", 

Note: The backslash means “keep reading the command on the next line” to make things more readable and so you can copy and paste the commands into your command line.

Update 05.12.2010: From CouchDB 1.0 on you need to send the correct content type, just add -H 'Content-Type: application/json' to the command line.

If you want to read up on CouchDB replication, check out the chapters Replication and Conflict Management from our book, CouchDB: The Definitive Guide.

Implicitly Create Target Database

This is a small yet useful tip. Prior to 0.11, if you wanted to replicate, the target database would have to exist. This can be a mild annoyance at times, so we added a replicator option to implicitly create target databases, if they don’t exist.

Using it is easy, here’s the curl command:

curl -X POST 
-d '{"source":"database", 

Professional Apache Tomcat 6 (Part 1)

[issuu viewmode=presentation showflipbtn=true documentid=080319061418-0e21aa3f251f4eeea9f71278021708d9 docname=professional_apache_tomcat_6_part_1 username=abdagli loadinginfotext=Professional%20Apache%20Tomcat%206%20(Part%201) showhtmllink=true tag=6 width=650 height=780 unit=px]

Direct Link to part 1
Direct Link to part 2