You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by S Ahmed <sa...@gmail.com> on 2010/08/27 18:57:27 UTC

multiple instances on a server

Hi,

If you have a server with 15 GB of ram (or any large number for arguments
sake), does it ever make sense to run multiple instances of tomcat on the
same server?  (serving http requests for the same web application)

Or can a single instance utilize all the server resources just
fine efficiently?


The reason I am asking is that I have read that those hosting ruby on rails,
or python web applications usually run multiple instances of their
respective web server, each running on its own port, and then proxied using
haproxy or the like.

Re: multiple instances on a server

Posted by Pid <pi...@pidster.com>.
On 27/08/2010 17:57, S Ahmed wrote:
> Hi,
> 
> If you have a server with 15 GB of ram (or any large number for arguments
> sake), does it ever make sense to run multiple instances of tomcat on the
> same server?  (serving http requests for the same web application)

If you have a 64bit JVM, probably not.

> Or can a single instance utilize all the server resources just
> fine efficiently?

If you have a 64bit JVM, probably.

> The reason I am asking is that I have read that those hosting ruby on rails,
> or python web applications usually run multiple instances of their
> respective web server, each running on its own port, and then proxied using
> haproxy or the like.

Each having separate resource (DB) pools, which must make managing them
a tad tricky.  Or maybe that's not a consideration...


p

Re: multiple instances on a server

Posted by Rainer Frey <ra...@inxmail.de>.
On Saturday 28 August 2010 00:11:11 Rainer Jung wrote:
> On 27.08.2010 21:58, Wesley Acheson wrote:
> > On Fri, Aug 27, 2010 at 9:41 PM, Pid<pi...@pidster.com>  wrote:
> >> On 27/08/2010 18:51, Wesley Acheson wrote:
> >>> I think the reason for doing this in ruby is that ruby is single
> >>> threaded, I've been told. The JVM isn't.

> Adding unqualified rumors: Ruby is not single-threaded, 

Right - the language has a thread concept that can be explored as true multi-
threading by interpreters. But the original C-based ruby interpreters for do 
have a global interpreter lock that causes only one native thread to be 
running within one ruby process. This makes these interpreters effectively 
single threaded. (Ruby up to 1.8 only used 1 native thread at all, Ruby 1.9 
maps ruby threads to multiple native threads, but still has the global 
interpreter lock.)

> but the Rails
> framework has a huge lock that effectively make the biggest part of
> request handling serialized. Usually Ruby webapps are based on Rails. So
> yes, Ruby on Rails needs multiple server processes in parallel to
> effectively scale. That might be an outdated rumor though.

It is in so far outdated that Rails from 2.3 on has a threadsafe configuration 
option that enables multi-threaded request processing. This needs a multi-
threaded runtime though to make any sense. JRuby is (of course) multi-
threaded, I'm not sure if there is any other Ruby interpreter that is multi-
threaded.

> Regards,
> 
> Rainer

Rainer

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


Re: multiple instances on a server

Posted by Rainer Jung <ra...@kippdata.de>.
On 27.08.2010 21:58, Wesley Acheson wrote:
> On Fri, Aug 27, 2010 at 9:41 PM, Pid<pi...@pidster.com>  wrote:
>> On 27/08/2010 18:51, Wesley Acheson wrote:
>>> I think the reason for doing this in ruby is that ruby is single
>>> threaded, I've been told. The JVM isn't.
>>
>> I'm raising an eyebrow.
>>
>
> Huh?

Adding unqualified rumors: Ruby is not single-threaded, but the Rails 
framework has a huge lock that effectively make the biggest part of 
request handling serialized. Usually Ruby webapps are based on Rails. So 
yes, Ruby on Rails needs multiple server processes in parallel to 
effectively scale. That might be an outdated rumor though.

Regards,

Rainer

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


Re: multiple instances on a server

Posted by Wesley Acheson <we...@gmail.com>.
On Fri, Aug 27, 2010 at 9:41 PM, Pid <pi...@pidster.com> wrote:
> On 27/08/2010 18:51, Wesley Acheson wrote:
>> I think the reason for doing this in ruby is that ruby is single
>> threaded, I've been told. The JVM isn't.
>
> I'm raising an eyebrow.
>

Huh?

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


Re: multiple instances on a server

Posted by Pid <pi...@pidster.com>.
On 27/08/2010 18:51, Wesley Acheson wrote:
> I think the reason for doing this in ruby is that ruby is single
> threaded, I've been told. The JVM isn't.

I'm raising an eyebrow.

> This is of course muddied with Jruby.
> 
>  http://stackoverflow.com/questions/3086467/confused-are-languages-like-python-ruby-single-threaded-unlike-say-java-for
> 
> Anyway I don't see any reason you should need to install two
> instances. I believe that they'll both end up running in the same JVM
> also but again could be wrong.

 [ ]  Correct
 [x]  Incorrect

Not unless you deliberately configure two Service instances in
server.xml.  Which would be unusual & probably self-defeating, if the
goal was separate JVMs.


p

> On Fri, Aug 27, 2010 at 6:57 PM, S Ahmed <sa...@gmail.com> wrote:
>> Hi,
>>
>> If you have a server with 15 GB of ram (or any large number for arguments
>> sake), does it ever make sense to run multiple instances of tomcat on the
>> same server?  (serving http requests for the same web application)
>>
>> Or can a single instance utilize all the server resources just
>> fine efficiently?
>>
>>
>> The reason I am asking is that I have read that those hosting ruby on rails,
>> or python web applications usually run multiple instances of their
>> respective web server, each running on its own port, and then proxied using
>> haproxy or the like.
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


RE: multiple instances on a server

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Wesley Acheson [mailto:wesley.acheson@gmail.com] 
> Subject: Re: multiple instances on a server

> I believe that they'll both end up running in the same JVM
> also but again could be wrong.

No, separate Tomcat instances would run in separate JVM instances (processes).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: multiple instances on a server

Posted by Wesley Acheson <we...@gmail.com>.
I think the reason for doing this in ruby is that ruby is single
threaded, I've been told. The JVM isn't.


This is of course muddied with Jruby.


 http://stackoverflow.com/questions/3086467/confused-are-languages-like-python-ruby-single-threaded-unlike-say-java-for

Anyway I don't see any reason you should need to install two
instances. I believe that they'll both end up running in the same JVM
also but again could be wrong.

On Fri, Aug 27, 2010 at 6:57 PM, S Ahmed <sa...@gmail.com> wrote:
> Hi,
>
> If you have a server with 15 GB of ram (or any large number for arguments
> sake), does it ever make sense to run multiple instances of tomcat on the
> same server?  (serving http requests for the same web application)
>
> Or can a single instance utilize all the server resources just
> fine efficiently?
>
>
> The reason I am asking is that I have read that those hosting ruby on rails,
> or python web applications usually run multiple instances of their
> respective web server, each running on its own port, and then proxied using
> haproxy or the like.
>

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


Re: multiple instances on a server

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ahmed,

On 8/27/2010 12:57 PM, S Ahmed wrote:
> If you have a server with 15 GB of ram (or any large number for arguments
> sake), does it ever make sense to run multiple instances of tomcat on the
> same server?  (serving http requests for the same web application)

If you want complete isolation between the webapps, then it might make
sense to run separate instances of Tomcat. We do this in production so
we can bring one instance of Tomcat down without disturbing the others.
It also allows us to mix/match JVM and Tomcat versions between the webapps.

> Or can a single instance utilize all the server resources just
> fine efficiently?

Generally, yes. As Pid points out, you'll need a 64-bit JVM to use all
that RAM.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx4NTIACgkQ9CaO5/Lv0PAUtgCfVAP0tqKzanVsInqR59GfsV9f
QmcAoIrUsKwbdD526Fg6RecxZDX5/tYE
=YNo3
-----END PGP SIGNATURE-----

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


RE: multiple instances on a server

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
The only reasons I have ever come up with are all operations-related,
not techincal.
For example, different maintenance windows requirements get different
Tomcat instances.

> -----Original Message-----
> From: S Ahmed [mailto:sahmed1020@gmail.com]
> Sent: Friday, August 27, 2010 11:57 AM
> To: users@tomcat.apache.org
> Subject: multiple instances on a server
> 
> Hi,
> 
> If you have a server with 15 GB of ram (or any large number for
> arguments
> sake), does it ever make sense to run multiple instances of tomcat on
> the
> same server?  (serving http requests for the same web application)
> 
> Or can a single instance utilize all the server resources just
> fine efficiently?
> 
> 
> The reason I am asking is that I have read that those hosting ruby on
> rails,
> or python web applications usually run multiple instances of their
> respective web server, each running on its own port, and then proxied
> using
> haproxy or the like.
__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law.  If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system.


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