This is a migrated thread and some comments may be shown as answers.

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

3 Answers 26 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 05 Oct 2016, 05:58 PM

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

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 07 Oct 2016, 07:39 AM
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.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 07 Oct 2016, 05:38 PM

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

0
Thomas
Telerik team
answered on 10 Oct 2016, 07:41 AM
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.
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Thomas
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or