• Resolved wpmhweb

    (@wppit)


    After enabling CDN with Stackpath on W3TC, I noticing a constant 15% increase in memory usage on the server, and uploading images to a new post using the media uploader takes about 10 to 15 seconds, when before it used to take 1 to 3 seconds.

    1. Are these expected behaviors?
    2. Why is this happening?
    3. Is there any way to fix this?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    Are you one shared server? Are you still experiencing the issue?
    There is a possibility that you got some spikes when uploading files to CDN.
    Can you also please share the settings in Performance>CND>Advanced and your website URL if convenient?
    Thanks!

    Thread Starter wpmhweb

    (@wppit)

    Yes, I’m still experiencing the same issue and worse, since today the CPU spiked about 17% for several hours tool, and the RAM also spiked a little more.

    I’m using a virtual machine.

    I also noticed that I/Os are also spiking.

    Website is pureinfotech.com, only setting enabled on “Performance>CDN>Advanced” is:
    – “Disabled CDN for the following roles” and “Administrator is checked”

    Then all defaults. For example,

    – wp-includes file types to upload: *.css;*.js;*.gif;*.png;*.jpg;*.xml
    – Theme file types to upload: *.css;*.js;*.gif;*.png;*.jpg;*.ico;*.ttf;*.otf,*.woff,*.less
    – Custom file list:
    favicon.ico
    {wp_content_dir}/gallery/*
    {wp_content_dir}/uploads/avatars/*
    {plugins_dir}/wordpress-seo/css/xml-sitemap.xsl
    {plugins_dir}/wp-minify/min*
    {plugins_dir}/*.js
    {plugins_dir}/*.css
    {plugins_dir}/*.gif
    {plugins_dir}/*.jpg
    {plugins_dir}/*.png
    – Rejected files:
    {uploads_dir}/wpcf7_captcha/*
    {uploads_dir}/imagerotator.swf
    {plugins_dir}/wp-fb-autoconnect/facebook-platform/channel.html

    All these settings are disabled:
    – Only purge CDN manually
    – Disable CDN on SSL pages
    – Use CDN links for the Media Library on admin pages
    – Add CORS header
    – Set cookie domain to “pureinfotech.com”

    – File types to import: (not configured)
    – Rejected user agents: (not configured)

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit

    Thank you for the info. The settings are looking fine.
    Judging by your recent posts, you are frequently experiencing the CPU/RAM usage issues.
    Does the issue persist if the CDN is disabled? Also, it would be a good idea to disable other plugins and leave W3 Total Cache enabled, just to see if the issue is still there.
    Thank you!

    It is very common when WP installation is created but missing Firewall protection. They can abuse WP installation without even login. You will see CPU spike each day due to updates but abuse works without CPU spike. Each 2 minutes it will be login attempt and if not blocked by Firewall it will start to consume RAM. In the first stage it will use all your resources but this is not the end. When you do not have SWAP, it will collapse your server. When your SWAP is exhausted it will collapse in any way. Just place Sucuri which is free plugin. You will see each 2 minutes login attempt. Maybe this is the cause.

    Thread Starter wpmhweb

    (@wppit)

    @bcvcbhqyxcgakhh thanks for your advice, but the problem is that it started happening exactly when I enabled the CDN feature of W3TC.

    Thread Starter wpmhweb

    (@wppit)

    @vmarko I’m testing again disabling the CDN, but for the record this problem started way back, and at time I thought it was something else, some I moved the website to a new server, and it appears that I forgot to enable the cdn feature, and while it was disabled the server didn’t spike the extra ram. Then when I realized that cdn wasn’t enabled, I turned it on again, and immediately the ram spiked around 15% and stayed that way.

    Thread Starter wpmhweb

    (@wppit)

    @vmarko Here are the test results:
    – RAM 26% with w3tc plugin disabled, CPU 12%
    – RAM 32% with w3tc plugin enabled and NOT CDN, CPU 8%
    – RAM 44% with w3tc + CDN (Theme files, media library attachments, CSS, JS files etc will quickly for site visitors.) enabled, CPU 6%

    CPU percentage is quite low. Disable all checkboxes for w3tc and see what happens. When nothing happens install https://wp-rocket.me/. Maybe this is as a testing phase.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit

    Thank you for the information.
    Can you please share your server specs? And one more thing is Stackpath CDN enabled using API or Generic mirror?
    Thanks!

    Thread Starter wpmhweb

    (@wppit)

    @vmarko thanks for the reply.
    The server has 2 cores and 4GB of RAM.
    I believe it’s using the API optin. When I clicked the authorize button, I have to enter the API information.
    Thanks,

    1. It is important also SWAP value as 4GB of RAM is very low for WP and
    2. you need to post also -/+ buffers/cache
    How much of the used memory has been put up to use as buffers and cache. How much memory is truly being used by processes you are running?
    -/+ buffers/cache
    3. innodb_buffer_pool_size is amount?

    So, many variables are missing and w3tc is probably not a cause.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit

    Thank you @bcvcbhqyxcgakhh for your suggestions and I believe you are correct.
    @wppit Is the RAM usage declining over time or does it stay at 44%?
    Have you tried enabling Stackpath CDN using the Generic mirror and Replace default hostname with the stack path URL?
    Thanks!

    Thread Starter wpmhweb

    (@wppit)

    @bcvcbhqyxcgakhh Although swap is important, vps companies advise you against swap on SSDs as it’ll cause performance issue over time.

    Also, I don’t know what’s the buffers/cache reference means. I don’t know if they’re talking about the w3tc or something on the server. In addition, I don’t understand innodb_buffer_pool_size…

    It’s early to tell, but I think I MIGHT have found the memory problem. It might be a piece of code in the theme, I’m trying to fix it. However, images still take a long time about 7 to 10 seconds to upload, when without the plugin upload in 1 or 2 seconds.

    Does w3tc sends the images to the cdn as they’re uploaded? Or after it’s published and it gets cached?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit
    Yes W3 Total cache automatically uploads images to CDN.
    THanks

    Thread Starter wpmhweb

    (@wppit)

    @bcvcbhqyxcgakhh during the upload by the user or after the post is saved or published.
    thanks,

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘W3TC + CDN spikes RAM usage and slower image uploads’ is closed to new replies.