Leo Sutic wrote:
>>Hmm. Considering you have 86,400,000 milliseconds in a day, 99.97%
>>means that you can only 25,920 milliseconds of down time.
>>
>
> The requirement is thus: 99.97% of all requests must be processed in <= 1
> second.
>
> So what I meant was that should a GC occur while processing a request, it
> may
> eat into the margin quite a lot.
All GC's are blocking, and stop all code from working during the GC
time. Considering that a full GC cycle can take upwards of a full
second, that is one request per thread during that time that will
fail.
Concidering that the average partial GC can take up to 10 milliseconds,
that means that you have to aim for no more than 990 milliseconds per
request. In order to really test if a Full GC happens every so many
seconds (as opposed to only when we call System.gc()), we need a test
that runs for about an hour.
When JDK 1.5 comes, we will finally have a GC that doesn't block all
threads. Until then we have to wait impatiently.
Also, if you take .7 (the minimum time for a partial GC in the -server
mode) and multiply times the number of partial garbage collections in
a day (86,400,000 / 150 = 576,000), you come up with 403,200
milliseconds of downtime. That is more than 15 times the allowed down
time.
Let's also assume we have 100 threads in the system. That means we can
supposedly run 100 simultaneous requests. Let us also assume that the
average request time is 990 milliseconds. You will have 8,727,272
requests per day processed running at full boar (no GC action). Now,
let's take away the minimum time spend in GC. We can process
8,686,545--we lost 40,727 transactions. When we take the new
number and discover how long the average transaction takes when
factoring for GC we get 994 milliseconds per request--so we are safe.
But notice how close we are getting. If we start at 996 ms/request,
you will end up with missing the mark with every request when factoring
GC.
Here are some formulae you can use to determine #1 how many transactions
you can process in a given period of time, and #2 given a period of time
and a total number of requests how long the average request took:
Rt = ( K / Tr ) * N
Tr = ( N / Rt ) * K
Where
K = time constant (length of time in the units you wish to measure
e.g. 86,400,000 ms in a day)
N = number of concurrent requests (i.e. number threads * number JVMs)
Rt = Average request time (in units that K is calculated in, e.g. ms)
Tr = Total requests in the period of time.
*NOTE* This is how I calculated the cost of the GC in the request time.
There are two things you have to realize about this formula: a new
measurement for request time has to be made when you change the number
of threads, but not the number of concurrent JVMs.
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>