writing keepalived MISC_CHECKS

In some projects, I’m using Keepalived for failover using VRRP and load balancing managing IPVS.

Normally it’s my default choice for any new architecture, only if it’s not possible to have layer-4 load balancing because of some requirement, like for example real servers talking to virtual servers on the same subnet.

Read More

simulate basic ESI using NGINX and SSI

Some people may have used ESI or at least heard something about it, but if this is a new term for you, ESI is a feature that allows you to have different caching policies for “slices” of a page or no cache at all.

For example, if you want to cache your main page for one hour, but it is not possible because you have a slice on your page that can’t be cached because it has user information, today is your luck day, ESI permits you to accomplish this task.

Read More

Disable NGINX cache based on cookies

Caching of dynamic content is difficult and invalidation of cache even more difficult, maybe you already heard Phil Karlton’s wise saying

There are only two hard things in Computer Science: Cache invalidation and naming things.

Read More

Avoid caching 0-byte files on NGINX

Some people, including myself, had problems with some applications misbehaving and sending empty outputs (hello PHP, I’m talking to you!).

The problem is even worse if you have a cache in front of your frontends and this empty page gets cached, your cache will send empty output until it expires or be purged.

Read More

NGINX "cache purge" emulation

I’m not a big fan of building my binaries with custom patching. Usually, I try to avoid as much as possible, maybe is some trauma from my past qmail days.

Looking for a way of purging cache items on NGINX without adding a patch to it, I found some options like https://github.com/perusio/nginx-cache-purge, which is a good solution, but for a cache with a large number of files can be expensive.

Read More