File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Implementing filters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Implementing filters" Watch "Implementing filters" New topic

Implementing filters

Sita Kodali
Ranch Hand

Joined: Dec 02, 2001
Posts: 72
I am in a situation where I have to choose between a devil and deep see J
The situation is I have 200 users connecting to my http server (maximum users may go upto 300-500). Due to licensing issues and economical thingies, we have decided to use latest versions of Linux+Apache+Postgresql+Tomcat. Ported the database from MSSQL 2000 successfully and with little modifications my system works just fine on new setup (Thanks to java, I don’t need to change any of my Servlets, jsp or beans)
Now comes the choice issue - We have some homemade ISAPI filters sitting on top of IIS on Win2K policing every request and determine what to serve. Equivalent to this are Apache modules where we have no expertise to get our hands dirty and customize readily available apache filters such as mod_filter, mod_tracker etc. The way out – Timely introduced filters in Servlet 2.3 – They came as a savior. I wanted to adopt them quickly and boot out apache as a middleman and make Tomcat 4.x as a stand alone server. This gives me ability to write my filters to police every request as ISAPI filters and perform whatever we were doing with ISAPI filters.
My concerns here are summarized as below:
1.Removing Apache as a http server will have any adverse effect on performance and is it scalable in case concurrent users go upto 500 or over. (Precisely can Tomcat 4.0 alone handle the load for static as well as dynamic content?)
2.Is it a good solution to depend on Tomcat 4.0 without a http server to serve static content if concurrent users are restricted to a maximum of 300
Any advice from experts and gurus are highly appreciated.
(Don't fume - I am aware that there exists a topic for Apache/Tomcat. But looking at the level of posts there, I have decided to do it here as experts are flocking here this week )
[ April 23, 2002: Message edited by: sita kodali ]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Really, now. Just because there are more postings in THIS forum doesn't mean you'll get better service than in the Apache/Tomcat one!
Short answer: If you are primarily serving active content, Apache is actually going to be a performance drag, since servlet requests have to go through an extra layer. Apache is preferred primarily if you have lots of static content like pictures, audio, animations or long HTML-only pages.
Another possiblity is to use Apache 2.0 and convert your ISAPI stuff to its Apache equivalents.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Implementing filters
It's not a secret anymore!