Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: Thread Thrashing under Win32

Re: Thread Thrashing under Win32

From: <>
Date: Tue, 12 Jun 2007 06:53:51 -0700
Message-ID: <>

On Jun 9, 2:28 am, BD <> wrote:
> I'm working with a developer to deploy Oracle db 64-bit under
> Win64. Custom front-end app.
> He's asking a question which seems relevant to Oracle architecture,
> but I find no mention of this term anywhere on Metalink.
> Basically, he's concerned that the processes parameter in the db
> (which has been set moderately high for initial testing) will result
> in the same number of threads being created in the Oracle Windows
> process - and that this high number of threads will result in 'thread
> thrashing' (a term I wasn't familiar with until today), which will
> limit scalability.
> I gather that 'thread thrashing' is a situation where a process slows
> down because of excessive context switching between the threads inside
> the process.
> My response is pretty pragmatic - let's not worry about that problem
> unless we have specific reason to worry about it, or unless we see
> evidence of a problem in the Dev environment.
> Meanwhile, I'm trying to identify a precedent wherein someone has
> actually *seen* performance issues related to context switching of
> this kind in a Win32/Win64 deployment.
> Thus far I'm coming up dry.
> Does anyone know of any 'guidelines' Oracle provides which would limit
> the number of processes (and therefore threads in the OS process)
> because of a concern like this? I've tried looking for 'thread
> thrashing' on Metalink, and predictably get nothing at all - 'Context
> Switching' isn't leading me to anything of use either.
> I'd like to tell this gent that thread thrashing of this kind is not a
> concern - but I'd prefer to have some kind of architectural provision
> in front of me, to back that up... plus, assuming this kind of
> excessive context switching within the Win32 process is even a
> possibility, I'm not clear how you'd identify that it's occurring...
> Thanks for any suggestions...

It's true that context switches between threads still have some cost (pushing and popping program counters, stack pointers, etc). But we need to remember that idle threads, those not serving client requests, are not really using CPU. They do call a few system services, most notably NtQueryInformationThread() and a few NtWaitForSingleObject() periodically. But they're all very light-weight. The effect of this adds up probably only if you have hundreds of unneeded threads in oracle.exe.

Another concern may be artificial enlargement of SGA because of too big Oracle processes parameter. Try a couple of settings and see how large your SGA grows to for each setting.

Yong Huang Received on Tue Jun 12 2007 - 08:53:51 CDT

Original text of this message