Hi all,

I have this situation, an hardware loadbalancer configured with sticky session based on souce IP, two httpd servers behind it doing HTTPS termination with mod_jk doing load balancing vs four tomcats, i'll try to do my best in ascii art, hopping my mailer
does the right thing:


----------------- {internet}---------------------
|
                      v
  [HW LB with source IP stickyness]
|                   |
|                   |
           [httpd1]            [httpd2]
           [mod_jk] [mod_jk]
              | |
======================================
         |          |            |          |
       [TC1]      [TC2]       [TC3]      [TC4]



Each apache httpd talks with every tomcat.

mod_jk is configured with load balancing by business, sticky sessions, only
one try for ajp worker (so if it's busy i dont add more stuff to the poor worker) and only 1 retry for all load balanced workers, in short, here's the interesting
part of my conf:


worker.worker_lb.balance_workers = w1, w2, w3, w4
sticky session on, sticky session force = off ecc
[...]



Now, even with this settings, on peak times i have an amplification effect, all tomcats are busy, mod_jk reaches atimeout and retries again and again ... in a
death spiral for the poor cats.

This behaviour brings me two problems:

1) Even if apache httpd / mod_jk timeouts (read_timeout) from his side this does not stop the tomcat thread proccessing that request. It goes sometimes on and on
but after all finishes the request.
This seems a resource waste, is there a way to let tomcat know that mod_jk droped the connection and stop proccessingthe dropped request? I tried to find a way to
get this behaviour without success, so any suggestions are welcome.


2) I noticed that the default behaviour of load balanced workers and AJP workers is
as follows:

a) ajp worker reaches retry_timeout, at this point retries again to the same worker
        once, thus amplifying load. This onewas easy to solve, just add a
        "worker.w1.retries = 1"
        and this does not happen anymore

b) Load balancer worker goes to the next ajp worker.. till the last one, than does
        another round of requests:

        lb -> w1 -> timeout
        [...]
        lb-> w4 -> timeout

            LB try 2
        lb -> w1 -> timeout
            [...]
        request fails.

The second round to the workers IMHO is wasteful, but easy solved with:
        "worker.worker_lb.retries = 1"

So at this point for every request all the busy tomcats get only one request. I tryed finding a way to tell the LB worker to try just once, only another worker for request but i didnt find an option for doing this. Well, as i had an each to scratch i made a patch that adds an option to a LB worker telling how much times to retry before giving up, i'm glad to post it if somebody is interested. Not sure it's perfect, but works
for me.


Now, my questions:

1) Am i doing something wrong?
2) Is there a way to make a tomcat thread stop proccessing when AJP timeouts?


Thanks in advance,
Frederik


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

Reply via email to