mercredi 9 mai 2018

Why using nginx as the load balancer for your production is really, really not a good idea.

As a freelance developer, I've stumbled upon this situation in various projects, and I want to publicly explain once and for all why the free version of nginx is not ok to use for production load balancing (LB). Here is why.

Let's first note that "health checks"(HC) are *not* available in the free version of nginx, only in the paid version. Using a LB without HC is really not ok for production, and I will now explain why.

Let's suppose you use nginx as a LB to distribute requests between 2 backends, with default parameters for the LB, typically max_fails=1 fail_timeout=10s.

Now let's suppose one of the backends becomes unresponsive. Typically nothing can connect to it, even your SSH client: trying to connect to it takes forever every time, and you eventually get a timeout somehow. This is not a fantasy, this happened to me yesterday in production. These things happen with servers. And suppose the unresponsive backend stays like this for several hours. What happens?

The LB nginx will consider the unresponsive backend as unavailable and stop sending requests to it. It will send all requests to the healthy backend only. Wait...  not really! Every 10s (fail_timeout) it will test whether the unresponsive backend is "back online" by sending a *real* request (from a real user of your app) to the unresponsive backend and see how it goes. It has to use a real request for this purpose, because HC, which are the exact tool for this job, are not available in the free version of nginx.

The LB nginx will wait 60 seconds (default value of proxy_connect_timeout) before deciding that the unresponsive backend will not be available to answer the real request, and then send this request to the healthy backend and eventually answer the user. From the point of view of your user, the page will load ok (HTTP code 200 OK) but will have taken 60 seconds to load!

They are ways to improve this, and I am working on them in my current project, but frankly it is is clumsy and just a bad solution to a real problem. A good solution would be to use the paying version of Nginx which offers HC, or just to use the right tool for the job which is IMHO HAProxy.

TL;DR If you are ok with having, every 10 seconds, one user wait 60 seconds for your app to load, during the several hours when one of your backend is unresponsive, be my guest and use the free version of nginx as a load balancer in production. Otherwise don't.

samedi 24 mars 2018

Fixed my Xpress M2026 Samsung laser printer which was no longer grabbing paper from the tray.

Just opened it, and cleaned up the two gray little rubber rolls (supposed to tract the paper inside and up) using some alcohol wipes (the same you use to clean eyeglasses). Awesome!

dimanche 11 mars 2018

Fixed my aiport extreme 6th generation annoying noise

by simply applying compressed air spray into its small openings. Did not even have to open it!

The paradox between stress and productivity.

I thought for so long that being hyperactive was linked to being productive. How wrong was I!



Actually it turns out that being hyperactive generates a lot of stress (cortisol) and ultimately leads you to burnout.



However if you listen to relaxing music while working, you eliminate the cortisol (stress) generated by your work in a continuous way, which means that at the end you are very productive in a stable way!



I was astonished when I experimented this theory on myself to see how true this is!

dimanche 24 mai 2015

Setting up Whirligig on Mac OS

This was not that easy to install Whirligig on my Macbook pro 13" mid 2010 to watch 3d movies with Oculus Rift DK2.



First, you have to install unity. This will take hours...



Then, rename the extracted folder "Whirligig.app-SDK v0.4.3" to "Whirligig.app".

Then, you have to use terminal to go inside the package and "chmod 755" the executable file inside Contents/MacOS. Now it works! \o/

samedi 23 mai 2015

Where can I try the Oculus Rift DK2 for free in Barcelona, Spain ?

Actually it will not be free but cost you a few euros, still totally worth it :)



I was looking for places in Barcelona to try the Oculus Rift Developer Kit 2 (DK2) and I stumbled upon this thread:



Alguien sabe donde puedo probar el Oculus Rift en Barcelona o alrededores?

Alguien sabe donde puedo probar el Oculus Rift en Barcelona o alrededores?:



Actually, as of May 22th 2015, the Oculus Rift at Gaming247 is broken. They should get it repaired in a few days/weeks you can call them, see their contact page: http://www.247gaming.es/contacto/



Today May 23th 2015 I have had my first ever Oculus Rift experience :-)) Thanks to the New Park Bowling inside the "La Maquinista" mall. If you want to check before you go there, here is their contact page: http://www.newparkbowling.com/localizacion.asp#Final



Have fun there! :)




mardi 18 novembre 2014

Upgrading to Yosemite broke my bootcamp Windows XP dual boot...

I just upgraded my secondary macbook pro from Mac OS X Snow Leopard (10.6.8) to Yosemite (10.10). One big issue was that I lost my bootcamp Windows XP dual boot.

Here is how I fixed it, in case this helps anybody.

What I had was a Bootcamp partition with Windows XP sitting next to my normal Mac OS X partition. A dual boot was working thanks to rEFIt.

After the upgrade, the dual boot menu at boot time just disappeared for good. Moreover, the NTFS-3G driver broke as well. However I could see in Disk Utility that the Windows XP partition was still there, even if I could not read it anymore because NTFS-3G was broken.

Well, simply installing the most recent rEFInd 0.8.3 did the trick! No need to add a "--all-drivers", the default "./install.sh" worked just fine. After reboot, a rEFInd menu was back and I could again boot my Windows XP. Cool! :-)

By the way, I know that the last version of Bootcamp which supports Windows XP is 3.2.