Mapped SP seems to randomly hang the site for 2-5 minutes before returning

4 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 05 Oct Link to this post

    So we have a servicestack callback that opens a new OA context, populates a complex object, but one of the properties of said object is generated from an SP (for performance reasons)

    So what we're seeing is that when this line is in the code

    this.RequiredPlacements = ((AuthDB.Model.Context) Telerik.OpenAccess.OpenAccessContextBase.GetContext(campus)).Cps_ug_sp_getBlockLearners(campus.BlockId, campus.CampusId, false).Count();

    We hang *SOMETIMES* for minutes at a time, the rest of the time it's w/in 200-300ms for the callback to return.

    If I comment out that line, we never have any hanging at all.  Is there some issue with the way OA\DA runs the sp?

    Steve

  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 07 Oct Link to this post

    Hi Steve,

    I think the key to the answer is the word *SOMETIMES*. It looks like normal processing is doing it's job, but at times it is not returning in time. Is it giving the right results when hanging?
    I do not know your configuration (assuming it's in SF), but maybe you are running out of connections and therefore into blocking. Can you take a dump of the process when it appears to be hanging?
    Also, from the code line that you sent it seems to me as if you are counting on the client side. It might be more effective to call a SP that performs the counting on the server.
    And no, there is nothing in the code that should trigger a blocking of 3-5 minutes. It's even to much time for the GC to be the reason. I think we need to rule out that it is something on the server side. The better we understand the pattern the closer we can get to the root of the issue.

    Regards,
    Thomas
    Telerik by Progress
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
  3. DevCraft banner
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 07 Oct in reply to Thomas Link to this post

    Yeah I guess it does return the correct results, but 2-5 minutes later.  It's very reproducable...

    It's running in the context of the SF app pool yes, but it's a seperate model\context and DB.

    We've already tried moving the SP to return the count in SQL, doesn't make a diff to OA.  ACtually I moved the code to just use plain oldschool SQL connection to call the SP and it's rock solid.  Called through OA, it tanks every time (well like I said, within 10 or so callbacks).  There's not even anything going on CPU\Memorywise the entire site is just hanging, we ran a JustTrace while it happens, and there's just literally nothing going on.... its just waiting.

    Steve

  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 10 Oct Link to this post

    Hi Steve,

    then my next best guess would be that you are in fact short on connections and therefore need to wait until one becomes free. This is because you experimented and used a SQL connection directly (bypassing the OpenAccess connection pool) and did not report a blocking behavior.
    This also means, that you have either a very busy side (maybe for a short time frame) or a code path, where the context (and the used connection) is not properly disposed in time; normally, the connection pool should be having enough connections for immediate use. Can you check that theory?


    Regards,
    Thomas
    Telerik by Progress
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top