问题
I'm hesitating to deploy Apache Solr to Jetty or Apache Tomcat. I know that Jetty is lignter than Tomcat and that Tomcat is more robust when there is a lot of queries coming.
So I need to know why Solr have chosen Jetty as its default Servlet container? maybe that can help me to choose between the two of them.
回答1:
Probably it is because it is "light" and can be easily embedded on the Solr distribution... so you can immediately have a running Solr server without requiring any other Servlet container (such as Tomcat, etc.). In terms of performance, not sure there will be such a big difference. Probably this depends on your own setup, for example in "development" I use Jetty, in production I use Tomcat, since I already am using it for other applications...
回答2:
Jetty is often used as a default stand-alone servlet container in various project because it is light and easy to use.
You can see the list of projects using Jetty by default here: http://www.eclipse.org/jetty/powered/
回答3:
I understand from this thread that it's adviced to use Jetty cause it's the one shipped with Solr, and the one they have tested against: What are some Servlet Container pros and cons for a Solr installation?.
来源:https://stackoverflow.com/questions/17790117/why-have-apache-solr-chosen-jetty-as-a-servlet-container