Re: CPU usage with APR and connectionTimeout impact
Funny, according to the documentation there exists no connectionTimeout attribute for the apr connector. Setting the value to '0' could mean all sorts of behavior, no way to know for sure short of checking the code. (it could mean the connector will not wait for the uri line at all) I can't comment about a correct value for your application. Setting it to a low value will have the connector thread return to the pool faster on connections where the peer has gone to lunch after the initial connection. This only matters if you have a large number of such peers. I'm sure one of the veterans here can clear this up for you. Hello, In my project, we are using Tomcat 6.0.18, with APR 1.2.12 and tc native 1.1.14 on an Redhat OS (Linux kernel 2.6.18). There is a behavior that I can't explain: -with connectionTimeout=0, the process tomcat uses a huge percentage of CPU, even if there is no traffic. but we doesn't observe any problem and the response time is good. -with connectionTimeout=5000, the process tomcat uses a normal percentage of CPU, when there is no traffic. -without APR and with connectionTimeout=0, the process tomcat uses a normal percentage of CPU when there is no traffic. After different searches on the web, tomcat manual and mailing lists, I don't find the reason of the link between CPU usage and connectionTimeout/keepAliveTimeout with APR. With the previous release of Tomcat (5.5) and APR, we have a similar CPU usage (without traffic, high CPU load) and when we modify another parameter (firstReadTimeout), the behavior also changes in the same way. I know there is no real trouble, but I'm curious and prudent: I don't like to do something, when I don't understand what is hidden behind. Could somebody explain to me why Tomcat/APR has these behaviors? Is there a performance risk to set connectionTimeout to 5000? Thank you for your answers. Yann - 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: CPU usage with APR and connectionTimeout impact
From: Taylan Develioglu [mailto:tdevelio...@ebuddy.com] Subject: Re: CPU usage with APR and connectionTimeout impact according to the documentation there exists no connectionTimeout attribute for the apr connector. Which documentation is that? Note that the HTTP connector attributes apply when running in APR mode. Quoting from the APR-specific doc: The following attributes are supported in the HTTP APR connector in addition to the ones supported in the regular HTTP connector: What's not clear in the doc is that many of the HTTP attributes also apply to the NIO version of the protocol handler. - 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: CPU usage with APR and connectionTimeout impact
Hello, The parameters connectionTimeout and keepAliveTimeout are not on the APR side. They are attributes of AJP and HTTP connectors. Setting the value to 0 means no timeout (according to some mail exchange I found in tomcat mailing list). No timeout is default value of this attribute. My question is also: why a connector attribute has a so subtential impact on tomcat cpu usage, when APR is used? And for the peers going to lunch after the initial connection, it's true: we have a large number of such peers. Thank you for your help. And the help of one of the veterans will be very appreciated. Regards Taylan Develioglu a écrit : Funny, according to the documentation there exists no connectionTimeout attribute for the apr connector. Setting the value to '0' could mean all sorts of behavior, no way to know for sure short of checking the code. (it could mean the connector will not wait for the uri line at all) I can't comment about a correct value for your application. Setting it to a low value will have the connector thread return to the pool faster on connections where the peer has gone to lunch after the initial connection. This only matters if you have a large number of such peers. I'm sure one of the veterans here can clear this up for you. Hello, In my project, we are using Tomcat 6.0.18, with APR 1.2.12 and tc native 1.1.14 on an Redhat OS (Linux kernel 2.6.18). There is a behavior that I can't explain: -with connectionTimeout=0, the process tomcat uses a huge percentage of CPU, even if there is no traffic. but we doesn't observe any problem and the response time is good. -with connectionTimeout=5000, the process tomcat uses a normal percentage of CPU, when there is no traffic. -without APR and with connectionTimeout=0, the process tomcat uses a normal percentage of CPU when there is no traffic. After different searches on the web, tomcat manual and mailing lists, I don't find the reason of the link between CPU usage and connectionTimeout/keepAliveTimeout with APR. With the previous release of Tomcat (5.5) and APR, we have a similar CPU usage (without traffic, high CPU load) and when we modify another parameter (firstReadTimeout), the behavior also changes in the same way. I know there is no real trouble, but I'm curious and prudent: I don't like to do something, when I don't understand what is hidden behind. Could somebody explain to me why Tomcat/APR has these behaviors? Is there a performance risk to set connectionTimeout to 5000? Thank you for your answers. Yann - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CPU usage with APR and connectionTimeout impact
You're right. I missed it. APR has the same attributes as the HTTP connector. I think a seperate overview of attributes per connector would be clearer. The HTTP connectionTimeout description states: - The number of milliseconds this *Connector* will wait, after accepting a connection, for the request URI line to be presented. The default value is 6 (i.e. 60 seconds). '0' is not explicitly defined as a special value. According to the description it would mean a wait period of 0 milliseconds for the uri to be presented. This would make the connector practically useless. Caldarale, Charles R wrote: From: Taylan Develioglu [mailto:tdevelio...@ebuddy.com] Subject: Re: CPU usage with APR and connectionTimeout impact according to the documentation there exists no connectionTimeout attribute for the apr connector. Which documentation is that? Note that the HTTP connector attributes apply when running in APR mode. Quoting from the APR-specific doc: The following attributes are supported in the HTTP APR connector in addition to the ones supported in the regular HTTP connector: What's not clear in the doc is that many of the HTTP attributes also apply to the NIO version of the protocol handler. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CPU usage with APR and connectionTimeout impact
On Thu, Apr 2, 2009 at 3:37 PM, Taylan Develioglu tdevelio...@ebuddy.com wrote: I think a seperate overview of attributes per connector would be clearer. +1 Somebody got some time to change it in the TC trunk and cis able to reate a bugzilla-RFE with a patch? Any volunteers welcome ;) Rgds Gregor -- just because your paranoid, doesn't mean they're not after you... gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 @ http://pgp.mit.edu:11371/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: CPU usage with APR and connectionTimeout impact
From: Taylan Develioglu [mailto:tdevelio...@ebuddy.com] Subject: Re: CPU usage with APR and connectionTimeout impact I think a seperate overview of attributes per connector would be clearer. Strongly agree with that. Patches? The HTTP connectionTimeout description states: - The number of milliseconds this *Connector* will wait, after accepting a connection, for the request URI line to be presented. The default value is 6 (i.e. 60 seconds). '0' is not explicitly defined as a special value. For the Java connectors, the connectionTimeout value is used in Socket.setSoTimeout(), where the API doc states A timeout of zero is interpreted as an infinite timeout. Looks like the APR implementation may well interpret zero somewhat differently, resulting in a CPU overheating test... - 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: CPU usage with APR and connectionTimeout impact
On Tue, Mar 31, 2009 at 2:40 PM, yann grostete yann.grost...@alcatel-lucent.fr wrote: -with connectionTimeout=0, the process tomcat uses a huge percentage of CPU, even if there is no traffic. but we doesn't observe any problem and the response time is good. Please use a timeout value 0. Allowing 0 is a (minor) bug, as it enables non blocking mode on the socket. Also, no timeout ( 0) is asking for trouble. Rémy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CPU usage with APR and connectionTimeout impact
Thanks all for your help and explanations. So we will try to find the best value 0 for connectionTimeout in our application. Best regards, Yann Rémy Maucherat a écrit : On Tue, Mar 31, 2009 at 2:40 PM, yann grostete yann.grost...@alcatel-lucent.fr wrote: -with connectionTimeout=0, the process tomcat uses a huge percentage of CPU, even if there is no traffic. but we doesn't observe any problem and the response time is good. Please use a timeout value 0. Allowing 0 is a (minor) bug, as it enables non blocking mode on the socket. Also, no timeout ( 0) is asking for trouble. Rémy - 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
CPU usage with APR and connectionTimeout impact
Hello, In my project, we are using Tomcat 6.0.18, with APR 1.2.12 and tc native 1.1.14 on an Redhat OS (Linux kernel 2.6.18). There is a behavior that I can't explain: -with connectionTimeout=0, the process tomcat uses a huge percentage of CPU, even if there is no traffic. but we doesn't observe any problem and the response time is good. -with connectionTimeout=5000, the process tomcat uses a normal percentage of CPU, when there is no traffic. -without APR and with connectionTimeout=0, the process tomcat uses a normal percentage of CPU when there is no traffic. After different searches on the web, tomcat manual and mailing lists, I don't find the reason of the link between CPU usage and connectionTimeout/keepAliveTimeout with APR. With the previous release of Tomcat (5.5) and APR, we have a similar CPU usage (without traffic, high CPU load) and when we modify another parameter (firstReadTimeout), the behavior also changes in the same way. I know there is no real trouble, but I'm curious and prudent: I don't like to do something, when I don't understand what is hidden behind. Could somebody explain to me why Tomcat/APR has these behaviors? Is there a performance risk to set connectionTimeout to 5000? Thank you for your answers. Yann - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org