Support » Plugin: Rate my Post - WP Rating System » Hosting CPU usage increase

  • Resolved catshands

    (@catshands)


    Hello, I love everything in your plugin but have a performance issue.
    I’ve read your answers about admin.ajax usage for compatibility with caching plugins, but seems like this increase CPU usage dramatically.
    I have a 100 pages website with 8.000 daily visitors, working with WP super cache + Autoptimize. After installing this plugin I had a 4 times increase in CP load, which seems too much.
    Is it possible to serve users with cached rating instead, and update it only when post cache is updated? And in 1st place, may it even help?

    • This topic was modified 6 months, 1 week ago by catshands.
    • This topic was modified 6 months, 1 week ago by catshands.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Blaz K.

    (@blazk)

    Hi @catshands,

    this indeed seems a lot. I haven’t noticed such an increase in CPU load and I use the plugin on live websites as well. Are you sure that it’s the CPU and not the script executions? The plugin “adds” one script execution per pageview (ajax call) and I know that in some cases hosting providers limit these executions to relatively low number for the least expensive plans (10.000 per 24h etc.).

    I don’t think caching the output is the right way to go about this because it’ll be a bad user experience. For example, the visitor will see “based on 2 votes” but after rating the post, it will shown him “based on 5 votes”.

    Maybe you could rewrite the JS file to load the results only when visitor scrolls down to the widget? I’m not sure how much this would help but it’s a starting point and not too much work 🙂

    Thanks for reply =)
    Yep, you’re right, it’s some kind of “processing time” which is used on shared hosting.
    Thought, I still used only 18% of the daily limits for 8.000 daily visitors and yesterday was 85%.
    Now I’m testing Yasr (still I like your plugin way more) and seems like it would be around 40% of daily script execution limit. What might cause the difference, maybe period of logs update (seems like Yasr doesn’t have real-time logs, what is fine)?
    And still, I dream about staying on my cheap shared with close to static site and your rating plugin=).
    The script was called 9.000*1.4(pages per visitor)=12.600 times, while only 180 votes were made. Wouldn’t it make sense to regenerate page cache any time the post is rated, so it will be only 180 page builds instead of 12.6k script calls (considering the % of people who vote always low)? I mean this will make a great difference from other ajax rating plugins, providing better performance and lower resource usage.

    catshands

    (@catshands)

    Forget about Yasr. It had problems for most users and I got only 30 votes per day.

    Plugin Author Blaz K.

    (@blazk)

    @catshands, regenerating the cache after the post is rated won’t do the trick 🙂 when a visitor lands on the page the vote count and average rating have to be updated to match the real vote count and real avg rating which are displayed under the widget – hence the script execution on every page load.

    If you are a developer, try to rewrite javascript to do the script execution only once the visitor scrolls to the rating widget. I think this would save quite some resources 🙂 You can use a library like waypoints https://github.com/imakewebthings/waypoints and then call load results function (rate-my-post\public\js\rate-my-post-public.js l 46-57).

    Blaz

    catshands

    (@catshands)

    Nah, I’m a cat – I can’t code. That’s why I don’t want to switch from shared to VPS – dunno how to administer it.
    Still, your plugin is great. Thanks for the answers! Will stick to shared till 30k daily, then hire somebody to setup VPS and then I’ll install it again =)

    Plugin Author Blaz K.

    (@blazk)

    @catshands,

    I don’t know if this is still of interest, but in version 2.10.0 (just released) the plugin no longer uses ajax on page load. This should solve the problem 🙂

    Note: It still works with caching plugins but this is handled differently now 🙂

    Regards,
    Blaz

    • This reply was modified 3 months, 2 weeks ago by Blaz K..
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.