On Dec 17, 2007 2:52 PM, Richard Reyes <[EMAIL PROTECTED]> wrote:
> Hi Len,
>
> Please see inline...
>
> Len Popp wrote:
> > There are a couple of ways to handle this.
> >
> > 1. Replicate the uploaded images to all the Tomcat servers. This isn't
> > hard if the image directories can be shared on the server LAN. Not
> > much more complicated than what you're doing now.
> >
> Like a cron task? The image directories must be accessible by the webapp
> so it must be inside the webapp/ROOT folder. We were thinking of
> mounting the image folder into a nfs but then again we also estimate
> about 150 simultaneous access and the images will be a big part of it.

I wasn't thinking about cron, I meant that when the app saves an
uploaded image, it saves it in several files on several servers (via
network shares) so that the uploaded files appear on all servers. The
uploadedimages directory in each Tomcat server would have to be shared
on the network.

Are 150 users going to be uploading images all the time, or will they
view images more often than uploading them? Usually uploads are a much
smaller part of the traffic than views, so replicating the uploaded
files to multiple servers makes sense.

> > 2. All Tomcats save the uploaded images in a single location that is
> > served by a single server, not round-robin. This is good if the images
> > aren't a big portion of the web traffic.
> >
> > 3 = 1+2. If you want to get fancy you can use any number of image
> > servers, separate from the webapp servers. High-traffic web sites
> > often do this.
> >
> Please tell me more how to do this? Is this like an httpd app serving
> the images, then the tomcat will access the images via <img src="http://";

Yes. Examples of sites that use separate servers for images:
http://slashdot.org/ and http://images.slashdot.org/
or http://www.cnn.com/ and http://i.l.cnn.net/
In both of those cases, I suspect that the image server
(http://images.slashdot.org/, http://i.l.cnn.net/) is actually several
web servers behind a load balancer.

You could still use Tomcat for the images, but it doesn't necessarily
have to be the *same* Tomcat that runs the application. It's not that
different from what you're doing now. The application uploads images
to the location(s) where they're served from - but it doesn't have to
be in CATALINA_HOME/webapps/ROOT on the same computer. You can use the
number of app servers and static image servers that work best for you.
-- 
Len

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to