5

I am using play 1.2.4. I am providing a link to download images. A number of clients maybe trying to download the same image at the same time.I would like to know, how to determine the number of simultaneous clients 'n' that can download the image file( 200-300 KB). what are the various factors ?

Suppose I know that I am getting 't' requests, but I know i can handle 'n' requests for a file size 's', i will render the binary image to 'n' clients immediately. remaining "t-n" clients I will send a "interval time" as response to send a request after interval time.

is this even possible?

biesior
  • 55,576
  • 10
  • 125
  • 182
shrth
  • 223
  • 2
  • 12

1 Answers1

2

I would advise against serving images with Play in a high-volume setting and instead use a CDN. There's even a hosted solution inclusive file upload at https://transloadit.com/ which does all the work for you.

The biggest factor is the play.pool configuration variable. You can read about it in the documentation.

Generally after that, the HTTP requests will queue up, so your idea of implementing "interval times" doesn't really make sense.

Samuel
  • 1,667
  • 12
  • 18
  • Suppose CDN is used, does it mean that any number of requests can be handled at any instant of time? – shrth Nov 19 '12 at 12:01
  • You'll be able to handle a large amount of traffic using a CDN. The specifics are different from provider to provider. – Samuel Nov 19 '12 at 12:08
  • Thank you Samuel :) I will get back to you if i have more queries. – shrth Nov 20 '12 at 13:38
  • Consider marking the question as solved and open a new question if you have another specific question, thanks. – Samuel Nov 20 '12 at 13:42