Library lock contention - A Cautionary Tale

We recently encountered a library lock contention problem with our application apex (v3.1.2 on v10.2.0.5 RDBMS) on a site of great volume (800 + users) and I thought it was interesting to share what we found

users reported a serious degradation of performance under load, and a quick look at the top wait events have shown that the contention on the library cache latch is to blame

Top 5 timed events

Event waits time Avg Wait (ms) % Total call time wait class
latch: cache 788 755 106 096 135 15.2 Concurrency Library
free latch 1 599 072 70 099 44 10.0 other
Time CPU 62 604 9.0
DB file sequential read 5 063 905 43 760 9 6.3 user IO
latch: cache library lock 288 246 41 931 145 6.0 Concurrency

We needed to know what was causing the claim, which was where the script excellent tanel poder latchprof.sql (http://blog.tanelpoder.com/) has proven to be invaluable: he showed that there was a special SQL that was causing the problem

SQL > @latchprof name, sqlid % 'library cache"10000;

NAME SQLID Held gets inmate Held ms Avg % hold ms
library cache lock 4dqasqjrvudqn 7880 3548 78,80 allocation 17367,520 4,895
allocation of 6472 3034 64,72 library cache lock 14264,288 4,701
allocation of pine library cache 408 373 4.08 899,232 2.411

turns out it was the call dbms_session.reset_package which is called every request made to the apex DAD

This was also one of the best pieces of SQL by CPU in the database so clearly something was wrong

cut a long story short, the customer has implemented

session_cached_cursors = 75

which at first glance does not seem unreasonable

but since we know that apex almost never reuses the sliders (because he calls reset_package on each request) it seemed too high

the normal recommendation for our apex application is to stick with the default value (20)

the theory being that caching too many cursors just give the call to reset_package too much to do when its being called so often

(on this site, we can see on 50 000 executions per hour on reset_package)

the site has removed the parameter and performance has since returned to normal - and lock contention disappeared

SQL > @latchprof name, sqlid % 'library cache"10000;

NAME SQLID Held gets inmate Held ms Avg % hold ms
3yxpcvrnkzfvd cache library 406 383 4.06 613.466 1,602
Library cache lock allocation 4dqasqjrvudqn 320 320 3.20 483.520 1,511
allocation of cache library 201 201 locking 2.01 303.711 1,511

I hope all of this info can be useful to anyone who is in a similar situation :)

Steve-

Cool post. One thing, I thought that maybe worth mentioning is that the default value is 50 for 11.2, which seems to be different from the default 20 you mentioned for 10.2.

Tags: Database

Similar Questions

  • Using script - library locked when you try to add the file to it

    Hello

    I'm just a simple script that I can run with my engines of the action, so if I add new enum values I can create new wrappers quickly. I am able to create a new VI on disk, but when I try to add the the VI to the library, I get "error 1562: library, or the specified project is locked." Just before adding the article, I tried to adjust the State of the library "Not locked", but has not been the tower.

    Directions to see the error:

    Open attached zip file

    Open 'Engine.lvlib Action '.

    Run "Script - Create Wrapper.vi.

    Please let me know how to get around this, I thank you,

    Gregory

    There are two reasons at least a library locks: 1) something he possesses is running, 2) is open in two or more instances of the application.  (This applies to classes too.)

    I started a project and took your scripts out of the library (to avoid the #1) and then open your Library Reference by path in your script, be sure to include the reference of the application (to avoid the #2).

    Works now.  (With the exception of the Init.vi but you mentioned earlier that you knew about it. But point 1 and 2 of article work fine.)

  • access to the library of content vSphere 6 in vRA

    is it possible to access vSphere 6 library of content in the vRA?

    Not at the moment, but it's something that we are considering in the near future.

  • Library of content, more specifically from buttons

    I got the premium production of CS6 installed for a few weeks after its release. But... I didn't need to make a DVD until this week. So I just opened another CS6 on my machine win7 yesterday for the first time.

    One of the first things I noticed is that there is no content in the libraries of the example. No menus, no buttons, etc. So I look around, find this:

    http://helpx.Adobe.com/x-productkb/multi/library-functional-content-missing.html

    So OK, Adobe left out of the installation package. Nobody is perfect, and here are the instructions to do the download. So I do. Takes a while, not too painful. Open Encore CS6, and of course, there are some menus. Not much, but a little. But... no buttons. In any category.

    So I close again CS6 and CS5 launch. Tons of menus and tons of buttons.

    I'm confused. I think that actually we're more in CS6 since it is the product later and therefore more advanced. And the CS6 version has been redesigned, so I think that there is something new to show off with the new content library.

    Because I don't have it, I have to ask the Group: is this normal? Or maybe missed my download? Or something that I don't know enough to inquire? The big question is, how to make the buttons in the library?

    Still happy with the buttons library is better from here:

    http://helpx.Adobe.com/Encore/using/download-library-content.html

    Yes, it connects to the same as the section further down on the page you linked to that says "additional Solution: install the contents of the Central Library of resources.» But the buttons are there.

    I can't say yet what was the intent of the change. I don't think that they just accidentally left on. Still has varied over the years to determine if the library was a separate download, part of what was called "functional content" on the installation discs, etc. But it's still weird. Note that download which has the buttons is linked from the blog site?

  • Locked content VICELAND

    No one knows why most content in Viceland on Apple TV is locked, but some are unlocked? It wasn't like this a few weeks ago, but now I can't watch more content. Verizon Fios is my provider so I should have everything more are locked.

    Hi Craig, there.

    Looks like you aren't able to watch video on your Apple TV content, even if you were able to access recently. Have you changed the settings of Restrictions on your Apple TV? Try to take a look at the article below and ensure that the Restrictions are configured correctly on your device.

    Restrictions on use of your Apple TV - Apple Support

    If the problem persists, and occurs only with a specific application, try the suggestions of troubleshooting here:

    Get help with third-party applications on your Apple TV - Apple Support

    Ciao.

  • Broken Link: Again help / download the complete library of content/functional content

    I replaced a Windows computer that I burned the DVD with DVD. I use Premiere Pro CC 2015 with an educational institution license and installation separate CS6 Encore for DVD burning. I want to get the content library, but the links (still help |) Download content/functional content free library ) on the site Web of Adobe now go to

    Adobe Creative Cloud

    Audio and video digital

    Adobe Creative Cloud | Digital Video & Audio Blog

    Can I get a link to the new location of the content library?

    Error has been reported to Adobe download function content Premiere Pro CS6

    There is a link in one of the messages of an ACP who put the version of Windows on a download site

  • Models of virtual machine in the library of content focus type = unknown

    Hello

    I created a test with vsphere environment 6 and I created a content library for my VM models.

    That worked well for the last few months, but today I have connected the web client and wanted to deploy a new virtual machine from the content library.

    First thing I noticed was the selection after "deploy vm from library" - the library is empty...

    When I look directly in the content library, models are still there, but the type is unknown and not possible to export the s model or deploy...

    Any ideas what I can do?

    I already rebooted the server vcenter...

    I found a work around...

    I was able to clone the model with type = unknown, and the watch type = clone model vm and the guest OS is displayed correctly, too...

  • library cache contention

    Hello

    Asked me to take a look at an application where recently they began to experience performance issues. They weren't particularly accurate on their complaints and the AWR report for the duration of their latest issue of prod was not particularly revealing with the exception of a few obvious things. However, I received another AWR report, of a previous issue of the prod, and seems to be quite interesting. Here is the wait events section:

    row cache lock 218 154 635 980 2 915 32.9 Concurrency
    cursor: hand S wait on X 54,564,003 11 582 002 30.1 Concurrency
    latch: cache 7 711 223 116 28 935 11.5 Concurrency Library
    cursor: hand S 398,388,863 162 031 0 8.4 other
    latch: cache line 3 793 80 942 21 340 4.2 objects concurrency

    Another curious thing is that 15% of the database of time (the top of the SQL page with a second very remote) was due to a single statement:

    SELECT THE DOUBLE NULL

    (!!!)

    which shows 52 million executions in V$ SQL as well as parsed 52 million (!).

    Unfortunately, ASH data has just expired a few hours before I had a chance to watch, so I can't link those expectations to specific sessions... I only know this slider: needle S wait events are mostly associated with the above SELECT statement, and it seems that row cache lock wait is due to a lack of caching in the sequences.

    I googled a little and found that some people suggest that this may be a side effect of the EAMA... Any other ideas/suggestions?

    Best regards
    Nikolai

    Nikolay Savvinov wrote:

    Another curious thing is that 15% of the database of time (the top of the SQL page with a second very remote) was due to a single statement:

    SELECT THE DOUBLE NULL

    (!!!)

    which shows 52 million executions in V$ SQL as well as parsed 52 million (!).

    Next blog can help.
    http://viveklsharma.WordPress.com/2011/11/19/how-challenging-is-the-task-of-a-performance-optimization-expert-a-real-life-example/

    Check if the dblinks work well.

    Also check if the stats system and its dictionary stats are up to this day.

  • [ORACLE 10.2.0.5] performance problem with high enq: TX - line lock contention waiting

    Hello

    I have a performance problem involving high line response to locking conflicts that I can't wait.

    The application updates the specific table about 1200 times for my AWR report representing 2 hours.

    This update represents 98% of the db_time and wait to enq: TX - line lock conflict is:

    -83 796 waiting

    -245 441 seconds

    The application updates a row both an unprecedented SELECT UPDATES. This is the query:

    Update my_table set creationtime =: 1, modificationdate =: version 2, =: creationuserid 3, =: fortesting 4, =: 5, modificationuserid =: participation_uuid 6, =: actimenucontact 7, =: allegroid 8, =: campaign_uuid 9, =: desjardinsemployeetype 10, =: effectiveparticipationtype 11, =: family_uuid 12, =: fetchpasseport 13, =: 14, healthratingfilldate =: hoursofsleeptimecommitment 15, =: igaid 16, =: initialsubscriptiontype 17, =: minutesofsleeptimecommitment 18, =: goal 19, =: partner_uuid 20, =: 21, promotionalemails =: 22, readrules =: sccsubscriptionprovenance 23, =: = subscriptionprovenance 24,: 25, supportemails =: where the 26 uuid = : 27 and = version: 28

    Clause where is filtering on uuid which is the primary key of my_table.

    The uuid is a specific user and two users would not update the same row, what could be the reason for this wait event?

    Thank you

    Why guess when you know.

    Watch ASH data for these events to the queue.

    He'll tell you sql id as well.

  • Can I create a library of content "extracted"?

    I would use Adobe Document Cloud to build proposals, but I would need the ability to record the content presentation/snippets can someone use/reuse.  I guess that this is a feature but I can't figure out where and how I would go about it.  Someone at - it any help?

    Thank you

    Megan

    Hi mschmitty,

    I'm sorry this feature not present in Acrobat/Document Cloud, but you can create PDFs a models & reuse them.

    Kind regards

    Nicos

  • PDF - tattoo & locking content

    Running:

    • Windows Server 2003 R2
    • ColdFusion 9 (Developer Edition)
    • IIS 6.0
    • MySQL

    I have 2 questions about the PDF format.

    (1) will be the tattoo does not work in the developer edition because of the Adobe watermark which is already there or am I doing wrong?

    <cfpdf action="addwatermark" source="reports/#FileName#" image="text.tiff"
        destination="c:\Inetpub\wwwroot\admin\reports\#FileName#" overwrite="yes">
    

    (2) is it possible to lock a PDF file? I write the text tables and I want to make sure users cannot select text, is this possible?

    The Coldfusion Developer Edition watermark is a large

    white rectangle

    Oh yes, I forgot on the issues of the big white rectangle no difference if you use the foreground = true?

  • Full content to callback library

    I am trying to download the library of full content for Encore CS6 and whenever I click on the link in the help adobe page: (https://helpx.adobe.com/x-productkb/multi/library-functional-content-missing.html #Downloadtheextralibrarycontent) to download the ZIP file, it takes me to their BLOG on the cloud - not links to the library.  Where is the link to the full content library now? Help, please.

    Windows download-only

    https://we.TL/Z6u5Wt9zH3

  • AirWatch content Locker Sync - Force is by default?

    Hello

    I try to set the default location where content locker synchronizes the files users. I want to have a redirected folder synchronization and the user should not be able to change the location. We also want to set the other default settings not starting at the connection and disable the automatic updates etc...

    I couldn't find group policy templates for synchronization of Locker contents AirWatch.

    Any suggestions?

    Thank you

    Hello..

    Please see the attached document (project) on how to specify the parameters of the SCL synchronization tool...

  • Help! I'm a newbie again and need help installing content functional, I downloaded the installer but can't seem to get the full library... don't know what to do

    I installed recently to create a DVD menu for a project and we wish you a menu actions.

    I downloaded the Adobe Encore CS6 functional content but it is not filling in the library field. I must be missing a step, does anyone have any suggestions?

    Follow this link - https://helpx.adobe.com/x-productkb/multi/library-functional-content-missing.html

    Scroll down and follow the directions to download, extract and install it-

    Additional solution: install the contents of the Library Resource Centre

    You will get all the pre-made menus, buttons, etc.

    Thank you

    Jeff Pulera

    Safe Harbor computers

  • High library cache locks

    Snapper shows (Oracle 11.2.0.2 on Linux SLES)
    @snapper ash 5 1 all
    Sampling SID all with interval 5 seconds, taking 1 snapshots...
    
    -- Session Snapper v3.52 by Tanel Poder @ E2SN ( http://tech.e2sn.com )
    
    
    -----------------------------------------------------------------------
    Active% | SQL_ID          | EVENT                     | WAIT_CLASS
    -----------------------------------------------------------------------
       849% | 6k5p0akvc7b42   | library cache lock        | Concurrency
       100% | 6k5p0akvc7b42   | ON CPU                    | ON CPU
        93% | 2byjh4h8u2xz0   | ON CPU                    | ON CPU
        73% | 2qn7pc3c09cyr   | ON CPU                    | ON CPU
        24% | 9k3y572frxzys   | db file scattered read    | User I/O
        17% | b698xf4hs173p   | ON CPU                    | ON CPU
         7% |                 | ON CPU                    | ON CPU
         7% | 6k5p0akvc7b42   | cursor: pin S wait on X   | Concurrency
         5% | 6k5p0akvc7b42   | kksfbc child completion   | Other
         5% | bxud62qj6yjx1   | db file scattered read    | User I/O
    
    --  End of ASH snap 1, end=2012-03-07 09:40:58, seconds=5, samples_taken=41
    Currently a lot of statements (sql_id 6k5p0akvc7b42) run in several parallel sessions
    INSERT INTO xxx (...)
    (SELECT...
    Of yyy)


    Now I wonder how to reduce library cache locks

    Can be more (currentyl 50) session_cached_cursors approach?

    Hello

    Please share us with AWR report for 1 h. frequency and show us the load for this profile.

    Also check

    SQL > show parameter cursor_sharing
    SQL > show parameter sessio_cached_cursor
    SQL > show parameter optimizer

    It looks like not to suffer from analysis which is originally high library cache lock event. Yes sometimes increase session_cached_cursor helps us to reduce the soft analysis. But you need to check if its soft or hard analysis.

    See also
    Troubleshooting Cache library: lock, PIN and load Lock [ID 444560.1]
    Library Cache lock Held for a long time for queries involving too much Lie [ID 1315929.1]

    bottom

Maybe you are looking for

  • How to activate the S-video port on a satellite M30X 154?

    Hey does anyone know how to activate the S-video port on your laptop by Satellite SM30X-154? If I press the FN + 5 keys the only options I get is LCD and no S-VHS option. My TV is set up for this I have Watch DVD through the cable. When I connect the

  • NOON adding loops to the loop browser

    I recently bought a few loops Loops the Looploft and Platinum. Some were the rest of MIDI and audio. Audio loops added very well. LUNCH will however not appear in the loop browser when adding. Is there a procedure I need to follow? I've just them sli

  • Phone app disappeared

    Since the update of Kit Kat (not sure if it's nothing to do with it?) Tap the application phone (at the bottom of the screen blue phone icon) and it says "App is not installed! Used to work OK on JB; don't know what I did wrong. The search in the app

  • Compatibility memory for Satellite A100

    Hello. I just buy a Toshiba Satellite A100-528, and I want to buy more memory, 512 mb DDR2 533.Where can I see what memory is compatible with my laptop? My option: Kingston, Kingmax! TKS a lot!

  • iMessage does not sync between iPhone, Mac Mini, MacBook Air

    My main computer is: Mac Mini (mid-2011), El Capitan 10.11.1 (B 15, 42) My secondary computer is: MacBook Air (13 inch, mid-2012), El Capitan 10.11.1 (B 15, 42) And my iPhone is: iPhone 6 Plus, iOS 9.1 (B 13, 143) iMessage used to sync between my iPh