Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Scalability fo Batch Operations in RAC
Sriram,
Please remember than cache contention (i.e. ³global cache services² or GCS) is only half of the synchronization issue with RAC. The other half is ³global enqueue services² or GES, and there is absolutely no way to ³partition² that activity.
Essentially, if the batch operations in question perform frequent acquisition/release of transaction locks (i.e. TX and TM), then your scalability problems may be (at least partially) blamed on GES. For a quick scratch-n-sniff test, see if the algorithm of the batch process something like:
open main_cursor;
loop
fetch from main_cursor; commit;
The significant point is that the COMMIT statement is occuring on each iteration of the loop. If so, Oracle will be acquiring TX and TM enqueues with each iteration of the loop, implicitly acquired with the first DML statement, and then releasing those same enqueues with the explicit COMMIT. So, if your batch processes are iterating 1,000,000 times in the ³main_cursor² loop, then you¹ll be performing millions and millions of global enqueue acquisitions and releases (i.e. 1,000,000 ³TX² acquisitions, 1,000,000 ³TX² releases, and several million ³TM² acquisitions and releases). This is a very ³RAC-unfriendly² program design, in essence. Unfortunately, there are many good reasons, stemming from program requirements, why this design (committing frequently) is necessary. However, if the algorithm of the batch processes look more like:
open main_cursor;
loop
fetch from main_cursor;
end loop;
close main_cursor;
commit;
Then, Oracle will be acquiring TX and TM enqueues only at the first DML statement(s) of the first iteration of the ³main_cursor² loop, and then releasing those same TM and TX enqueues at the COMMIT. So, we¹re talking about only a handful of global enqueue operations, as opposed to millions. This is a very ³RAC-friendly² program design, but it may not accommodate the needs of the application, unfortunately, in many cases.
The conventional wisdom is that more frequent commits improve performance ‹ the reality is the opposite. This is true in non-RAC as well as RAC, but as has been stated frequently in the past, ³RAC exaggerates².
It is very easy to determine if GES is a significant contributor to your scalability problem ‹ just COMMIT less frequently. If you can, COMMIT only once at the close of the loop, but if not, then try COMMITing less frequently, if possible.
The good news is, if application logic permits, it is far easier to minimize GES scalability problems than it is to minimize GCS scalability problems. Just COMMIT less frequently.
Hope this helps...
-Tim
on 12/26/05 11:53 AM, Sriram Kumar at k.sriramkumar_at_gmail.com wrote:
> Hi Mark, > > Thanks for your insight. Presently we are not using partioning as an option > but I will thinkover your suggestion and discuss with the Development team to > see if this approach can be followed, > > Thanks again for the insight > > Best Regards > > Sriram Kumar > > > On 12/26/05, Mark W. Farnham wrote:
>>> -----Original Message----- >>> From: oracle-l-bounce_at_freelists.org >>> [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Sriram Kumar >>> Sent: Monday, December 26, 2005 10:50 AM >>> To: ORACLE-L >>> Subject: Scalability fo Batch Operations in RAC >>> >>> Hi Gurus, >>> >>> We are running a heavy batch operation of a banking application on RAC. >>> Say the configuration is a 2 node 4 CPU Itanium2 box running 9.2.0.4 >>> . >>> >>> We have batch operation that can be run in parallel. What I am noticing is >>> that when I run all the batch operations in node 1, it gets over in 2 hours >>> . During this time, the other node is not used at all. To optimally use the >>> resources , I run the batches across 2 nodes, I see a degradation in >>> performance( the elapsed time would be around 3 hours).There are no blocking >>> locks and interconnect performance is good( block transfer time is around >>> 4ms). I am planning to do a 10046 on both the scenarios and compare the top >>> SQL's and waits. >>> >>> I just wanted to know if any one of you had faced this issue before or is >>> this normal?. >>> >>> Best Regards >>> >>> Sriram Kumar > >Received on Fri Jan 06 2006 - 18:03:06 CST
![]() |
![]() |