Apache / Lighttpd for load Balancing

ajpapache-2.2lighttpdload balancing

What do you think about lighttpd for AJP load Balancing?

I use Apache and mod_jk for this, it works fine. What would be the benefit of switching apache to lighttpd?

What software use to load balance J2EE applications? Hardware load balancer?

Thank you!

Best Answer

I use Apache and mod_jk for this, it works fine. What would be the benefit of switching apache to lighttpd?

If it ain't broke, don't fix it. The benefits of switching to Lighttpd are mostly performance; Lighttpd requires less CPU/RAM to do the same work as Apache. It can also be easier to set up, but since you already have Apache running, that is a non-issue for you.

I disagree with Andy on the security issue; Apache 2 has had more reported security issues than Lighttpd, but most of them would be in modules you wouldn't compile in for load balancing, and Apache is good at quickly releasing fixes for their security issues. Lighttpd is getting much less security scrutiny than Apache, so it may have more un-publicized issues that we don't know of. It is an apples to oranges comparison...

Today Lighttpd is loosing momentum IMHO. Since its author landed a job at MySQL, and started working on MySQL proxy, the frequency of releases of Lighttpd has gone down. My gut feeling is that most new installations of event-driven open source HTTP servers are using nginx now. See the english language wiki for an overview of nginx.

For gratis open-source load balancing, I believe the largest installed base is for HAProxy and nginx now. It is hard to come up with numbers, as public surveys such as Netcraft cannot detect backend load balancers, but this is my gut feeling based on the blog posts that I see.

Note that both nginx and HAProxy cannot do Apache JServ Protocol proxying. nginx can do HTTP and FastCGI and maybe a few more, and HAProxy is HTTP only. Thus you would have to switch to HTTP output from the application server.

My recommendation would be to stay put on Apache, unless you have a specific functionality need that Apache does not solve for you.