Re: Comet and multipart
Filip, thanks for your reply. You are correct that the server simply writes data, which we can format any way we like. However, we were wondering whether Tomcat has any utilities/configurations to make it easier. E.g: 1) If we use multipart format (to separate between messages), does Tomcat/Apache have utilities to make it easier? Or should we hand-code the appropriate headers, separators, etc? 2) If we rely on Content-length: (to tell when one message ends and another begins), this header is usually automatically managed by Tomcat, so we'd have to ask Tomcat to manage it differently (otherwise, it might calculate one content-length for all messages put together, or it might omit it altogether and use chunked instead - which is also be an option, but then how do we tell tomcat to have a chunk per message). Thanks again --- On Mon, 1/3/11, Filip Hanik - Dev Lists devli...@hanik.com wrote: From: Filip Hanik - Dev Lists devli...@hanik.com Subject: Re: Comet and multipart To: Tomcat Users List users@tomcat.apache.org Date: Monday, January 3, 2011, 8:47 AM On 1/3/2011 7:48 AM, sol myr wrote: Hi, We're implementing a CometServlet on top of Tomcat NIO connector, using long polling. Currently we're using the approach recommended by most tutorials: the client opens a connection and waits for a message (for a configured timeout); if such a message arrives, the client consumes it (e.g. presents it on screen), then *closes* the http connection, and opens a new connection (to wait for the next message). Unfortunately, we have a network performance problem with opening and closing connections (our 3rd party proxy is good at keeping connections alive, but is slow in negotiating new connections). So we'd like to keep the HTTP connection alive, and pass multiple messages on the same connection. We were hoping to tell the messages apart based on multipart format, or some other separator, or content length. Could anyone please tell whether that's supported on the TomcatServlet side? yes, it is supported, as long as your client knows how to do it. On the server/servlet side, all you do is read the input stream byte by byte you can create any type of protocol rules inside the HTTP message that it sends up best Filip
Re: Handling Comet Timeouts with CometProcessor
On 03/01/2011 21:54, Joe Biron wrote: Hello, I've been making great progress with CometProcessor on Tomcat 6.0.29. I have a question about handling timeouts (and I did review this thread: http://www.mail-archive.com/users@tomcat.apache.org/msg55616.html). I want my clients to connect and stay connected for a very long time, but I do need to have my server time the connections out periodically. When I request.setAttribute(org.apache.tomcat.comet.timeout, timeout), I do indeed receive a CometEvent.EventType.ERROR, but I can find no way to gracefully tell the client that everything is OK and I just want them to back off for a while then reconnect. When I do this: ... response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT, Timed out. Please reconnect); response.flushBuffer(); event.close(); ... the client does not receive the response. They only sense an unceremonious connection close - which, if through routers, may take quite some time to be detected. How can I hook into the timeout to send the client a short response before connection close? I don't believe (Filip or someone else who knows Comet much better than I do will correct me if I am wrong) the Comet API supports that. Is there a better way to do this? Should my application handle these timeouts, and use the comet.timeout as a longer safety net? That sounds like the way to do it to me. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat(5.5) Clustering and Load Balancing.
On 04/01/2011 06:47, Harsimranjit singh Kler wrote: So this means tomcat alone have not sufficent support for Load Balancing and clustering?. Correct. Tomcat does not provide a reverse proxy implementation. You main only way to achive is to use apache server HTTPD and connector, mod_jk things ?. You can use any reverse proxy you like. httpd + mod_jk is just one option. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Handling Comet Timeouts with CometProcessor
Is there a better way to do this? Should my application handle these timeouts, and use the comet.timeout as a longer safety net? That sounds like the way to do it to me. Mark Thanks. It would be great if the comet event pump gave me a PRE_TIMEOUT subevent, but at least I know what I need to do. Joe - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Handling Comet Timeouts with CometProcessor
On 04/01/2011 10:34, Joe Biron wrote: Is there a better way to do this? Should my application handle these timeouts, and use the comet.timeout as a longer safety net? That sounds like the way to do it to me. Mark Thanks. It would be great if the comet event pump gave me a PRE_TIMEOUT subevent, but at least I know what I need to do. Put an enhancement request in bugzilla. I can't promise it will ever get implemented but if is there at least the request won't get lost. Mark PS Enhancement requests with patches tend to get look at sooner ;) Joe - 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: What is the healthy interval length for young gc?
On 1/3/11 7:54 PM, Pid wrote: On 1/3/11 2:41 PM, Leon Rosenberg wrote: On Mon, Jan 3, 2011 at 3:10 PM, Pid p...@pidster.com wrote: On 1/3/11 1:10 PM, Leon Rosenberg wrote: Actually no, in my understanding both are independent. I mean the gc doesn't start to copy over if young is full, it simply cleans young. However, to quote your article: Old generation objects are objects that survived a few collections in the young generation area, and if objects managed to survive longer as they should in the young space, they might have been copied to old gen, despite the fact, that they are young generation objects by nature (meaning short lifetime). This theory is what I'm trying to check. Objects which survive collections in young generations will make their way into the old generation, and then sit around for a long time waiting to be collected. Hello pid-ster, What are your memory settings currently and how are the generations divided? -Xmx12G -Xms12G -XX:PermSize=128M -XX:MaxPermSize=256M -XX:+DisableExplicitGC -verbose:GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/.../tomcat/logs/gc_tomcat.log jmap says: Attaching to process ID 16969, please wait... Debugger attached successfully. Server compiler detected. JVM version is 14.2-b01 using thread-local object allocation. Parallel GC with 6 thread(s) Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 12884901888 (12288.0MB) NewSize = 2686976 (2.5625MB) MaxNewSize = 17592186044415 MB OldSize = 5439488 (5.1875MB) NewRatio = 2 SurvivorRatio= 8 PermSize = 134217728 (128.0MB) MaxPermSize = 268435456 (256.0MB) Heap Usage: PS Young Generation Eden Space: capacity = 4074897408 (3886.125MB) used = 1509410704 (1439.4862213134766MB) free = 2565486704 (2446.6387786865234MB) 37.04168603206219% used From Space: capacity = 110755840 (105.625MB) used = 47330080 (45.137481689453125MB) free = 63425760 (60.487518310546875MB) 42.73371047522189% used To Space: capacity = 109314048 (104.25MB) used = 0 (0.0MB) free = 109314048 (104.25MB) 0.0% used PS Old Generation capacity = 8589934592 (8192.0MB) used = 6636110912 (6328.688537597656MB) free = 1953823680 (1863.3114624023438MB) 77.25449874997139% used PS Perm Generation capacity = 268435456 (256.0MB) used = 228667664 (218.07447814941406MB) free = 39767792 (37.92552185058594MB) 85.18534302711487% used Have you attempted to profile the heap to see what's making it into the old gen? (I say attempted because 16G is a lot of heap to profile...) How many processors do you have available and are you using CMS incremental mode? vm with 6 assigned cores and no to both. Deliberate choice, or just not tried it yet? If you've got multiple cores parallel gc is a good idea. Try something like this: -XX:+UseParNewGC \ -XX:+UseConcMarkSweepGC \ -XX:+CMSClassUnloadingEnabled \ Having said that, you might also just try, instead: -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy p 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Tomcat7 with mod_jk
Hello, why I get this error:java.lang.ClassNotFoundException: org.apache.jk.config.ApacheConfig with tomcat6 this worked: Listener className=org.apache.jk.config.ApacheConfig modJk=/usr/local/apache2/modules/mod_jk.so workersConfig=/usr/local/apache2/conf/workers.properties/ Is changend something in tomcat7 Thanks Mario - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat7 with mod_jk
Hi, On 04.01.2011 13:27, ma...@geosar.ch wrote: Hello, why I get this error:java.lang.ClassNotFoundException: org.apache.jk.config.ApacheConfig with tomcat6 this worked: Listener className=org.apache.jk.config.ApacheConfig modJk=/usr/local/apache2/modules/mod_jk.so workersConfig=/usr/local/apache2/conf/workers.properties/ Is changend something in tomcat7 That listener was only used to generate automatic mod_jk configurations from Tomcat deployments. After starting Tomcat the config was written out and you had to manually copy it into your Apache/mod_jk installation. The config which was generated that way never was really production ready. It worked, but not more. Therefore the use of this listener is not recommended and at least I think it is OK if it is no longer working with TC 7. For a good starting point for a production configurations of mod_jk have a look at the exampe configuration contained in the source tarball of mod_jk version 1.2.31. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat7 with mod_jk
On 04/01/2011 12:36, Rainer Jung wrote: Hi, On 04.01.2011 13:27, ma...@geosar.ch wrote: Hello, why I get this error:java.lang.ClassNotFoundException: org.apache.jk.config.ApacheConfig with tomcat6 this worked: Listener className=org.apache.jk.config.ApacheConfig modJk=/usr/local/apache2/modules/mod_jk.so workersConfig=/usr/local/apache2/conf/workers.properties/ Is changend something in tomcat7 That listener was only used to generate automatic mod_jk configurations from Tomcat deployments. After starting Tomcat the config was written out and you had to manually copy it into your Apache/mod_jk installation. The config which was generated that way never was really production ready. It worked, but not more. Therefore the use of this listener is not recommended and at least I think it is OK if it is no longer working with TC 7. It is more than just not working, that is part of the pre-Coyote AJP connector that has been completely removed in Tomcat 7. Tomcat 7 just ships with the Coyote (BIO and APR) implementations for AJP. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat7 with mod_jk
On 04.01.2011 13:41, Mark Thomas wrote: On 04/01/2011 12:36, Rainer Jung wrote: That listener was only used to generate automatic mod_jk configurations from Tomcat deployments. After starting Tomcat the config was written out and you had to manually copy it into your Apache/mod_jk installation. The config which was generated that way never was really production ready. It worked, but not more. Therefore the use of this listener is not recommended and at least I think it is OK if it is no longer working with TC 7. It is more than just not working, that is part of the pre-Coyote AJP connector that has been completely removed in Tomcat 7. Tomcat 7 just ships with the Coyote (BIO and APR) implementations for AJP. Ah, right. Forgot about the listener being part of the removed connector, but from the package name I could have remembered ... Thanks, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: What is the healthy interval length for young gc?
On Tue, Jan 4, 2011 at 1:08 PM, Pid p...@pidster.com wrote: Having said that, you might also just try, instead: -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy I think UseParallelGC is default? I will try the second option. thanx Leon - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: What is the healthy interval length for young gc?
On 1/4/11 1:38 PM, Leon Rosenberg wrote: On Tue, Jan 4, 2011 at 1:08 PM, Pid p...@pidster.com wrote: Having said that, you might also just try, instead: -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy I think UseParallelGC is default? I didn't think so, but I could be wrong. I've always manually specified it. Take a thread dump and count the number of gc threads... ? p I will try the second option. thanx Leon - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Tomcat 7
Thanks Chuck Peter From: Peter Sparkes [mailto:pe...@didm.co.uk] Subject: Tomcat 7 Can anyone please point me to a tutorial on how to Install Tomcat 7 with virtual hosts on Debian Lenny http://tomcat.apache.org/tomcat-7.0-doc/setup.html http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html Also look at the FAQ for various items that might hold interest for you. - 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: What is the healthy interval length for young gc?
From: Pid [mailto:p...@pidster.com] Subject: Re: What is the healthy interval length for young gc? I think UseParallelGC is default? I didn't think so, but I could be wrong. It has been the default for quite some time if multiple cores are available. Take a thread dump and count the number of gc threads... ? Leon's jmap output (http://marc.info/?l=tomcat-userm=129406571326914w=2) already showed that it was on: Parallel GC with 6 thread(s) - 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
Setting up JMX crashes Tomcat 6
I'm trying to set up JMX on tomcat 6.0.19. Following the docs at http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html, I've added this line to CATALINA_HOME/conf/tomcat6.conf: CATALINA_OPTS=$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false When I try to start tomcat with this in place, it crashes with just this in catalina.out: Could not load Logmanager org.apache.juli.ClassLoaderLogManager java.lang.NullPointerException at java.util.logging.Logger.getLogger(Logger.java:292) at java.util.jar.Attributes.read(Attributes.java:422) at java.util.jar.Manifest.read(Manifest.java:199) at java.util.jar.Manifest.init(Manifest.java:69) at java.util.jar.JarFile.getManifestFromReference(JarFile.java:177) at java.util.jar.JarFile.getManifest(JarFile.java:163) at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.java:916) at sun.misc.URLClassPath.getLoader(URLClassPath.java:317) at sun.misc.URLClassPath.getResource(URLClassPath.java:184) at java.net.URLClassLoader$1.run(URLClassLoader.java:209) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:264) at java.util.logging.LogManager$1.run(LogManager.java:182) at java.security.AccessController.doPrivileged(Native Method) at java.util.logging.LogManager.clinit(LogManager.java:175) at java.util.logging.Logger.getLogger(Logger.java:291) at com.sun.jmx.remote.util.ClassLogger.init(ClassLogger.java:55) at sun.management.jmxremote.ConnectorBootstrap.clinit(ConnectorBootstrap. java:739) at sun.management.Agent.startAgent(Agent.java:147) at sun.management.Agent.startAgent(Agent.java:289) Exception in thread main java.lang.NoClassDefFoundError: org/apache/catalina/startup/Bootstrap Caused by: java.lang.ClassNotFoundException: org.apache.catalina.startup.Bootstrap at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:264) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332) Could not find the main class: org.apache.catalina.startup.Bootstrap. Program will exit. Any ideas as to what the trouble might be caused by, or what else I could do to debug the problem? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: isapi_redirector.dll Problems - Bad Gateway?
Process #4 just says system when I run the netstat command you gave me. I still see port 8009 listening on process #4 but now for the change I made I see port 8010 listening for my tomcat6.exe process. We do not have a standard tomcat installation. The application itself installs tomcat when you install the application. Its a java based application, so I believe it needs some form of tomcat to function? But, the application was not throwing any errors and it was working internally on our intranet. If it wasn't starting the connector, I didn't see it anywhere in the application logs. awarnier wrote: amythyst wrote: Yea I don't know... I'm not the network person so I don't have access to see what is in the firewall. He told me everything was set up properly in the firewall and when I changed the port to 8010, we made no changes in the firewall whatsoever. Michael Ludwig-6 wrote: amythyst schrieb am 03.01.2011 um 09:15 (-0800): Yup you are correct. It was 8009. And changing the port to 8010 seems to have resolved it. But I'm not sure why this has fixed it. Unfavourable firewall configuration? -- Congratulations, and we share your happiness at having resolved the problem. However, it is always good to know why exactly the problem happened, if only to avoid it re-appearing at some unexpected future time. So allow us to continue digging a bit. I believe that the key must be here, in an answer which you sent previously : I have the following connector string in my server.xml file: Connector port=8009 redirectPort=8443 enableLookups=false protocol=AJP/1.3 URIEncoding=UTF-8/ I will attach the file itself to make sure you guys think it looks ok. I ran the netstat command you gave me... lots of stuff there! But I do see this: TCP 0.0.0.0:80090.0.0.0:0 LISTENING 4 - This 8009 port must not have been Tomcat, but something else. If it is still there now, then try to find out what process number 4 actually is. You should be able to see that in the Task Manager, if you select the PID column for display. It should also normally show the name of the executable program, if you really entered the command as : netstat -aobn e.g. TCP127.0.0.1:1430 127.0.0.1:1429 HERGESTELLT 1092 [komodo.exe] (maybe you just forgot to copy and paste that second line ?) On my WinXP laptop for example, I see that process # 4 as [System] : TCP192.168.245.129:1390.0.0.0:0 ABHÖREN 4 [System] In retrospect, it looks strange to have a process with PID # 4 on that server, listening on port 8009. What could it be ? Also, in the Tomcat logs of when you were still having the Connector listening on port 8009, there must have been error messages when Tomcat started. (It should not have been able to start that Connector, if the port was not free). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/isapi_redirector.dll-Problems---Bad-Gateway--tp30500400p30588084.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Setting up JMX crashes Tomcat 6
From: Nate Woodward [mailto:nate.woodw...@the-connection.com] Subject: Setting up JMX crashes Tomcat 6 I'm trying to set up JMX on tomcat 6.0.19. Consider moving up to a version that was actually released - 6.0.19 never made it out the door. I've added this line to CATALINA_HOME/conf/tomcat6.conf: No such file exists in a standard Tomcat distribution. Since neither of your two statements above is believable, you might want to start over with a clean install of a fresh download of Tomcat. If the problem persists, tell us the JVM version you're using, the platform you're running on, and how you start Tomcat. Posting your entire server.xml (with comments removed and passwords obfuscated) would also be helpful. - 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: Setting up JMX crashes Tomcat 6
Apologies, I'm new to this list and to tomcat in general, and I'm not terribly savvy on what is/is not standard on a tomcat install. We build our own tomcat RPMs from source with a few extra system scripts and patches applied. In the future, should I attach said patches when posting? At any rate, I've discovered a fix for the problem. In our setup, conf/tomcat6.conf gets sourced by a /etc/init.d/tomcat init script, and its main purpose is to set environment variables that tomcat needs. I added 'CLASSPATH=$CATALINA_HOME/bin/tomcat-juli.jar:$CLASSPATH' to tomcat6.conf, and now it works fine for some reason. This seems odd, since the output of 'ps' showed it was definitely in the -classpath option passed to java before. Hopefully, being there twice won't hurt. *shrug* -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Tuesday, January 04, 2011 10:10 AM To: Tomcat Users List Subject: RE: Setting up JMX crashes Tomcat 6 From: Nate Woodward [mailto:nate.woodw...@the-connection.com] Subject: Setting up JMX crashes Tomcat 6 I'm trying to set up JMX on tomcat 6.0.19. Consider moving up to a version that was actually released - 6.0.19 never made it out the door. I've added this line to CATALINA_HOME/conf/tomcat6.conf: No such file exists in a standard Tomcat distribution. Since neither of your two statements above is believable, you might want to start over with a clean install of a fresh download of Tomcat. If the problem persists, tell us the JVM version you're using, the platform you're running on, and how you start Tomcat. Posting your entire server.xml (with comments removed and passwords obfuscated) would also be helpful. - 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: What is the healthy interval length for young gc?
On 1/4/11 2:47 PM, Caldarale, Charles R wrote: From: Pid [mailto:p...@pidster.com] Subject: Re: What is the healthy interval length for young gc? I think UseParallelGC is default? I didn't think so, but I could be wrong. It has been the default for quite some time if multiple cores are available. Take a thread dump and count the number of gc threads... ? Leon's jmap output (http://marc.info/?l=tomcat-userm=129406571326914w=2) already showed that it was on: Parallel GC with 6 thread(s) Ah, I didn't see that. Thanks... p 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
RE: Setting up JMX crashes Tomcat 6
From: Nate Woodward [mailto:nate.woodw...@the-connection.com] Subject: RE: Setting up JMX crashes Tomcat 6 In the future, should I attach said patches when posting? No; best if you can demonstrate any problem on a released version of Tomcat, not a home-grown one. Unlikely that anyone here will be interested in debugging your local code. its main purpose is to set environment variables that tomcat needs. Which is more properly handled by creating a setenv.sh script. If you're rolling your own, you're pretty much on your own. - 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: Comet and multipart
On 1/4/2011 1:26 AM, sol myr wrote: Filip, thanks for your reply. You are correct that the server simply writes data, which we can format any way we like. However, we were wondering whether Tomcat has any utilities/configurations to make it easier. E.g: 1) If we use multipart format (to separate between messages), does Tomcat/Apache have utilities to make it easier? Or should we hand-code the appropriate headers, separators, etc? Not in Tomcat 6. The risk of using any utilities out there, is that they will want to block on inputstream.read until the entire request body has been read, and I suspect that's not what you want. 2) If we rely on Content-length: (to tell when one message ends and another begins), this header is usually automatically managed by Tomcat, so we'd have to ask Tomcat to manage it differently (otherwise, it might calculate one content-length for all messages put together, or it might omit it altogether and use chunked instead - which is also be an option, but then how do we tell tomcat to have a chunk per message). I would not use Content-Length, by doing so, you're setting a limit to yourself on how long the Comet request is alive best Filip Thanks again --- On Mon, 1/3/11, Filip Hanik - Dev Listsdevli...@hanik.com wrote: From: Filip Hanik - Dev Listsdevli...@hanik.com Subject: Re: Comet and multipart To: Tomcat Users Listusers@tomcat.apache.org Date: Monday, January 3, 2011, 8:47 AM On 1/3/2011 7:48 AM, sol myr wrote: Hi, We're implementing a CometServlet on top of Tomcat NIO connector, using long polling. Currently we're using the approach recommended by most tutorials: the client opens a connection and waits for a message (for a configured timeout); if such a message arrives, the client consumes it (e.g. presents it on screen), then *closes* the http connection, and opens a new connection (to wait for the next message). Unfortunately, we have a network performance problem with opening and closing connections (our 3rd party proxy is good at keeping connections alive, but is slow in negotiating new connections). So we'd like to keep the HTTP connection alive, and pass multiple messages on the same connection. We were hoping to tell the messages apart based on multipart format, or some other separator, or content length. Could anyone please tell whether that's supported on the TomcatServlet side? yes, it is supported, as long as your client knows how to do it. On the server/servlet side, all you do is read the input stream byte by byte you can create any type of protocol rules inside the HTTP message that it sends up best Filip - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1191 / Virus Database: 1435/3357 - Release Date: 01/03/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
How to disable chunked encoding for the Http11NioProtocol connector.
Hi, I use NIO HTTP Tomcat connector org.apache.coyote.Http11NioProtocol to implement Comet streaming to browsers and mobile devices. I would like to disable HTTP response chunked encoding to reduce bandwidth. The response will have header Connection: close with Content-Length header omitted. Is there a way to do it besides having client send HTTP 1.0 request (that is not possible in the majority of cases)? Thanks
Re: How to disable chunked encoding for the Http11NioProtocol connector.
On 05/01/2011 05:04, ilya goberman wrote: Hi, I use NIO HTTP Tomcat connector org.apache.coyote.Http11NioProtocol to implement Comet streaming to browsers and mobile devices. I would like to disable HTTP response chunked encoding to reduce bandwidth. How significant is the overhead with chunking in your case? I'd expect it to be pretty small unless only a few bytes are sent at a time (and even then there is the overhead for the packet). Is there any mileage in using compression to reduce bandwidth instead? Issues with flushing compressed output streams [1] were fixed last year. The response will have header Connection: close with Content-Length header omitted. Is there a way to do it besides having client send HTTP 1.0 request (that is not possible in the majority of cases)? Having looked at the relevant source code the only two ways I can see are: - sending an HTTP 1.0 request - declaring a content length It used to be possible to control this by disabling keep-alive but that was changed back in April last year [2],[3] as a result a discussion on the dev list [4]. If your Tomcat version is old enough, you may still be able to use the disable keep-alive trick. My own view was then, and is now, that the extra bytes with chunking are a price worth paying for the client to be able to determine if the request is complete. That said, an option on the connector to revert to non-chunked responses when keep-alive is disabled for use cases where reducing bandwidth is more important than knowing if the response is complete seems reasonable to me. Mark [1] http://issues.apache.org/bugzilla/show_bug.cgi?id=48738 [2] http://svn.apache.org/viewvc?rev=931709view=rev [3] http://svn.apache.org/viewvc?rev=932913view=rev [4] http://markmail.org/message/pim62zhlw4cii7ve - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org