You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Richard G. Reyes" <ri...@voxsant.com> on 2007/12/17 06:42:28 UTC

Project Deployment Questions

Hi All,

We have created this web application where users can upload images and
display it selectively on the other parts of the system. For performance
reasons we have saved the said images into the filesystem ( e. g.
$CATALINA_HOME/webapps/ROOT/images/uploadedimages/bird01.jpg). At this
point the said image can easily be displayed anywhere in the site as
long as you have the filename which we have persisted into a DB.

Now we have come to the point that we need to deploy the web application
and the idea is to create multiple servers ( multiple tomcats ) pointing
to the same db server and implementing dns round-robin for load
balancing. My problem would be if the user used server a to upload an
image the same image cannot be accessible from the other 2 tomcat servers.

Hoping that someone here have undergone same scenario or maybe someone
might able to point me to a right direction to fix this.

Thanks in advance.
Richard


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


Re: Project Deployment Questions

Posted by Richard Reyes <ri...@voxsant.com>.
Thanks!

Len Popp wrote:
> On Dec 17, 2007 2:52 PM, Richard Reyes <ri...@voxsant.com> 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.
>   


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


Re: Project Deployment Questions

Posted by Len Popp <le...@gmail.com>.
On Dec 17, 2007 2:52 PM, Richard Reyes <ri...@voxsant.com> 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Project Deployment Questions

Posted by Richard Reyes <ri...@voxsant.com>.
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.

> 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://"

Regards,
Richard

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


Re: Project Deployment Questions

Posted by Len Popp <le...@gmail.com>.
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.

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.
-- 
Len

On Dec 17, 2007 12:42 AM, Richard G. Reyes <ri...@voxsant.com> wrote:
> Hi All,
>
> We have created this web application where users can upload images and
> display it selectively on the other parts of the system. For performance
> reasons we have saved the said images into the filesystem ( e. g.
> $CATALINA_HOME/webapps/ROOT/images/uploadedimages/bird01.jpg). At this
> point the said image can easily be displayed anywhere in the site as
> long as you have the filename which we have persisted into a DB.
>
> Now we have come to the point that we need to deploy the web application
> and the idea is to create multiple servers ( multiple tomcats ) pointing
> to the same db server and implementing dns round-robin for load
> balancing. My problem would be if the user used server a to upload an
> image the same image cannot be accessible from the other 2 tomcat servers.
>
> Hoping that someone here have undergone same scenario or maybe someone
> might able to point me to a right direction to fix this.
>
> Thanks in advance.
> Richard
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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