New Blog Engine: NGINX & Node.js
I’ve been relying on Apache and PHP for a very long time, and they have served me well. However, they do have disadvantages, and I feel that I need to keep up with new technologies in order to further my knowledge. Apache is built with old paradigms to handle concurrency, it uses one thread per connection. Thread is expensive, especially for a constrained environment like a web server. So, when there’s another platform which offer high concurency with a fixed size of thread pool, I’m sold.
Enter NGINX (read: engine-x). It uses a limited size of thread pool, so it will never create unlimited number of threads. It uses a non-blocking model instead of the traditional blocking model which Apache uses (which is why they need one thread per connection in the first place). The only disadvantage it has is the lack of support compared to Apache. To use php on NGINX, you need to go the extra mile. But PHP is also reliant on old paradigms. It’s still based on a file system structure, it still use one thread per execution of a script (which negates the benefit of NGINX), and it’s painfuly slow. So, now what?
That’s all. As always, happy blogging!