You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Edwin Quijada <li...@hotmail.com> on 2016/03/08 14:19:29 UTC

Advice on Cluster in one machine

Hi!
I am new using Tomcat so I have a question about performance. I have installed a cluster with 2 tomcats and apache webserver like proxy in front of Tomcat cluster but this whole thing is in one server, somebody tell me that is not useful beacuse is in the same server that is better give more resources to one tomcat and not split the resources in two.

Somebody here can give any advice about this configuration what do you think about this ? In this server I have websockets in cluster and I am having problems with websockets in cluster


Any advice ?


Thks In Advance

Re: Advice on Cluster in one machine

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
On 3/8/2016 8:54 AM, Christopher Schultz wrote:
> Edwin,
> 
> On 3/8/16 11:46 AM, Edwin Quijada wrote:
> 
> 
>> ________________________________________ From: Christopher Schultz
>> <ch...@christopherschultz.net> Sent: Tuesday, March 8, 2016 3:48
>> PM To: Tomcat Users List Subject: Re: Advice on Cluster in one
>> machine
> 
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
> 
>> Edwin,
> 
>> On 3/8/16 8:19 AM, Edwin Quijada wrote:
>>> I am new using Tomcat so I have a question about performance. I 
>>> have installed a cluster with 2 tomcats and apache webserver
>>> like proxy in front of Tomcat cluster but this whole thing is in
>>> one server, somebody tell me that is not useful beacuse is in the
>>> same server that is better give more resources to one tomcat and
>>> not split the resources in two.
> 
>> Performance-wise, your friend is right: a two-node cluster on one 
>> machine is going to use more resources than a single node on that
>> machin e.
> 
>> However, running two cluster nodes on a single server isn't a 
>> completely stupid idea. If you want to have zero-downtime
>> deployments, you can take one node down, upgrade it, then switch.
>> So there's value there. As for fault-tolerance, the single point of
>> failure is the whole machine: if that server isn't available, no
>> services are available .
> 
>> That's why people usually have a hardware load balancer (fairly 
>> simple, fairly reliable) and several web/app servers, just in case
>> one of them fails. If one node fails, the service is still
>> available.
> 
>>> Somebody here can give any advice about this configuration what
>>> do you think about this ? In this server I have websockets in
>>> cluster and I am having problems with websockets in cluster
> 
>> Clustering and websockets have little to do with one another,
>> since the connection goes to one node and the cluster really just
>> manages things like sessions (which are orthogonal to connections,
>> protocols, etc.).
> 
>> OK, so if I want to run my app like myserver.com I can use apache 
>> like reverse proxy to do this and still working with websockets ,
>> I want to do this something like this
> 
>> Apache -> Tomcat -> DB
> 
>> but the websocket still works ?
> 
> I'm not sure how well websockets work through httpd right now. I'm
> certainly no expert on websocket, so someone else will have to give
> you better information. Note that the database is also not relevant.
> 
> But in general, yes, you can use httpd as a reverse proxy for multiple
> Tomcats.
> 
> -chris

I'm not an expert on websockets either, but it looks like this:

https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

will work.

I'm not sure how to fit together all of the pieces, but it looks
possible at least.

. . . just my two cents
/mde/


Re: Advice on Cluster in one machine

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

Edwin,

On 3/8/16 11:46 AM, Edwin Quijada wrote:
> 
> 
> ________________________________________ From: Christopher Schultz
> <ch...@christopherschultz.net> Sent: Tuesday, March 8, 2016 3:48
> PM To: Tomcat Users List Subject: Re: Advice on Cluster in one
> machine
> 
> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
> 
> Edwin,
> 
> On 3/8/16 8:19 AM, Edwin Quijada wrote:
>> I am new using Tomcat so I have a question about performance. I 
>> have installed a cluster with 2 tomcats and apache webserver
>> like proxy in front of Tomcat cluster but this whole thing is in
>> one server, somebody tell me that is not useful beacuse is in the
>> same server that is better give more resources to one tomcat and
>> not split the resources in two.
> 
> Performance-wise, your friend is right: a two-node cluster on one 
> machine is going to use more resources than a single node on that
> machin e.
> 
> However, running two cluster nodes on a single server isn't a 
> completely stupid idea. If you want to have zero-downtime
> deployments, you can take one node down, upgrade it, then switch.
> So there's value there. As for fault-tolerance, the single point of
> failure is the whole machine: if that server isn't available, no
> services are available .
> 
> That's why people usually have a hardware load balancer (fairly 
> simple, fairly reliable) and several web/app servers, just in case
> one of them fails. If one node fails, the service is still
> available.
> 
>> Somebody here can give any advice about this configuration what
>> do you think about this ? In this server I have websockets in
>> cluster and I am having problems with websockets in cluster
> 
> Clustering and websockets have little to do with one another,
> since the connection goes to one node and the cluster really just
> manages things like sessions (which are orthogonal to connections,
> protocols, etc.).
> 
> OK, so if I want to run my app like myserver.com I can use apache 
> like reverse proxy to do this and still working with websockets ,
> I want to do this something like this
> 
> Apache -> Tomcat -> DB
> 
> but the websocket still works ?

I'm not sure how well websockets work through httpd right now. I'm
certainly no expert on websocket, so someone else will have to give
you better information. Note that the database is also not relevant.

But in general, yes, you can use httpd as a reverse proxy for multiple
Tomcats.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlbfA74ACgkQ9CaO5/Lv0PDVUQCgw6fUafLXMoCKsEGW5ucUxgjx
gfEAoKJHYBWtn7MAdhGYlllsgcSZeuah
=YX3V
-----END PGP SIGNATURE-----

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


Re: Advice on Cluster in one machine

Posted by Edwin Quijada <li...@hotmail.com>.

________________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Tuesday, March 8, 2016 3:48 PM
To: Tomcat Users List
Subject: Re: Advice on Cluster in one machine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Edwin,

On 3/8/16 8:19 AM, Edwin Quijada wrote:
> I am new using Tomcat so I have a question about performance. I
> have installed a cluster with 2 tomcats and apache webserver like
> proxy in front of Tomcat cluster but this whole thing is in one
> server, somebody tell me that is not useful beacuse is in the same
> server that is better give more resources to one tomcat and not
> split the resources in two.

Performance-wise, your friend is right: a two-node cluster on one
machine is going to use more resources than a single node on that machin
e.

However, running two cluster nodes on a single server isn't a
completely stupid idea. If you want to have zero-downtime deployments,
you can take one node down, upgrade it, then switch. So there's value
there. As for fault-tolerance, the single point of failure is the
whole machine: if that server isn't available, no services are available
.

That's why people usually have a hardware load balancer (fairly
simple, fairly reliable) and several web/app servers, just in case one
of them fails. If one node fails, the service is still available.

> Somebody here can give any advice about this configuration what do
> you think about this ? In this server I have websockets in cluster
> and I am having problems with websockets in cluster

Clustering and websockets have little to do with one another, since
the connection goes to one node and the cluster really just manages
things like sessions (which are orthogonal to connections, protocols,
etc.).

OK, so if I want to run my app like myserver.com I can use apache like reverse proxy to do this and still working with websockets , I want to do this something like this 

Apache -> Tomcat -> DB

but the websocket still works ?



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


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


Re: Advice on Cluster in one machine

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

Daniel,

On 3/8/16 2:20 PM, Daniel Savard wrote:
> On the zero downtime deployments side, I would prefer a parallel 
> deployment approach. You can deploy a new version within the same 
> instance and have zero downtime as well without building a
> cluster.
> 
> I haven't experiment yet with this, but it is something I am
> looking forward to test in short term.

Having two JVMs also means that you can upgrade Tomcat and/or the JVM
without bringing down the service.

Of course, on a single machine, you would still need to bring down the
service for package updates, etc.

Then of course, there's VMs... it's possible to go completely crazy
unless you take a step back and decide what your uptime requirements
truly are.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlbfK3IACgkQ9CaO5/Lv0PACqQCgrf9MsJ2UVfqAcYRur0ilpccb
+JAAnjThwm8Y5yeAvpcSEKtlvyIClwid
=AwVQ
-----END PGP SIGNATURE-----

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


RE: Advice on Cluster in one machine

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Edwin Quijada [mailto:listas_quijada@hotmail.com] 
> Subject: Re: Advice on Cluster in one machine

> Daniel, can you give the idea to do a parallel
> deployment approach? What tools I need ?

No tools, other than possibly changes to your build script.  The doc is here:
http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Parallel_deployment

 - 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: Advice on Cluster in one machine

Posted by Edwin Quijada <li...@hotmail.com>.
Daniel, can you give the idea to do a parallel
deployment approach? What tools I need ?

________________________________________
From: Daniel Savard <da...@gmail.com>
Sent: Tuesday, March 8, 2016 7:20 PM
To: Tomcat Users List
Subject: Re: Advice on Cluster in one machine

On the zero downtime deployments side, I would prefer a parallel
deployment approach. You can deploy a new version within the same
instance and have zero downtime as well without building a cluster.

I haven't experiment yet with this, but it is something I am looking
forward to test in short term.
-----------------
Daniel Savard


2016-03-08 10:48 GMT-05:00 Christopher Schultz <ch...@christopherschultz.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Edwin,
>
> On 3/8/16 8:19 AM, Edwin Quijada wrote:
>> I am new using Tomcat so I have a question about performance. I
>> have installed a cluster with 2 tomcats and apache webserver like
>> proxy in front of Tomcat cluster but this whole thing is in one
>> server, somebody tell me that is not useful beacuse is in the same
>> server that is better give more resources to one tomcat and not
>> split the resources in two.
>
> Performance-wise, your friend is right: a two-node cluster on one
> machine is going to use more resources than a single node on that machin
> e.
>
> However, running two cluster nodes on a single server isn't a
> completely stupid idea. If you want to have zero-downtime deployments,
> you can take one node down, upgrade it, then switch. So there's value
> there. As for fault-tolerance, the single point of failure is the
> whole machine: if that server isn't available, no services are available
> .
>
> That's why people usually have a hardware load balancer (fairly
> simple, fairly reliable) and several web/app servers, just in case one
> of them fails. If one node fails, the service is still available.
>
>> Somebody here can give any advice about this configuration what do
>> you think about this ? In this server I have websockets in cluster
>> and I am having problems with websockets in cluster
>
> Clustering and websockets have little to do with one another, since
> the connection goes to one node and the cluster really just manages
> things like sessions (which are orthogonal to connections, protocols,
> etc.).
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAlbe9DcACgkQ9CaO5/Lv0PCvSACeP5LxHVddVmygYBSDCMy/bzyI
> kcsAoMRRZOREaWubUGJFrviRSx/cVAUK
> =1OIe
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


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


Re: Advice on Cluster in one machine

Posted by Daniel Savard <da...@gmail.com>.
On the zero downtime deployments side, I would prefer a parallel
deployment approach. You can deploy a new version within the same
instance and have zero downtime as well without building a cluster.

I haven't experiment yet with this, but it is something I am looking
forward to test in short term.
-----------------
Daniel Savard


2016-03-08 10:48 GMT-05:00 Christopher Schultz <ch...@christopherschultz.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Edwin,
>
> On 3/8/16 8:19 AM, Edwin Quijada wrote:
>> I am new using Tomcat so I have a question about performance. I
>> have installed a cluster with 2 tomcats and apache webserver like
>> proxy in front of Tomcat cluster but this whole thing is in one
>> server, somebody tell me that is not useful beacuse is in the same
>> server that is better give more resources to one tomcat and not
>> split the resources in two.
>
> Performance-wise, your friend is right: a two-node cluster on one
> machine is going to use more resources than a single node on that machin
> e.
>
> However, running two cluster nodes on a single server isn't a
> completely stupid idea. If you want to have zero-downtime deployments,
> you can take one node down, upgrade it, then switch. So there's value
> there. As for fault-tolerance, the single point of failure is the
> whole machine: if that server isn't available, no services are available
> .
>
> That's why people usually have a hardware load balancer (fairly
> simple, fairly reliable) and several web/app servers, just in case one
> of them fails. If one node fails, the service is still available.
>
>> Somebody here can give any advice about this configuration what do
>> you think about this ? In this server I have websockets in cluster
>> and I am having problems with websockets in cluster
>
> Clustering and websockets have little to do with one another, since
> the connection goes to one node and the cluster really just manages
> things like sessions (which are orthogonal to connections, protocols,
> etc.).
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAlbe9DcACgkQ9CaO5/Lv0PCvSACeP5LxHVddVmygYBSDCMy/bzyI
> kcsAoMRRZOREaWubUGJFrviRSx/cVAUK
> =1OIe
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: Advice on Cluster in one machine

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

Edwin,

On 3/8/16 8:19 AM, Edwin Quijada wrote:
> I am new using Tomcat so I have a question about performance. I 
> have installed a cluster with 2 tomcats and apache webserver like 
> proxy in front of Tomcat cluster but this whole thing is in one 
> server, somebody tell me that is not useful beacuse is in the same 
> server that is better give more resources to one tomcat and not
> split the resources in two.

Performance-wise, your friend is right: a two-node cluster on one
machine is going to use more resources than a single node on that machin
e.

However, running two cluster nodes on a single server isn't a
completely stupid idea. If you want to have zero-downtime deployments,
you can take one node down, upgrade it, then switch. So there's value
there. As for fault-tolerance, the single point of failure is the
whole machine: if that server isn't available, no services are available
.

That's why people usually have a hardware load balancer (fairly
simple, fairly reliable) and several web/app servers, just in case one
of them fails. If one node fails, the service is still available.

> Somebody here can give any advice about this configuration what do 
> you think about this ? In this server I have websockets in cluster 
> and I am having problems with websockets in cluster

Clustering and websockets have little to do with one another, since
the connection goes to one node and the cluster really just manages
things like sessions (which are orthogonal to connections, protocols,
etc.).

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlbe9DcACgkQ9CaO5/Lv0PCvSACeP5LxHVddVmygYBSDCMy/bzyI
kcsAoMRRZOREaWubUGJFrviRSx/cVAUK
=1OIe
-----END PGP SIGNATURE-----

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


Re: Advice on Cluster in one machine

Posted by Edwin Quijada <li...@hotmail.com>.

________________________________________
From: André Warnier (tomcat) <aw...@ice-sa.com>
Sent: Tuesday, March 8, 2016 1:46 PM
To: users@tomcat.apache.org
Subject: Re: Advice on Cluster in one machine

On 08.03.2016 14:19, Edwin Quijada wrote:
> Hi!
> I am new using Tomcat so I have a question about performance. I have installed a cluster with 2 tomcats and apache webserver like proxy in front of Tomcat cluster but this whole thing is in one server, somebody tell me that is not useful beacuse is in the same server that is better give more resources to one tomcat and not split the resources in two.
>
> Somebody here can give any advice about this configuration what do you think about this ? In this server I have websockets in cluster and I am having problems with websockets in cluster
>
>
> Any advice ?
>

Hi.

If you *really* want to test which of the configurations provides the best results with
your particular caseload, then you will have a lot of work ahead of you to build a
representative workload and an appropriate test/measurement framework.

Non-authoritative advice :

Intuitively, just the fact of having a front-end and a cluster configuration all on the
same server, will already introduce a significant overhead which a simpler configuration
would not have.

Intuitively thus, I would recommend to try the simplest configuration first, and only if
you see problems, then measure what the problem is, and come back for help here.
No need to over-complicate your setup and maintenance before then.

Unless you need it also for something else, forget the httpd front-end and the clustered
Tomcats, and have a single Tomcat act directly as the webserver/websocket server.


OK, thks. 
I did this configuration because I will use a lot of users to my app . Someboyd told me that for this case is much better to use Apache like proxy to redirect request to Tomcat besides dont use port 8080 . I have used Tomcat as webapp before always using 8080 port but now I wanted dont use the port 8080 just use myserver.com/app1 or use subdomains for app.

I take your advice.


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


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


Re: Advice on Cluster in one machine

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 08.03.2016 14:19, Edwin Quijada wrote:
> Hi!
> I am new using Tomcat so I have a question about performance. I have installed a cluster with 2 tomcats and apache webserver like proxy in front of Tomcat cluster but this whole thing is in one server, somebody tell me that is not useful beacuse is in the same server that is better give more resources to one tomcat and not split the resources in two.
>
> Somebody here can give any advice about this configuration what do you think about this ? In this server I have websockets in cluster and I am having problems with websockets in cluster
>
>
> Any advice ?
>

Hi.

If you *really* want to test which of the configurations provides the best results with 
your particular caseload, then you will have a lot of work ahead of you to build a 
representative workload and an appropriate test/measurement framework.

Non-authoritative advice :

Intuitively, just the fact of having a front-end and a cluster configuration all on the 
same server, will already introduce a significant overhead which a simpler configuration 
would not have.

Intuitively thus, I would recommend to try the simplest configuration first, and only if 
you see problems, then measure what the problem is, and come back for help here.
No need to over-complicate your setup and maintenance before then.

Unless you need it also for something else, forget the httpd front-end and the clustered 
Tomcats, and have a single Tomcat act directly as the webserver/websocket server.




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