But what do you recommend? I have around 30,000 visits a day. What options do you advise me of WPP?
The link I shared earlier already provides a few suggestions/recommendations so apply the ones that you think make sense in your case and that are technically possible.
If you want specific recommendations from me you’ll have to provide more details other than just traffic data so I can help:
- How long have you been using the plugin?
- Do you have access to Redis/Memcached/etc?
- How are you using the plugin at the moment? What are you using it for?
- PHP version?
- Are you using MySQL or MariaDB? And which version?
- What other plugins are you using?
- Etc.
I have been using it for about a month and a few days ago is when it has had a performance problem with mysql every 7/8 hours. It is a peak of CPU load of several minutes.
I have installed Memcached, Nginx, MariaDB (version: 10.1.26) and PHP 7.4. It’s a web about 30,000 visits a day with 4,000 posts. The theme I use is Bimber.
The theme I use is Bimber.
This is likely part of the problem. The Bimber Theme, last time I checked (a long time ago) partially duplicated the code of the WPP plugin within the theme. I don’t know if they have updated that part of the code ever since or not but if they haven’t then that would partially explain the performance issues you’re seeing now.
As for other suggestions:
Ok, I have done all those steps already. I just realized that the CPU consumption is triggered just when the plugin counts the viewed posts, or does the Bimber theme do it to create its lists? It is during those 5-10 minutes when the CPU fires. The rest of the time everything is fine
-
This reply was modified 6 years, 1 month ago by
virgilio27.
I just realized that the CPU consumption is triggered just when the plugin counts the viewed posts, or does the Bimber theme do it to create its lists?
No idea to be honest, I’m not really familiar with how the theme works internally. Does it cache the data returned by the queries the theme runs when building its lists? If not, the theme may be querying the database every time it displays each of its lists which in your case may partially explain the performance issues you’re seeing during specific times on your site (peak hours?)
Speaking of data caching, you may also want to check this out: Caching DB queries results. Note that this works only for database queries generated by the plugin itself, does not apply to theme generated ones (unless the theme internally uses WPP’s APIs.)
Seems to be a problem with the Bimber theme. When I add this code to functions.php (look at the link below) and I put 4 hours then every the 4 hours there is a peak in the CPU of several minutes because of mysql queries.
http://docs.bimber.bringthepixel.com/articles/lists/how-to-build/index.html
In the options the WPP I have deactivate cache, to test, and the same thing happens with cache activated
From the theme documentation it sounds like they do have a caching mechanism in place (hence the filter hooks they mention there). I guess that the theme caches the lists for X hours and rebuilds them after the expiration time has passed – in your case that’s every 4 hours as per your configuration. Then every 4 hours the theme queries the database to retrieve the data of each list, saves that to the cache, and finally rebuilds each list.
You’ll have to experiment with all this a bit to try to find a good balance between functionality and performance (eg. have Bimber rebuild its lists every 8-12 hours instead of every 4 hours, same thing with WPP’s built-in cache, etc.). That or just throw more money at the problem and get a machine with more resources (more CPU power, more RAM, etc) to improve your site’s performance.