top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Packet misses in Tomcat: not reach to application servlet but tomcat receives them

+3 votes
696 views

I have been experiencing missing packets during my application testing using Tomcat Server. If someone can help me to identify what is happening, it will be of great value.

Issue: Few packets do not reach the application servlet but tomcat receives them. The missing packets reach the HTTP layer and thereafter they disappear.

This issue is not frequent but occasionally consistent. For the POSTs of missing packet I am not able to find the entry in localhost_access_log.

Version: apache-tomcat-7.0.42
Application entry point: Servlet
OS: Windows 7(32 bit)

posted Jan 6, 2014 by Ahmed Patel

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
How do you know that the packet reaches tomcat if there is no matching entry in localhost_access.log? Does all other access appear in this file?
I could see the packet in the wireshark capture and it has reached HTTP layer so I thought it has reached Tomcat; I may be wrong here. Also, as far as my observation, every hit to the application URLs was getting logged in local access log.
And is there anything in the Tomcat error logs ? (Or the Windows Event logs)

A HTTP request might be discarded by Tomcat for various reasons (*) before it is ever mapped to an application. In such a case, there is probably also no log of the request in the Access log. But I would expect some error message in the Tomcat error logs.

(*) Invalid HTTP request, incomplete request, etc..
If there are really packets being lost somewhere, then for POST requests the request size would not match the Content-length header, and that may be one of these cases.

I must say that the "packets lost" hypothesis sound a bit iffy to me.
This is TCP, which should detect missing packets and cause a client connection abort if it was the case. The invalid HTTP request being rejected by Tomcat sounds more probable to me.
I could not find anything (Exception) in tomcat std error log file or any file in the log folder. But I have not checked the Windows event logs. Will do that.

Regarding the content length, there is no mismatch as I have validated using Wireshark and also the same packets(In terms of structure) have reached the application previously.

W.r.t. the last point, I could see TCP ACK for the received packet in the wireshark and the packet has reached HTTP layer which goes missing thereafter.

Is there any configuration to get more logs on the operations happening during the mapping of request to the application?

Similar Questions
0 votes

Is it true that current servlet-based websocket implementation will be deprecated due to the implementation of the JSR-356. We are currently implementing a Tomcat 7-based websocket server implementation that we hoped could scale up to at least 50K concurrent connections [or more], but are concerned if there are any known issues and/or limitations with the websocket implementation in Tomcat 7.

We are currently trying to test how high Tomcat 7 will scale with regards to the maximum number of concurrent websocket connections, but have already hit some problems with only 200 concurrent connections. Perhaps it's our multi-threaded client, or Tomcat configuration - not sure at this point. We have the Tomcat Connector configured with maxConnections=50000 and maxThreads=1000, so 200 concurrent connections shouldn't be a problem.

If anyone could elaborate on the Tomcat 7 servlet websocket implementation stability from a highly concurrent aspect that would be great. Additionally, if anyone has achieved 10(s) of 1000(s) of concurrent websocket connections with Tomcat 7, can you share how Tomcat was configured, what OS it was running on, and what client library you used in testing this?

+2 votes

Is there a standard way to access ServletContext from a WebSocket ServerEndpoint ?

+2 votes

In part of ongoing investigations, i am evaluating the methods to setup the server side component of simple web-services, where there is a simple transfer of data.

In this regard, I am considering the following two options ::

a) Apache AXIS + SOAP

b) Apache Tomcat + Servlets

Which, in general, has a lower memory footprint, and consumes lesser resources in general?

0 votes

If one servlet fails to initialize, meaning that ServletContextListener.contextInitialized() throws exception, then Tomcat still starts (but without the servlet).
I found out that if servlet calls System.exit(1), then Tomcat dies. Is this the only way to make this happen?

This does not work:
- Dorg.apache.catalina.startup.EXIT_ON_INIT_FAILURE=true

...