You can impove significantly by recognizing simularities between requests. If some of the 'n' record and building the XML from them are the same for requesting each client, a new request will initiate the whole processing again while you hust might have done the work a second ealier. If the result would have been chached, the repsonse for the query would have been fast and without asking tomcat/database to process the request. So you have two benefits. The reponse is faster and the load on the backend system reduces.
Try put a Squid cache in web accelerator mode (better known as reverse proxying), binding to port 80, in front of apache and let it cache only in memory. Each client then connectect like this: Squid -> Apache -> Tomcat -> Database If the request has been handled before and the result is know, squid will return the result at once so the request will nog even be seen by Tomcat and the database. Apart from the overhead, this will come very close to the same reponse times for 1 client of m clients. Please note that in order for this construct to work, the data must be stateless! The result of the request must be valid for a fixed amount of time, lets say 5 minutes, in order for the caching to be helpfull. In general the higher the TTL of a request can be set, the better the reverse proxy will work. Wouter -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 11 December, 2001 10:22 To: [EMAIL PROTECTED] Subject: Help: 4 clients vs 1 client Hello, The system of my company consists of an Apache + Tomcat 3.2 server and a database server. An application is being developed, it involves calling a tomcat servlet which retrieves records from the database server and then use the records to build an XML. I've tested the times required to run from 1000 to 20000 records for a single client, and then tested the times for 4 clients. I found that the average time needed for 4 clients to build the XML with 'n' records is always similar to the time needed for a single client to build with '4n' records(excluding the time to fetch the database). Is this pattern reasonable? My boss suggests that 4 clients to build 'n' records should be similar to a single client to build 'n' records as servlets involve some kinds of threading mechanism. If it is true, what are the means to improve to get a better pattern? Please give me some opinions, thanks. McMug -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]> -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
