When the views plugin is activated, a slider using ajax severely effects cpu usage and load time.
How can this be fixed?
Thanks.
I was about to say I don't recall such reports, but the Google search tells me something else.
https://toolset.com/forums/topic/high-cpu-utilization-using-nested-views-with-without-ajax/
https://toolset.com/forums/topic/count-total-grand-child-posts/
https://toolset.com/forums/topic/long-load-time-due-to-admin-ajax-php/
https://toolset.com/forums/topic/server-reported-high-cpu-problem/
So, it seems there are scenarios where CPUs get overloaded when Toolset Views operates with AJAX.
I see in many cases it is related to nested elements.
I cannot exactly tell you how to fix this as I will need to know more, and know how/when this happens, eventually replicate it and then the Developers either can bug fix it or I can advise you how to adjust it.
Now, to start, you'd need to (if possible) put a copy of this site on a staging site.
There, disable every plugin but Toolset, and use a native WordPress theme, make sure all is updated.
Replicate the CPU load on a page, one singular page, with one View (or as many Views you need there to replicate the issue)
Isolate the issue as much as possible by the above steps.
Once you have this ready, you may already know it, Views features a debugger since 1.5
You can enable it in Toolset > Settings > Front-end Content.
It's explained usage is elaborated here:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#the-views-debug-tool
Enable that and produce the issue on the Front end where the View is inserted.
It should produce a Debug Output in a pop up:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#debug-output
It will tell a lot about the query and CPU usage + similar data.
Can you compare that data with the Data you have from your own analysis and let me know:
- what tools you use to analyze
- how the data compares
If you have detailed reports from server admins, if possible, can you attache them as well?
Thanks!
This is a views slider using ajax with caching. It has a small image - 300px width.
I'm using InMotion hosting and their server monitoring is showing the high CPU usage up to 99%.
If I disable the views plugin, the high cpu usage stops. If I take the views slider off the page, the high cpu usage goes way down.
I've had issues with the views slider and slow load times before. Also, the slider takes a long time to load the next slide even with the caching setting on.
It's a great feature with Toolset but this seems to be an issue.
The one thing in common with the two sliders I have issues with is that they both have 8-12 image slides.
I have a slider on another site with 2-3 and it loads quickly - same theme for both which is Genesis. It seems how the slider is loading multiple image slides/posts is causing the issue. Image sizes are small.
There are custom post sliders I've used that load immediately and you can thumb multiple slides immediately. It would be great if I could rely on Toolset's slider to function the same. But as of right now, moving forward, I can't feel comfortable using the Toolset slider having to hope it's going to perform well.
The debug setting is showing a much lower cpu 49% usage but the page load time is still the same.
If you can provide a solution, great, if not I have to use another product for custom post sliders.
Thanks for your help.
Hi, I've seen issues like this where multiple simultaneous AJAX requests cause major performance issues on some servers. My first suggestion is a bit counter-intuitive: turn off preloading in the slider settings. If more than one slider is present on any given page, turn off preloading for all the sliders. Often this will significantly improve performance in those cases, because each slider page load requires a separate AJAX call. Transitions between pages are slightly slower at first, but overall performance is improved.
If this approach isn't enough to speed up the slider results, I'll be glad to take Beda's lead and try to reproduce the problem on a clone of the site. Let me know how you would like to proceed.