Skip Navigation

[Resolved] Performance Issue

This thread is resolved. Here is a description of the problem and solution.

Problem:
My site is slow, what can I do.

Solution:
There are several things that can slow down a Website.
First you need to know what makes it slow.

This is usually done by activating/deactivating plugins and themes to see what is the issue source.

If this narrows down to Toolset, please contact us.
Also please first read this very detailed 2 posts:
https://toolset.com/forums/topic/performance-issue-2/#post-534954
https://toolset.com/forums/topic/performance-issue-2/#post-536459

Relevant Documentation:
https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 8 replies, has 3 voices.

Last updated by ioannisM-2 7 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#533828

Hello,

I have a very serious performance issue with my website. Please help...

I have 18 active plugins that are:

Code Snippets
Invisible reCaptcha
Relevanssi
Simple Custom CSS
Toolset Access
Toolset CRED
Toolset CRED Commerce
Toolset Maps
Toolset Types
Toolset Views
Toolset WooCommerce Views
WooCommerce
WooCommerce Multilingual
WP-Mail-SMTP
WPML Media
WPML Multilingual CMS
WPML String Translation
WPML Translation Management

If you need to login the credentials are here:
https://toolset.com/forums/topic/custom-shortcode-parametric-search-views/#post-531656

In the same post you can see an example url that you can visit

What would you advise?

Thank you!

#533888

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi ioannis,

Thank you for contacting our support forum.

Could you try running a performance test on your site to see which plugins are slowing down the site?

https://wordpress.org/plugins/p3-profiler/

Thanks,
Shane

#534024
image4493.png

Hello Shane,

thank you for your reply!

A.
I installed the plugin but I couldn't understand the results...
In the first tab "Runtime by plugin" it mentions only the "P3" plugin and it says 100%.
The plugin impact is "2416922.0%" What does that mean?

B.
I found the following ticket: https://toolset.com/forums/topic/can-toolset-can-handle-a-big-db/. Here Beda explains in depth how toolset and wordpress work together and how does affect (depending on the user's set up) the performance of the website. After I read that ticket I am concerned about if finally toolset and wordpress is the right choice for me.

Dear Shane could it be possible to assign this ticket to Beda as I have some questions on what he says in that ticket about performance? Thank you!

So here are my questions:

1) I have the folowing set up: a few custom post types, about 50 taxonomies and about 30 custom fields. I have modified with toolset plugins the wordpress archives for the taxonomies. When a user logs in he can see about 8 different views with personalized information about his activity in the website and that is different for each user . My website will be a directory for professionals but every user can log in and create posts, send messages, subscribe to posts, favorite posts etc. In the future I may have thousands of users that they will have subscribed to my website and maybe hundrends of them login every day to book services, create content and see all this personalized info that will be different for each one. Do you think that toolset and wordpress can handle this?

2) Beda you say that the problem is with WP_Query. Could you please explain? That has to do with the query filter or the search filters of a view/ archive or both om them? If I create a wordpress archive with one or two post types, filtered by a very limited amount of Meta values and a few search filters I will still have a problem if we assume that there are a lot of rows in the database?

3) In which case do I have better performance? When the database is searching for a term of a taxonomy or when it is searching for a custom field?

4) According to the documentation https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/ cache is disabled when WPML is active. What if I make WPML to use different view or different content template for each language? The cache is still disabled in this case?

5) Does the cache work in a WordPress archive? I am asking because normally it's content changes according to the url. If not, could the following set up work? II could replace the taxonomy terms with custom fields. I could then create a page for each field with a specific view that returns posts that contain that field. This way the pages with the views will have standard content and I assume they will be cached. Or on the other hand that could it be possible to create performance issue because of the big amount of views and pages?

6) According to the documentation "Cache is automatically turned off for Views when the user is loading a custom search ". Could the following set up work? Instead of inserting 7 different filters in a view, I could create a page with 7 different views inside it without the filters. Could all these views be cached?

7) And finally I would like to ask your opinion about drupal in comparison with toolset+wordpress. Do you think that drupal could manage better a lot of queries to the database if it is compared with wordpress?

I am sorry for my so long message but I wouldn't like to have a big problem in the future if wordpress cannot handle a set up like this, I believe that you understand my concern. Thank you!

#534332

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ioannis,

I can assign this ticket to Beda, however you wouldn't get a response until around tomorrow or Sunday since Beda is currently off right now.

Would that be ok ?

Please let me know.

Thanks,
Shane

#534364

Yes, that's fine. I can wait, thank you Shane!!

#534954

Hi Ioannis, here I am.

Let me get straight to your questions:

I have the folowing set up: a few custom post types, about 50 taxonomies and about 30 custom fields. I have modified with toolset plugins the wordpress archives for the taxonomies. When a user logs in he can see about 8 different views with personalized information about his activity in the website and that is different for each user . My website will be a directory for professionals but every user can log in and create posts, send messages, subscribe to posts, favorite posts etc. In the future I may have thousands of users that they will have subscribed to my website and maybe hundrends of them login every day to book services, create content and see all this personalized info that will be different for each one. Do you think that toolset and wordpress can handle this?

Here I cannot say much more as I already stated in the other thread.

Yes, and no.
Yes, because of course, WordPress (and if WordPress can, toolset can too) can handle this.
But, you might get some slow down, some bottlenecks in the Database.
It will also depend on your Host.
Many hosts throttle your Website if it usees too much resources, without even telling you.
This is of course not something related to WordPress or Toolset, but definitely to keep in mind!

Your amount of Posts, Terms, Taxonomies, Fields and users should not be an issue, as long you load this content in a very detailed and well planned manner.
As an example, do not use too many HTML conditionals, but try to Query Filter those contents instead.

This means, if you HTML conditionally hide things, the Query Still loads that content, right?
It is just hidden. This equals to more content queried and therefore more time used.
If you can ad Query Filters instead in your Views that already filter out unwanted content before rendering, you can save a few milliseconds here and there and that has impact, at a large scale.

I would avoid load 10 Views on one Page, instead, load as less content as possible on each URL.
This avoids long loading times also.

Beda you say that the problem is with WP_Query. Could you please explain? That has to do with the query filter or the search filters of a view/ archive or both om them? If I create a wordpress archive with one or two post types, filtered by a very limited amount of Meta values and a few search filters I will still have a problem if we assume that there are a lot of rows in the database?

The problem with WP_Query is it hits one table in the Database.
The posts table.
This cannot be avoided, as that is the WordPress Structure.
Everything you load that is a Post comes from that table.
This means, if 1000 users perform the same query simultaneously, well, you can imagine what happens.

This can be avoided a little by using cache, but be careful with cache, it also can slow down a site if misused, or give wrong results.

The problem with WP_Query is straightforward and just one:
It hits the same database tables over and over again.
Anf there is nothing we can do about.

The idea is to avoid as many calls to the Database as possible, and if, then make very strict queries as said above. Filter out what is not needed the earlierst Possible, not with HTML conditional but with one single QWuery FIlter or Custom filter, or as less as possible.

In which case do I have better performance? When the database is searching for a term of a taxonomy or when it is searching for a custom field?

Custom Fields might be a bit better for perfomance. But there isn't much of a difference as at the end what you will load is... the posts table.
Taxonomies might be a little more expensive.

According to the documentation https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/ cache is disabled when WPML is active. What if I make WPML to use different view or different content template for each language? The cache is still disabled in this case?

Yes. And there is nothing we can change here.
Views almost never cache the content, to be honest.
This is because lets assume you change one post field in one of the thousands of posts.
This needs to be reflected in the View, right?
As soon you update a Post, Field or whatnot, the cache is invalidated.

Does the cache work in a WordPress archive? I am asking because normally it's content changes according to the url. If not, could the following set up work? II could replace the taxonomy terms with custom fields. I could then create a page for each field with a specific view that returns posts that contain that field. This way the pages with the views will have standard content and I assume they will be cached. Or on the other hand that could it be possible to create performance issue because of the big amount of views and pages?

As long each page has one View, there is little (or less) impact.
What is to consider is of course, if now 1000 users hit that same page and view at the same time... there is not much to elaborate I think. It will bottleneck. No matter wether you use Terms, or Fields.

But splitting the Queries on different Pages is definitely a good idea. Present the user as possibly with the content he wants to see before he even needs to refine the query.

According to the documentation "Cache is automatically turned off for Views when the user is loading a custom search ". Could the following set up work? Instead of inserting 7 different filters in a view, I could create a page with 7 different views inside it without the filters. Could all these views be cached?

Yes. But remember, ONE Field is changed in all the posts, the View will be cache-invalidated. This makes sense, right?
But defintely it's better, ion terms of perfomrance to abvoid any additoonal query.

And finally I would like to ask your opinion about Drupal in comparison with toolset+wordpress. Do you think that Drupal could manage better a lot of queries to the database if it is compared with WordPress?

I am sorry to say that I have no idea. I never used Drupal, and I don't even know how their Databases are structured.

I will query with my colleague's wether someone has experience here.
I apologise for my lack of knowledge here.

I am sorry for my so long message but I wouldn't like to have a big problem in the future if wordpress cannot handle a set up like this, I believe that you understand my concern. Thank you!

Of course, I understand this.
As said, WordPress can handle it, the question is how busy this site will get, and if, then also the Host is a very very important detail.

Look at WordPress (.com or .org)
Those sites have thousnads, if not hundreds of thousnads of users, contents, queries, and whatnot.
It works. And it works fast.
They, of course, have properly optimised databases, servers and so on.
This is not something I can help with, but you will need to look at this once your site gets traffic.

I suggest talking to your Host about that.
As from personal experience:
Hosts sometimes are too cheap. And then the service lacks.
So, a smaller, maybe more expensive Host can be much better solution here, as you will be able to personally talk to them and develop detailed solutions.

Let me know if there are any doubts left, ok?

#536055

Beda I have no words... Thank you so so much for your so helpfull answer!! Now I understand bettter how it works. I have just 2 last questions:

1) Although my website's score in pingdom,gtmetrix etc is very good ,when I visit it, it loads very slowly and I am the only user for now... I couldn't figure out how p3-profiler plugin works. https://toolset.com/forums/topic/performance-issue-2/#post-534024 Is there any other way to test which plugins are slowing down my website?

2) I need to create consultants' profiles. If I assume that I have 200000 users and only 100 of them are consultants what is it faster?

a) I create the custom post type "consultant" and wordpress searches for custom fields in the consultant's post type.
b) I try to avoid creating a lot of post types and I just create the role: "consultant". Now wordpress has to scan the 20000 users to find the ones that have the role consultant or not ?

If it can find the consultants without scanning the 20000 users I do not need to create an extra post type. But if it scans them all it would be better for performance if I created it.
What would you suggest?

#536459

Although my website's score in pingdom,gtmetrix etc is very good ,when I visit it, it loads very slowly and I am the only user for now... I couldn't figure out how p3-profiler plugin works. https://toolset.com/forums/topic/performance-issue-2/#post-534024 Is there any other way to test which plugins are slowing down my website?

The easiest is enable/disable and test.
Only when you need concrete data about what exactly in the plugin is slow, those Profilers can be helpful, but to be fully honest, I don't use them.
If I want to find a culprit I use the "hammer" which means simply disable everything and then step by step re-enable.
You will have the culprit much faster, and there is no need to slow down the site even more with... a performance measuring Plugin.

I need to create consultants' profiles. If I assume that I have 200000 users and only 100 of them are consultants what is it faster?

Probably you should use Access and set up a Custom Role:
https://toolset.com/documentation/user-guides/managing-wordpress-admin-capabilities-access/

If you create a Post Type, it will query all Posts of that type at least, until it finds the Custom Field.
With user roles you can target directly BUT, you will have less power in Views when displaying an User View.
They cannot have Custom Searches.

#536818

Perfect, Beda thank you so much for your help and for sharing all this invaluable information!!!