Tracker slowness issues
-
Hello,
Today my website became very slow. I asked Cloudways what the issue was and they told me that a few plugins including Top 10 fast tracker are to blame. I am attaching the screenshot here.
https://ibb.co/LdyZS21s
https://ibb.co/M5nHhHV8Any suggestions? Whenever such an issue arises top 10 is usually in the top 3 (no pun intended).
Hope you can help.
The page I need help with: [log in to see the link]
-
Hello,
Unfortunately the issue persists.
Cloudways replied:
We will need to optimize the WP-Crons and furthermore, for the requests of plugins, it is from the Top 10 plugin for WordPress. This plugin tracks page views using a PHP endpoint (fast-tracker.js.php) instead of a traditional JS pixel, which means every page view results in a POST request to your server, increasing CPU load and PHP processing time.
Why This Is Causing Issue:
> These POST requests bypass page caching and hit PHP directly.
> They can become overwhelming on high-traffic sites.
> They’re triggered even by bots, crawlers, or automated requests unless filtered.
And this would require checking and optimizing the plugin with the help of their developer as this is code level optimization required to deal with the issue.
If there is something you can do let me know. These high CPU issues started with Top 10 and other plugins after I changed my theme to Astra so I have asked Cloudways to investigate further. Still, even when I had my previous theme the Fast tracker did cause a lot of hits for me (although maybe not as much). Is the fast tracker needed for a website like mine or can I go without it?
Warm regards,
The reality is that the fast tracker is designed to be faster than the traditional ajax or rest API trackers. You can switch to those and try it.
Do you have the option to disable bots enabled on your site?
There is one feature I do plan to eventually implement in the pro version which is on sampling. The idea being to not record every hit but a sample of hits. This only works for high traffic sites.
I still think the issue is the size of the Top 10 daily tables. Are you okay with exporting the tables and then completely emptying it from the Tools page and see if that works?
Please backup your database as always before making this change.
This will lose tracking data for the custom period but not the overall data.
I don’t understand the JS pixel comment they made above. I need to study this better.
I can try your suggestion. Will let you know.
However I have a question. You said your solution wont affect the overall period but what will happen to the custom periods? Will those widgets not work or will they kind of restart?
Yes, that is correct. Your overall widget will stay as is. But, your “custom/daily” widget will restart. One alternative to that is if you’re only doing a Trending this week / day, you can even limit the counts to only the last 7 days.
Same command as above but run it as 7 days instead of 6 months.
I believe you should have the necessary sql index as well in the system but if after you cut down the tables, you can go to the Tools page and then Recreate Primary Key (Or even Recreate Database tables).
BTW, I was researching JS Pixel concept and from what ChatGPT tells me, it is about running an Ajax request (which I do) on load – which means the problem is the same.
Do you use Redis or a similar object cache on your site and do you know what your server specs are?
Sorry for the late reply.
So I will run this command:
DELETE FROM wp_top_ten_daily WHERE dp_date <= DATE_SUB(NOW(), INTERVAL 7 DAY);
Then recreate database from Top 10 settings?
Okay. Will do that soon.
Also what about this wp config command: define( ‘TOP_TEN_STORE_DATA’, 90 );
This is causing errors, many of them. After making these changes, Cloudways let me know that the error log is full with this Top 10 error:
[proxy_fcgi:error [pid 752755:tid 752820 [client 223.123.93.255:0 AH01071: Got error ‘tions/#non-prefetchable-groups; PHP message: objectcache.notice: The cache key `astra_addons_nav_menu_loader_nav_items_transien…………ache.pro/docs/configuration-options/#non-prefetchable-groups; PHP message: PHP Warning: Constant TOP_TEN_STORE_DATA already defined in /home/601622.cloudwaysapps.com/pcupncbqaz/public_html/wp-config.php on line 103’, referer: https://www.google.com/
[proxy_fcgi:error [pid 752632:tid 752658 [client 103.26.86.102:0 AH01071: Got error ‘PHP message: PHP Warning: Constant TOP_TEN_STORE_DATA already defined in /home/601622.cloudwaysapps.com/pcupncbqaz/public_html/wp-config.php on line 103’, referer: https://www.paradigmshift.com.pk/pakistan-the-balochistan-conundrum/
I am removing this code from the wp-config until you let me know where to put it which wont cause issues.
Warm regards,
Yes on the command and recreating the table. This will limit the data to 7 days.
I don’t understand the error on the constant. Do you have any more details on what line is giving that error? I’ll run some tests on my end as well to see.
Nope. I just used AI to understand what the error was and it said that this happens when it has be defined before. Not sure.
I have run the command and I recreated the primary. I did not recreate the database, however. If its important let me know
You shouldn’t need that. The primary keys are important especially if I’m not mistaken you have an older install.
How has the site been performing with these changes?
Hello,
There doesn’t seem to be an issue now. I am not sure what worked – increasing the sever or trimming the top 10 database or both. Also for my case, what should be the max amount of data that top 10 saves. For example, above you said
define( 'TOP_TEN_STORE_DATA', 90 );However this was causing a recurring error in the error log. If this code starts working should I set it to 30 days instead or is 90 fine?
I think in your case 30 days will work well. I’ve filed a bug report for the constant issue.
https://github.com/WebberZone/top-10/issues/176
I suspect that increasing the server capacity, as well as truncating the table, helped. The larger the table, the slower the code, unfortunately.
Hello,
So some bad news the fast tracker is still one of the highest in count. Check this out.
Does this happen with other websites as well or just mine?
What does the count mean?
I’ve not had serious issues flagged by users on speed, particularly the tracker.
Count just means how many times it is used or hits in other words.
I asked Cloudways and they suggested “We also understand you’ve experienced high CPU usage from the Top 10 plugin. In cases like this, here are a few suggestions that might help:
- Enable JavaScript-based tracking within the plugin settings to reduce direct database writes.
- Consider using the Query Monitor plugin to track and debug specific query load.”
You must be logged in to reply to this topic.