Sync Dashboard with Child Sites spikes RAM

MAINWP and 27 child sites on the same VPS server. When I click Sync Dashboard with Child Sites the RAM consumption spikes. If I do it at the same time as other processes such as SPAMD it brings the websites down.

There are numerous php-fpm: pool processes running after clicking the Sync Dashboard with Child Sites and they each take up RAM resources. After the sync is done RAM usage goes back to roughly 50%

Total processors: 48
Vendor: GenuineIntel
Name: Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz
Speed: 2300.000 MHz
Cache: 16896 KB

Current Memory Usage
total used free shared buff/cache available
Mem: 4194304 2476712 327068 145464 1390524 1572116
Swap: 0 0 0
Total: 4194304 2476712 327068


### Server Info                    Required                                               Detected                                     Status   ###

MainWP Dashboard                   
MainWP Dashboard Version           4.1.7                                                  4.1.7                                        Pass        
MainWP Upload Directory            Writable                                               Writable                                     Pass        
MainWP Extensions                  
Advanced Uptime Monitor Extension  5.2                                                    API License Active                           Pass        
MainWP Clean and Lock Extension    4.0.1.1                                                API License Active                           Pass        
MainWP Custom Dashboard Extension  4.0.2                                                  API License Active                           Pass        
MainWP Page Speed Extension        4.0.1.1                                                API License Active                           Pass        
MainWP Pro Reports Extension       4.0.6                                                  API License Active                           Pass        
MainWP Sucuri Extension            4.0.8.1                                                API License Active                           Pass        
MainWP UpdraftPlus Extension       4.0.4                                                  API License Active                           Pass        
MainWP Vulnerability Checker Extension4.1                                                    API License Active                           Pass        
WordPress                          
WordPress Version                  >=3.6                                                  5.8                                          Pass        
WordPress Memory Limit             >=64M                                                  128M                                         Pass        
MultiSite Disabled                 =true                                                  true                                         Pass        
FileSystem Method                  = direct                                               direct                                       Pass        
PHP                                
PHP Version                        >=5.6                                                  7.4.22                                       Pass        
PHP Safe Mode Disabled             =true                                                  true                                         Pass        
PHP Max Execution Time             >=30 seconds                                           30                                           Pass        
PHP Max Input Time                 >=30 seconds                                           60                                           Pass        
PHP Memory Limit                   >=128M                                                 256M                                         Pass        
PCRE Backtracking Limit            >=10000                                                1000000                                      Pass        
PHP Upload Max Filesize            >=2M                                                   8M                                           Pass        
PHP Post Max Size                  >=2M                                                   8M                                           Pass        
SSL Extension Enabled              =true                                                  true                                         Pass        
SSL Warnings                       = empty                                                error:0607A082:digital envelope routines:EVP_CIPHER_CTX_set_key_length:invalid key lengthWarning     
cURL Extension Enabled             =true                                                  true                                         Pass        
cURL Timeout                       >=300 seconds                                          60                                           Warning     
cURL Version                       >=7.18.1                                               7.78.0                                       Pass        
cURL SSL Version                   >=OpenSSL/0.9.8l                                       OpenSSL/1.1.1k                               Pass        
PHP Allow URL fopen                YES                                                    
PHP Exif Support                   YES ( V7.4.)                                           
PHP IPTC Support                   YES                                                    
PHP XML Support                    YES                                                    
PHP Disabled Functions             exec, passthru, shell_exec, system,                    
PHP Loaded Extensions              Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, session, shmop, snmp, soap, sockets, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib
MySQL                              
MySQL Version                      >=5.0                                                  10.2.40-MariaDB                              Pass        
MySQL Mode                         ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
MySQL Client Encoding              utf8                                                   
Server Info                        
Server Software                    Apache                                                 
Operating System                   Linux                                                  
Architecture                       64		 bit                                               
Server Protocol                    HTTP/1.0                                               
HTTPS                              ON                                                     
Server self connect                Not expected HTTP response body:                       
User Agent                         Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.73
Gateway Interface                  CGI/1.1                                                
Memory Usage                       6.64 MB                                                
Request Time                       1629350728                                             
Accept Content                     text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Charset Content             N/A                                                    
MainWP Settings                    
Number Of Child Sites              27                                                     
Use WP-Cron                        Yes                                                    
Optimize for Shared Hosting or Big NetworksNo                                                     
Automatic Daily Update             Install trusted updates                                
Abandoned Plugins/Themes Tolerance 365                                                    
Maximum number of posts to return                                                         
Maximum number of pages to return  50                                                     
Primary Backup System              Default MainWP Backups                                 
Maximum simultaneous requests      4                                                      
Minimum delay between requests     200                                                    
Maximum simultaneous requests per ip1                                                      
Minimum delay between requests to the same ip1000                                                   
Maximum simultaneous sync requests                                                        
Minimum simultaneous install/update requests                                                       
Active Plugins                     
MainWP Dashboard                   4.1.7                                                  Active                                       
Site Kit by Google                 1.39.0                                                 Active                                       
UpdraftPlus - Backup/Restore       1.16.59                                                Active                                       
WP 2FA - Two-factor authentication for WordPress1.7.1                                                  Active                                       
WP Cerber Security, Anti-spam & Malware Scan8.9.3                                                  Active                                       
WP Mail SMTP                       3.0.3                                                  Active                                       

Web hosting company says I need to pay for a bigger VPS but the cost difference it too much to justify.

Can I make this work on my current VPS or should I put the MAINWP website on a separate server?

I would start with enabling this setting to optimize for shared hosting/big networks:

1 Like

Follow @josklever’s advice & or move your MainWP Installation to it’s own server which is what we recommend anyways…

1 Like

The optimize setting didn’t help me. As soon as I clicked the sync button my memory went from 51% to over 80% to crashing the VPS. :frowning:

Can I put MAINWP on a shared server or do I have to spend the big money for another VPS?

Any reason that the PHP version is still on 5.6 and not 7.4.x?

Is the WordPress version really 3.6 on the MainWP dashboard site the current version of WordPress is 5.8.

PHP memory limit could be bumped up to 256MB from 128MB or even the much lower 64MB.

define('WP_MEMORY_LIMIT', '256M');

Instances are pretty reasonable on Digital Ocean or Vultr.

@sebastian-moran I think you missed some >= signs. The report isn’t showing the actual values (PHP, WP, mem), but the fact that it’s better than the minimal required value. :wink:

1 Like

@RonTheWebGuy Which WordPress version and the PHP version that is being used for the MainWP dashboard VPS?

@sebastian-moran The report above is for the MainWP Instance I believe. It’s running PHP version 7.4.22, WP v5.8

@RonTheWebGuy There is an SSL issue but I don’t think that would effect RAM usage. MainWP can be used on Shared Servers just fine. I ran one on a SG Gogeek account for years no issues. You can run MainWP on a Raspberry Pi if you want too. It really depends on your allotted resources. It may be that 27 sites (depending on how demanding each of those are on the server) is just to much for your VPS Tear. Do you mind sharing your Server Specs in more detail?

One option could be to run your MainWP Instance Locally if you can’t justify the cost of a second VPS. Check out https://laragon.org/ it’s free, fast & easy to use with easy wp installations build in.

If you don’t want to share specs or would like us to investigate a bit deeper into your setup feel free to open a mainwp.com/support ticket that that our team can help.

All my websites are on: PHP version 7.4.22, WP v5.8

2 Likes

I am more than happy to share my server specs. Not sure what you need or where to find such? I have cPanel and WHM Root if that helps? Let me know what you want to see and how to find it?

I’ve been on the 4GB plan for a while (1 yr 5 months) now: Reseller VPS | Managed Reseller VPS Hosting | InMotion Hosting

I had no issues with RAM or the VPS crashing until about 5-6 weeks ago. I have not added any websites since this issue started around the middle of July.

My web host and I have tweaked the VPS a ton over the last few weeks since this issue started happening. We’ve spent hours on php-fpm and nginx caching trying to reduce RAM consumption. We even got rid of my custom nameservers. I even made the majority of my clients move their email services off my VPS. We added “Configserver Security & Firewall (CSF)” - and I am adding IP #'s when I can to block anything potentially bad.

All is ok until I hit the green Sync Dashboard with Child Sites button. I have watched the RAM consumption closely for days now. The average RAM consumption is 30-50% until I click the Sync Dashboard with Child Sites button - then it goes over 80% and occasionally crashes the VPS taking all the websites down.

As for the 27 sites I host: Most are what I call simple brochure sites. Super basic WP sites with very minimal traffic. Nothing fancy. Examples:

@RonTheWebGuy Yeah it sounds like you know what you are doing - that’s always a plus. This is a normal setup that we see usually so there is definitely something going on.

I am reading that failed cURL processes can sometimes cause this to happen on specific setups. It’s where the cURL processes get stuck and don’t timeout but but rather stack up and use up the allotted resources. Are you seeing anything within your CSF logs pointing to your MainWP I.P. saying it’s being blocked?

I would like you to open up an official support ticket. It sounds invasive but, If you provide us with SFTP access and TMP Admin Access to your MainWP Installation within the support ticket, we can go over your setup to be sure it’s setup correctly.

I am not seeing anything odd in the CSF logs.
I opened a support ticket yesterday #5498 - but I will update it with the SFTP and Admin Access to my MainWP installation in about 30 minutes so you can dig into this further.

@kwcjr - just so I am clear: You want me to add the /wp-admin login details for my MainWP installation in my support ticket PLUS you want SFTP access to the same domain? Please clarify as it seems odd for me to post that info into a text field online.

@RonTheWebGuy Yes of course you would add that to a PRIVATE ticket. I never asked for you to post that info here in public - hence the reason the the private ticket. If you would like our team to look into your setup further then that’s the info that we will need in order to perform our job. Without it we can not help you.

@kwcjr - Yea, I would never post that info on a public forum. I was confused as I couldn’t find a separate/private area/ticket to post this type of sensitive info in the support area like other support systems have.

Details have been submitted. I look forward to hearing what you find. :slight_smile:

I did such and it still spikes the RAM on my VPS

I truly appreciate the intro to Laragon as I foresee future use of it. :+1:

1 Like

@RonTheWebGuy

Are there any slow queries showing when you sync the MainWP dashboard with the connected child sites?

You could enable Heartbeat Control on the MainWP dashboard site to control the Heartbeat API usage from WordPress.

I installed/activated Query Monitor and to be honest I didn’t understand the full extent of that plugin - but when I clicked the Sync Dashboard with Child Sites the slowest query was 0.0020 - nothing popped up or was highlighted as slow/red.

I will look into the Heartbeat Control plugin next.

@RonTheWebGuy

The query monitor plugin is not showing any slow queries in that case.

1 Like

@kwcjr - You mentioned cURL - coincidentally I had another error/issue (different plugin) and the plugin developer mentioned that the cURL settings on my server might be incorrect. I have looked high & low in cPanel, WHM, WHM Root, php.ini, etc. Do you know where I can go to see and maybe even adjust the cURL setting to see if it helps… or is that a backend network setting that only my webhost can adjust?

@RonTheWebGuy If You’re running WHM you have all the settings right in front of you I believe. Search for EasyApache that’s where your cURL settings are located - so says google. I also run WHM & cPanel on my dashboard Server… I’ll look to see if there are any settings I can share a bit later when I have time.

The only cURL settings that I have ever messed with in order to get MainWP working is the cURL Timeout ( socket timeout ) However, all servers arrrrrre different so it would be safe to say that there might be something not quite right with your server setup as the other plugin dev has suggested. Might be why we can’t figure out wth the issue is here…

What settings have they suggested that you change??