Re: Tomcat Repsonse question...
Hi Christopher, I tried to change JBoss to run on port 80 and seems not to work so I will leave a message on JBoss forumabout how that can be accomplished since there have been others having the same issue with 5.1. I did run a profiler and found out the response time for the ajp connection was 6-7millisecond for the snapshot I took. So bypassing that by using JBoss http directly (without Apache Web Server) seems a valuable test to see if I can meet my goal. Best Regards, -Tony --- On Wed, 10/7/09, Christopher Schultz ch...@christopherschultz.net wrote: From: Christopher Schultz ch...@christopherschultz.net Subject: Re: Tomcat Repsonse question... To: Tomcat Users List users@tomcat.apache.org Date: Wednesday, October 7, 2009, 3:14 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony, On 10/6/2009 1:32 PM, Tony Anecito wrote: I am running JBoss and Apache on the same box so not sure if the TCP/IP stack is bypassed in that case. It's not bypassed, but it skips a lot of steps and does sneaky things like sharing send and receive buffers to dramatically reduce the overhead when communicating with localhost (at least, decent *NIX TCP/IP stacks do this... not sure about any others). What I am trying to do is find out where my bottlenecks are. Tomcat itself is unlikely to be a bottleneck, except where Connectors are concerned. There are several reasons why the connector/threads could be a problem for you: 1. Your webapp is not responding quickly enough, resulting in a pileup of requests. This is obviously not really Tomcat's fault. 2. You have lots of keepalive requests, and the client takes a long time to send secondary requests. In this case, consider using the NIO connector which doesn't allocate a request processing thread until a request has actually been made. 3. You don't have enough request processing threads configured, and you are simply experiencing more traffic than you expected. In this case, your webapp is performing as expected (i.e. well) but you aren't getting the throughput you expect because you are simply limited by your available thread count. If you could explain what you are observing, we might be able to steer you toward a particular course of action. In my code I instrument the response time for my web service and I am below 1msec and if visualvm is right more like 20microseconds response time for the method exposed for my web service. That sounds reasonable, especially if you aren't hitting a database or you already have some data cached. At my Thick client over the lan I am seeing 3-5msec response time using JBoss 4.2.2. So, instrumenting the client gives you 3-5msec for an observed overhead of 2-4msec? Are you using SSL or anything like that? Still localhost? So trying to go from tier to tier to see how fast the tiers are and if there is anything else I can tune. I just updated to JBoss 5.1.0 and am seeing 1msec slower or 4-5msec but have not tuned it yet except for jvm settings. Hmm... I am using ajp for the connector. I plan to upgrade my Apache web server soon to the latest version hoping for performance improvement for the ajp connector. If performance is what you're after, ditch httpd and go straight to Tomcat. Do you have a requirement to use httpd our front? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrNBKgACgkQ9CaO5/Lv0PDfgwCgvgKOLHRAl5+JpS7+aqsFytJN C+gAnRRnxwliEkVBzYy73l7gpvT3+V0z =axGy -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Repsonse question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony, On 10/6/2009 1:32 PM, Tony Anecito wrote: I am running JBoss and Apache on the same box so not sure if the TCP/IP stack is bypassed in that case. It's not bypassed, but it skips a lot of steps and does sneaky things like sharing send and receive buffers to dramatically reduce the overhead when communicating with localhost (at least, decent *NIX TCP/IP stacks do this... not sure about any others). What I am trying to do is find out where my bottlenecks are. Tomcat itself is unlikely to be a bottleneck, except where Connectors are concerned. There are several reasons why the connector/threads could be a problem for you: 1. Your webapp is not responding quickly enough, resulting in a pileup of requests. This is obviously not really Tomcat's fault. 2. You have lots of keepalive requests, and the client takes a long time to send secondary requests. In this case, consider using the NIO connector which doesn't allocate a request processing thread until a request has actually been made. 3. You don't have enough request processing threads configured, and you are simply experiencing more traffic than you expected. In this case, your webapp is performing as expected (i.e. well) but you aren't getting the throughput you expect because you are simply limited by your available thread count. If you could explain what you are observing, we might be able to steer you toward a particular course of action. In my code I instrument the response time for my web service and I am below 1msec and if visualvm is right more like 20microseconds response time for the method exposed for my web service. That sounds reasonable, especially if you aren't hitting a database or you already have some data cached. At my Thick client over the lan I am seeing 3-5msec response time using JBoss 4.2.2. So, instrumenting the client gives you 3-5msec for an observed overhead of 2-4msec? Are you using SSL or anything like that? Still localhost? So trying to go from tier to tier to see how fast the tiers are and if there is anything else I can tune. I just updated to JBoss 5.1.0 and am seeing 1msec slower or 4-5msec but have not tuned it yet except for jvm settings. Hmm... I am using ajp for the connector. I plan to upgrade my Apache web server soon to the latest version hoping for performance improvement for the ajp connector. If performance is what you're after, ditch httpd and go straight to Tomcat. Do you have a requirement to use httpd our front? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrNBKgACgkQ9CaO5/Lv0PDfgwCgvgKOLHRAl5+JpS7+aqsFytJN C+gAnRRnxwliEkVBzYy73l7gpvT3+V0z =axGy -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Repsonse question...
Thanks Christopher for the reply, I am using Apache Web server for the front end to serve my html requests. I have thought about using JBoss with it's Tomcat as the front end Apache as the back end for handling ordinary http requests but have not found anyone who has done that. This is so I use the standard port 80 for requests over the internet. I think I narrowed down most of the time to calls by web start on the client side for permissions check for every request. I left a forum message on java.net about it and hope to get an answer. Web start does do keep-alive requests I believe so maybe that is something to consider. My goal is to see if I can get response times over the lan under 1msec using standard cheap hardware and open source software. I am close to my 1msec goal (measured at the client) and know if I upgrade my old AMD64 5200+ I use for my server to say a Phenom II quad say a 955 I might be able to pull it off. So right now by tier. Client PC: 4-5msec measured after message received from JAX-WS proxy in code. Apache: logs 0 microsecond (running on windows so suspect 15msec accuracy from timers even though microsecond resolution expected in Apache logs) Tomcat: 20 microseconds response time measured at web service method called by client. I am using cache at this tier. For those results client/Apache/Tomcat(Jboss) are on same physical PC. If I try from another client on lan I get the same response time at the client. Thus routers/switches (1Gbps) are not noticable from response time perspective right now. I hope this helps answer your question. Best Regards, -Tony --- On Wed, 10/7/09, Christopher Schultz ch...@christopherschultz.net wrote: From: Christopher Schultz ch...@christopherschultz.net Subject: Re: Tomcat Repsonse question... To: Tomcat Users List users@tomcat.apache.org Date: Wednesday, October 7, 2009, 3:14 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony, On 10/6/2009 1:32 PM, Tony Anecito wrote: I am running JBoss and Apache on the same box so not sure if the TCP/IP stack is bypassed in that case. It's not bypassed, but it skips a lot of steps and does sneaky things like sharing send and receive buffers to dramatically reduce the overhead when communicating with localhost (at least, decent *NIX TCP/IP stacks do this... not sure about any others). What I am trying to do is find out where my bottlenecks are. Tomcat itself is unlikely to be a bottleneck, except where Connectors are concerned. There are several reasons why the connector/threads could be a problem for you: 1. Your webapp is not responding quickly enough, resulting in a pileup of requests. This is obviously not really Tomcat's fault. 2. You have lots of keepalive requests, and the client takes a long time to send secondary requests. In this case, consider using the NIO connector which doesn't allocate a request processing thread until a request has actually been made. 3. You don't have enough request processing threads configured, and you are simply experiencing more traffic than you expected. In this case, your webapp is performing as expected (i.e. well) but you aren't getting the throughput you expect because you are simply limited by your available thread count. If you could explain what you are observing, we might be able to steer you toward a particular course of action. In my code I instrument the response time for my web service and I am below 1msec and if visualvm is right more like 20microseconds response time for the method exposed for my web service. That sounds reasonable, especially if you aren't hitting a database or you already have some data cached. At my Thick client over the lan I am seeing 3-5msec response time using JBoss 4.2.2. So, instrumenting the client gives you 3-5msec for an observed overhead of 2-4msec? Are you using SSL or anything like that? Still localhost? So trying to go from tier to tier to see how fast the tiers are and if there is anything else I can tune. I just updated to JBoss 5.1.0 and am seeing 1msec slower or 4-5msec but have not tuned it yet except for jvm settings. Hmm... I am using ajp for the connector. I plan to upgrade my Apache web server soon to the latest version hoping for performance improvement for the ajp connector. If performance is what you're after, ditch httpd and go straight to Tomcat. Do you have a requirement to use httpd our front? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrNBKgACgkQ9CaO5/Lv0PDfgwCgvgKOLHRAl5+JpS7+aqsFytJN C+gAnRRnxwliEkVBzYy73l7gpvT3+V0z =axGy -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h
RE: Tomcat Repsonse question...
From: Tony Anecito [mailto:adanec...@yahoo.com] Subject: Re: Tomcat Repsonse question... I am using Apache Web server for the front end to serve my html requests. I have thought about using JBoss with it's Tomcat as the front end Apache as the back end for handling ordinary http requests but have not found anyone who has done that. This is so I use the standard port 80 for requests over the internet. Again, you can simply eliminate httpd, and let JBoss/Tomcat service the static html requests. Configure the HTTP Connector in JBoss/Tomcat to use port 80, and put your static content under Tomcat's appBase directory. That will eliminate some of the latency you're observing. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Repsonse question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony, On 10/7/2009 8:16 PM, Tony Anecito wrote: I am using Apache Web server for the front end to serve my html requests. Why? Tomcat can serve those requests quite well. I have thought about using JBoss with it's Tomcat as the front end Apache as the back end for handling ordinary http requests but have not found anyone who has done that. That's because it would be silly to do that. Just use tcnative with sendFile enabled on your HTTP Connector: it's the same as back-ending (whatever that means) Tomcat with Apache httpd. This is so I use the standard port 80 for requests over the internet. Tomcat can use port 80 just fine. http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_priviledges.3F (Please ignore the misspelling of privileges) Web start does do keep-alive requests I believe so maybe that is something to consider. Why would Java WebStart send keep-alive requests? Doesn't it just download a Java application and run it on the client side? Continued communication with the server just seems ... completely unnecessary. My goal is to see if I can get response times over the lan under 1msec using standard cheap hardware and open source software. How fast is your LAN? Using standard ping over a 802.11g network, I get response times around 3/4ms, and that's just to the TCP/IP stack and back. You are talking about adding HTTP protocol decoding, request delegation, and your webapp's code in under 1/4ms? That seems like a stretch unless your web application is pretty much doing nothing. I am close to my 1msec goal (measured at the client) and know if I upgrade my old AMD64 5200+ I use for my server to say a Phenom II quad say a 955 I might be able to pull it off. Ha ha ha. Yes, buying more hardware will (usually) improve your performance, but I suspect the network is the largest contributor to your observed latency, and you can only get Ethernet to go so fast. Client PC: 4-5msec measured after message received from JAX-WS proxy in code. Ha! You're running an XML web service on top of all this? If you are worried about performance, why did you bother with web services at all? ;) Apache: logs 0 microsecond (running on windows so suspect 15msec accuracy from timers even though microsecond resolution expected in Apache logs) win32 timers are horrible: I wouldn't trust them to more than 1/2sec accuracy. Tomcat: 20 microseconds response time measured at web service method called by client. I am using cache at this tier. Again, if measuring on win32, you may be looking at timing lies. For those results client/Apache/Tomcat(Jboss) are on same physical PC. If I try from another client on lan I get the same response time at the client. Thus routers/switches (1Gbps) are not noticable from response time perspective right now. I disagree: if you are saying that localhost is as fast as a gigabit network, then the numbers you are seeing simply can't be right, especially when you're talking about the millisecond and microsecond level. I don't think we can really help you, other than to suggest that you switch to UDP, write your code in C, only use 32-bit little-endian data types, and use a binary protocol that amounts to memory dumping data using C data structures. XML web services... ha ha ha. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrNZRwACgkQ9CaO5/Lv0PAWiwCgw5ZGcg/FIR57mlMffy/We7hD /10AniPV+ZQkILGKkQdVZRKv/p1lrEb/ =IABV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Repsonse question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony, On 10/4/2009 10:13 PM, Tony Anecito wrote: What class method for Tomcat would show the response time? I am using the jvirtualvm to profile the code (simplest and easy to use) but I need to know the name/method that would be closest to the socket to get an idea how fast the container/app is. Look at the AccessLogValve that comes with Tomcat. That's the most user-servicable component that can get you what you need. If you want to instrument Tomcat itself, you'll probably have to look at modifying whatever Connector you are using (HTTP, AJP, etc.). If you want to go bare-metal, you can always attach a packet sniffer to the TCP port and time everything. For that, you'll want Wireshark or even libpcap if you don't really care about navigating the packets in a convenient way. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrLbyoACgkQ9CaO5/Lv0PCfVgCguD7vWRm9NMS/xBAQIihOoqg1 8doAni7anMwGEMtB3GOvo9oNz5sPWS3V =X5vg -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Repsonse question...
Thnaks Chritopher. I am running JBoss and Apache on the same box so not sure if the TCP/IP stack is bypassed in that case. What I am trying to do is find out where my bottlenecks are. In my code I instrument the response time for my web service and I am below 1msec and if visualvm is right more like 20microseconds response time for the method exposed for my web service. At my Thick client over the lan I am seeing 3-5msec response time using JBoss 4.2.2. So trying to go from tier to tier to see how fast the tiers are and if there is anything else I can tune. I just updated to JBoss 5.1.0 and am seeing 1msec slower or 4-5msec but have not tuned it yet except for jvm settings. I am using ajp for the connector. I plan to upgrade my Apache web server soon to the latest version hoping for performance improvement for the ajp connector. I will look into what you mentioned. Best Regards, -Tony --- On Tue, 10/6/09, Christopher Schultz ch...@christopherschultz.net wrote: From: Christopher Schultz ch...@christopherschultz.net Subject: Re: Tomcat Repsonse question... To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, October 6, 2009, 10:24 AM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony, On 10/4/2009 10:13 PM, Tony Anecito wrote: What class method for Tomcat would show the response time? I am using the jvirtualvm to profile the code (simplest and easy to use) but I need to know the name/method that would be closest to the socket to get an idea how fast the container/app is. Look at the AccessLogValve that comes with Tomcat. That's the most user-servicable component that can get you what you need. If you want to instrument Tomcat itself, you'll probably have to look at modifying whatever Connector you are using (HTTP, AJP, etc.). If you want to go bare-metal, you can always attach a packet sniffer to the TCP port and time everything. For that, you'll want Wireshark or even libpcap if you don't really care about navigating the packets in a convenient way. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrLbyoACgkQ9CaO5/Lv0PCfVgCguD7vWRm9NMS/xBAQIihOoqg1 8doAni7anMwGEMtB3GOvo9oNz5sPWS3V =X5vg -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat Repsonse question...
Hi All, What class method for Tomcat would show the response time? I am using the jvirtualvm to profile the code (simplest and easy to use) but I need to know the name/method that would be closest to the socket to get an idea how fast the container/app is. Thanks, -Tony - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org