cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Community Champion
Community Champion

Inactive screens are generating a lot of unnecessary server load

I have an app with many screens.  Many screens involve galleries and other such things that many users will never need.  When you load the app, it looks like all screens are busy updating galleries.  These galleries use many calls to SQL via a on-prem gateway.  I do not need these screens to do anything until you navigate too them.  I thought there was an app setting/option to enable/disable this, but I could not find it.  Is this something I can control?

10 REPLIES 10
BCLS776
Super User
Super User

There is a fairly new featured called Delayed Load that can work with the DelayItemLoading property of galleries to help with this performance issue. Have you tried playing around with that a bit?:

 

BCLS776_0-1629085766554.png

 

Also, have you run a Monitor session to confirm that the SQL calls are to blame?

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Pstork1
Dual Super User III
Dual Super User III

I think you want to check and enable two different settings.  The first is delayed load. and the second is Enhanced performance for hidden controls.

image.png

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
martinav
Community Champion
Community Champion

@Pstork1 , @BCLS776 ,

 

Gents,

 

Delayed load is already enabled.  However, Enhanced Performance for Hidden controls will not execute functions on my current page like timers and other functions I do not want shown.  Am I right on this?  Delayed load has always been enabled.  However, I'm getting a LOT of SQL traffic from other pages.  This is actually taking the SQL server to max CPU, and hanging it up.  This was not an issue before SQL 2012 was upgraded to SQL 2019.  I'm concerned this is something I'm not going to be able to fix.  Something seriously wrong.  Been fighitng it for a week, and my apps have ben DOWN the whole time!  Management is growing impatient.

Pstork1
Dual Super User III
Dual Super User III

@BCLS776 suggestion of checking the monitor to identify the specific pages that are causing the traffic is a good idea.  If the two settings suggested won't work for you then your only real choice is to identify the specific issues and redesign the app to be more efficient using its SQL connections.  I don't know of any other way to keep offscreen connections from loading.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
martinav
Community Champion
Community Champion

@Pstork1 ,

 

This app has been working great for 2 years.  Issues of CPU overload on the SQL server only comes after an upgrade from SQL Server 2014 to 2019.  Do you know of anything specific that might be the cause of this?  I have been beating on this issue for a week, and my apps are still down because of it.  I have a ticket open for several days, and have been on SQL forums as well.  All people tell me is to make my SQL queries 'better'.  But, even at their best does not explain why I'm having capacity issues with SQL.  Even if I fix it for my development, when users get back on it, it will saturate CPU again, just from scaling to several users at once.  Again, this was not a problem for two full years!  

Pstork1
Dual Super User III
Dual Super User III

I'm not aware of any specific changes between SQL 2014 and SQL 2019 that would cause this.  The only way to resolve it will be to use Monitor and SQL Profiler to figure out what is causing the CPU spike.  The fact that it wasn't a problem on SQL 2014 doesn't help figure out why its a problem now.  Nor is the fact that it worked on SQL 2014 guarantee that it will work on SQL 2019.  



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
martinav
Community Champion
Community Champion

Trust me.  I have gone through the PA monitor and SQL Profiler.  Its shows the ugliness of SQL calls getting all backed up.  It does nothing to tell me why.  Nor sharing it with forums nor with MS.  I'm on my own.  Screwed.

BCLS776
Super User
Super User

@martinav you mentioned in an earlier post about timers in the app -- are these controlling refreshes or similar data operations? If so, is it possible to turn them way down to get a functional app & server, and then re-tune when the stress level is a bit lower? Not a fix, but perhaps some temporary relief.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
seadude
Memorable Member
Memorable Member

Are the Galleries directly tied to SQL tables? You may consider changing their `Items` property to point to a Collection instead. 

Best practice: 

- `OnVisible` of the screen where the data will be used:

ClearCollect(colData,
    Filter(SQL_SOURCE, criteria = whatever)
)

 - Then point the Gallery Items to `colData`. 

 

Then the SQL call should only occur when the user visits the screen instead of happening in the background (for unknown reasons). 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,979)