top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How tomcat is handling bandwidth sharing across all request

+1 vote
415 views

We are developing small video hosting application ,we are not writing any special program for open the video file and send to player , simply we are using tomcat DefaultServlet for above all video request , now we have to benchmark our application for following scenario

1) video size 100MB (1080i HD)
2) Total Network bandwidth 10Mbps (IN/OUT)

Now how to calculate how many max thread is allowed for above scenario ,with out interrupting users viewing experience, here each video response should secure 400kbps bandwidth for no interruption

So my question is how many concurrent users can view videos without interrupt then how to test this scenario ,and how tomcat is handling bandwidth sharing across the request

posted Sep 11, 2013 by Satish Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Tomcat doesn't do any bandwidth sharing internally; that's up to your OS and network infrastructure. Basically divide your network bandwidth's slowest point (probably the ISP connection) by the 400k you say you need per connection. That is the number of simultaneous connections you should be able to support, assuming your server hardware can handle it (which it probably can).

answer Sep 11, 2013 by Ahmed Patel
There are lots of other factors to consider as well. A naive client might download the entire movie before playing it. Disconnects might end up higher than zero, so the client will have to tr-try and -- it being a naive client -- might just re-start from the beginning. A marter client might be able to do a HEAD request to get the file size and then use separate requests for chunks of a single file. If the client thinks its being smart (but is really dumb), it might request those chunks simultaneously "to improve performance".

If your 400kbps requirement per connection is well-researched and correct, then you can handle:

 (X bandwidth in kbps) / (0.7 * 400 kbps)

The 0.7 factor is a rough estimate of network "waste" chatter required to actually communicate. For example, if you have a 100Mbps connection, you can't actually communicate data at that speed: the connection supports bits moving at that speed, but there is more data flying around than the data your application cares about.
Similar Questions
+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server pritoolvca1.sw.ericsson.se:443 [2], client 153.88.164.216)
[Thu Jan 08 08:23:53 2015] [error] [client 172.17.136.153] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

+1 vote

I write my own realm implementation for Tomcat 7.x. In the method Principal authenticate(X509Certificate[] certs) I'd like to read request headers. My authentication would be based on client certificate + custom http request value. Is it possible?

The method authenticate is called in
SSLAuthenticator.authenticate(Request request, HttpServletResponse response, LoginConfig config)

But I do not see that the Request object is passed to realm instance. Is there something similar like WebServiceContext that is used for WS?

...
 @Resource
 WebServiceContext wsctx;
 MessageContext mctx = wsctx.getMessageContext();
 HttpServletRequest request = (HttpServletRequest) 
mctx.get("javax.xml.ws.servlet.request");
...
0 votes

I have a requirement to monitor http request/response logs. We have a embedded Tomcat 7. Could you please point out the options available to do this?.
I'm already aware of the Access Log Valve ( http://www.tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve ). But it can only log separate request headers and query params of the request body..
Would like to know if there is any better approach..

+3 votes

After upgrading Tomcat from 6.X to 7.X, our AJAX client receives 404 for 10-15 seconds right after startup. I presume the request is accepted and processed before all servlet are initialized, which is not what you
would expect.

Is this behavior normal for 7.X? Is there a way to configure 7.x to behave like 6.x?

0 votes

I need to share data between sessions running in different Tomcat server.
I 'd been thinking about using a JMS broker (as ActiveMQ ):

  • when a new session is created in Tomcat A, it's created a new unique topic for this session
  • the session registers itself as listener of that topic ( the only one listener )
  • publish the name of this topic by some way , so it can be found by another session in Tomcat B

I don't know if somebody has used something like this sometime, and how he/she did it
Any suggestion/opinion ?

I'm not sure either use only one topic for all session created or one topic per session ?
I think that one topic per session is more safe because if I use one topic for all sessions, if one message is not read quickly by one consumer (a session ), could block the topic, Obviously , i'll define a TTL for messages/topic

...