Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: V$LATCH question

Re: V$LATCH question

From: Ricky Sanchez <rsanchez_at_more.net>
Date: Sat, 01 Dec 2001 03:48:13 GMT
Message-ID: <3C085322.DADEC3B2@more.net>


Jim-

Sorry to intervene here, but this is incorrect. A "willing to wait" latch has no other work to do until it gets that latch. As such, upon a miss it does not go away until some future time. I immediately attempts to get the latch again and will continue to do so until it either gets the latch or hits the predefined limit of _spin_count. When it hits that limit, it then sleeps for a predetermined amount of time.

The spin process is simply a loop. Therefore, from the perspective of performance, a miss in inconsequential. Not much more than a few machine cycles. A sleep on the other hand, is enormously expensive. The first time a latch get sleeps, it will be for 10 milliseconds. Consider today's processor speeds and compare 10 milliseconds to less than a microsecond. Clearly, sleeps are huge. Moreover, after the process sleeps, it performs another cycle of spin get attempts. If it fails again to get the latch, it sleeps again, but this time for twice as long. Each subsequent sleep will be double the time of the previous sleep, up to a maximum of about 2 seconds.

So, in terms of performance, latch misses are insignificant while sleeps are *huge*.

To tune latch contention for willing-to-wait latches, only consider sleeps.

Jim Kennedy wrote:
>
> Think of a sleep as a short wait. A miss is giving up and coming back to it
> later.
>
> Think of it as going to the movies to get a ticket. If the line is not too
> long you are willing to wait a little while to buy a ticket. (a sleep) You
> might call your buddies on your cell phone or in general do something else,
> but you are still in line to get the ticket.
> A miss is when the line is long and you just leave and come back later. You
> could have waited for awhile and then decided to go grocery shopping and
> come back and buy the tickets later.
>
> So a miss is very bad, it means the line to get a ticket was so long that
> you decided to do something else and get the ticket later. The process that
> needed the ticket is going to have to wait a "long" time to get the ticket.
> Also you waste gas driving around to pick up groceries and then reparking to
> get the movie ticket later.
>
> Jim
> "Anonymous" <mail_for_deja_at_yahoo.com> wrote in message
> news:8ee5d7c9.0111301749.173b7097_at_posting.google.com...
> > What is the differences between column MISSES and SLEEPS of V$LATCH.
> > From the book:
> >
> > SLEEPS - The number of times a process had to wait before obtaining a
> > Willing-to-Wait latch
> >
> > MISSES - The number of times a Willing-to-Wait latch was not acquired
> > and a wait resulted
> >
> > To tune the Willing-to-wait latch, which column should I use?
> >
> > Thanks,
> > David
Received on Fri Nov 30 2001 - 21:48:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US