Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is it better to have Jetty or Apache as a Webserver for GIS stack?

share|improve this question

3 Answers 3

up vote 11 down vote accepted

you can find very detailed information about Jetty and Apache httpd (from http://wiki.eclipse.org/). i think you should decide what you want from a web server more precisely according to the expectations.

Apache httpd is a HTTP server written in C, that is often used to front other web services. Jetty is a full functional and optimized HTTP server and has no need of an apache httpd instance between it and the internet. However, deployers often want to place an instance of apache between Jetty and the internet for some of the following "reasons":

Performance. Apache Httpd does have slightly superior performance to jetty for pure HTTP request handling. However, for dynamic response generation, apache must pass the request to another process and the resulting double handling reduces the total throughput to less than direct requests to Jetty. More over, with the advent of comet style web applications, long held requests are common and the apache thread model assigns a thread per outstanding request, so apache does not scale to large numbers of comet connections.

Static content. Apache Httpd is very good at serving static content fast. However, Jetty is no slouch either as it can use direct memory mapped buffers for static content, so that only kernel space is used for the data transfer. Besides, if your application has a lot of static content, then you will get much better results by either ensuring good client caching or serving the content from an CDNS edge cache.

Security. Some believe that apache gives them a more secure solution as there are no TCP/IP connections terminating on Jetty. However, since Jetty is written in Java, it is not vulnerable to the class of security exploit that a server written in C is. Jetty has a good security record, but has had some past issues, but mostly of the nature that would not have been helped by a fronting instance of Apache.

Load Balancing. Apache has several options for load balancing between multiple servlet servers. These solutions are reasonable, but there are better software and appliance load balancers available. The main limitation of apache as a load balancer is that it's threading model is not-asynchronous, so scaling is limited (specially for comet traffic).

Administration. Often an enterprise has staff who are very familiar with apache and thus have a strong preference to deploy everything behind apache. This can be a good reason to avoid chaos in a deployment environment, so long as some of the performance and scalability limitations do not affect your web application.

i hope it helps you...

share|improve this answer
    
Very good and detailed explanation !!! thanks –  Sunil Jan 4 '13 at 8:02
1  
As aways your answer is clean and detailed. Thanks @Aragon. –  Magno C Jan 4 '13 at 10:59
    
you're welcome. my only wish to share something useful for people. :) –  Aragon Jan 4 '13 at 11:32
    
So nither are superior than other, however Apache seems to attract more crowd then Jetty I guess. :) I will go with Apache and setup my GIS stack. Thanks Aragon! –  doNotCheckMyBlog Jan 4 '13 at 23:44

I only find sense in using Jetty, Tomcat or the like when the middleware you are going to use is Java based (GeoServer). Otherwise, a HTTP server like Apache is, in my opinion, a better solution.

As pointed in another response, one of the pros of Apache is that in many workplaces there is staff already used to work with this HTTP server. In case you have the freedom to choose another HTTP server, I would give a try to nginx or lighttpd, both open source and ready to be used in heavy-load production environments.

These HTTP servers typically demand much less RAM memory and CPU than Apache. Another advantage is that they are easier to configure; I find Apache configuration barroque.

Personally I have used lighttpd to set up several GIS based on MapServer, and the results have been satisfactory.

share|improve this answer
    
Thanks dariapra. Nice insights and notes for my future GIS setups :) –  doNotCheckMyBlog Feb 18 '13 at 7:06

Jetty is way better in performance and concurrency serving.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.