Hi, we're using Toolset in a marketplace function (hidden link) that has users submit listings.
Anyway, we have done some custom-work in creating the dropdowns and search & filter tools for our AJAX results. This includes a custom relationship between Categories, Makes, and Models since Toolset wasn't equipped with the way we wanted to create that relationship.
That's just background info. What we see now is that results in AJAX loading are approximately 4 seconds to 5 seconds long. Is there any way we can speed that up? Or, is there something we can do to help speed that up from server resources, caching, etc. etc.? Ideally that filtering process is much quicker. Just wanted to ask. Thanks!
Hello and thank you for contacting Toolset support.
Well, the performances questions are usually the hardest question to answer, we'll need to get more details about the use case to tell. Would you allow me temporary access to check your website further and understand how the page is setup? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
In the meantime, I'll suggest that you disable AJAX, install Query Monitor and inspect the pagination results to see what is taking too much time.
Thank you for your feedback and the credentials. I have disabled AJAX on the view and activated Views Debug mode(Toolset->Settings->Front-end Content), to get more information(Query Monitor, Views' debug popup) about the search.
From what I can gather so far, the view is not really the culprit here. All calls to get_posts, that the view uses under the hood, are generated in less than 100ms, which is IMHO not an issue. Check this screenshot hidden link
The view can be optimized a bit, by emptying the price range fields when they are not being used. But, I don't think it will have any noticeable effect. Getting from 100ms to 90ms is not really optimization. You can do this in the custom Javascript code of the view.
Maybe, as you have though, an issue from the theme or a plugin. To be sure about it, consider the following tests, and note each time the results from Query Monitor:
1.1 Toolset (+ your theme and plugins).
1.2. Toolset + your theme, without any other plugins.
1.3 Toolset + A default theme such as 2021, without any other plugins
And note the following metrics:
- Page generation time.
- Peak memory usage.
- Database query time.
- Number of queries.
- The caller.
I am sure these tests will reveal the component that is causing the issue.
Jamal, thanks for investigating. Funny enough, I think you and I were seeing the same thing. I definitely agree getting down to 90ms is not the goal here -- it's the 4s or 5s load time on AJAX that's the real issue.
I'll investigate as recommended, and follow-up in a day or so with additional information in case I discover something useful. Thanks!
Actually one follow-up, is there anything you might know that causes slow load times on the back-end inside the Block Editor? Is that related to this underlying issue as well? It seems to be the case that Toolset pages require a "Processing server request..." box when loading (as you might have seen). Is this related to server resources e.g. PHP workers / CPU processing available to load that page? Or, is there something else going on inside the site that I should look into?
Well, if there are any performance issues they will be visible for the frontend and the blocks editor. Server resources are, of course, the limit of what this website/server could achieve.
From what I could gather so far, I can see two more improvement axes:
- The database server: It is now at MySQL 5.5.5: We recommend to use at least 5.6.
- The WP_MEMORY_LIMIT: By default, WordPress would enforce 40M. Toolset requires at least 128M. I have set it in wp-config.php to 256M and I can already see improvements in the page load time. Currently the server has 2G of memory limit(PHP settings), but the WordPress frontend will use only 40M. And Query monitor says that it uses more than that. Check this screenshot hidden link
https://docs.woocommerce.com/document/increasing-the-wordpress-memory-limit/
Keep in mind that Query Monitor adds its own overload. To get appropriate metrics about this marketplace page. You should also check how it behaves when Query Monitor is disabled. Of course, you won't need it for the live server, it is only useful for debugging.
This being said, I think that you should run the tests I have suggested before in order to spot what is causing the page to load slower.
I'll remain at your disposal.