Consider the problem:
I have n Tomcat nodes with a web application serving some content without attack. For example, 1000 applications of the first request must answer “a”, for the next 10000 with “b”, and for the rest with “c”.
First, I looked at messaging: the application receives the total number of samples from some storage → if it is less than n, then serve the content “a” → after the content is served, the application sends a message → the message receives consumption → the total number of serviced ones increases by some memory → ... However, in this case, there is a rather high chance of overshoot due to a small (or a huge delay in peeping time) delay between the service message and the counter increase ilische.
Then I decided to configure memcached-session-manager to store the counters as a shared session. But it looks pretty hard for my simple case.
Can someone please ask if there is an easy way how multiple JVM instances can communicate with each other (which is applicable for my case)?
source
share