You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by shrikant patel <sh...@gmail.com> on 2010/12/08 21:03:51 UTC

Separte http connector for 2 apps.

Hi Experts,

I have 2 applications call it app1 and app2 deployed on the same tomcat
server (6.0.18). The external client use both of these apps. Right now both
the apps use same http connector on port 8080.
So threads and corresponding thread setting (like maxThreads, acceptCounts
etc) associated with connectors are shared between the 2 apps. That means if
the traffic increase for app1 and request for it start to queue up, the app
2 request may suffer delay or time out.

Going through the documentation, it seems one way of resolving this would
be, to declare 2 separate services in service.xml for the 2 apps. Each
service will have its on http connector with appropriate maxThread and
acceptCount settings. That way high volume on app1 does not starve or
timeout the app2 requests. Also we are thinking of restrict maxthread and
accept count on app1 to low value, so that it does not hog processing
resources etc.

Some other reason we cannot put these apps on different tomcat instance.
This would ideal solutions but not possible in this case.

Please suggest if there is other or better way of doing it.

Thanks in advance
Shri.

Re: Separte http connector for 2 apps.

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

Shrikant,

On 12/8/2010 3:03 PM, shrikant patel wrote:
> So threads and corresponding thread setting (like maxThreads,
> acceptCounts etc) associated with connectors are shared between the 2
> apps. That means if the traffic increase for app1 and request for it
> start to queue up, the app 2 request may suffer delay or time out.

Correct.

> Going through the documentation, it seems one way of resolving this
> would be, to declare 2 separate services in service.xml for the 2
> apps.

Correct: Connectors are associated with a Service, a Service has
multiple Hosts and each host has any number of deployed webapps. In
order to have connectors serve separate webapps exclusively, you
actually have two options:

1. Two Services, separate Hosts, Connectors, and deployed webapps
2. Single Service, Host, and webapp with two Connectors: each connector
must be on a different IP/port combination so you can have users of one
webapp use a specific connector. You can enforce the use of a specific
Connector by using a Valve or Filter to check the incoming port number
and rejecting requests for the "wrong" webapp.

> Each service will have its on http connector with appropriate
> maxThread and acceptCount settings. That way high volume on app1 does
> not starve or timeout the app2 requests.

If you have other shared resources such as a database, you might still
have one webapp affecting the other. Of course, you will be sharing
memory and CPU time as well.

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

iEYEARECAAYFAk0AB9kACgkQ9CaO5/Lv0PDxUgCfQcmWa40Gh5FROWplOWGR8xr8
WxoAoKrJiFRrjeKVzRRs/XZohsL2aUSq
=AZ8R
-----END PGP SIGNATURE-----

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