WordPress Multisite Installation on Gcloud keeps growing 1gb per week

Keywords: WordPress Multisite - Google Cloud Platform - Technical issue - Other
bnsupport ID: 8d891d28-bae9-08f4-7bcc-f3d893ab3375
Description:
Dear community,

Thank you for the ongoing support. I have been running a Wordpress Multisite on Google Cloud and my 30GB HDD on my VM keeps growing 1GB per week. I have no big contents, only 3 websites with no big files hosted. Can you help me clean it up and save extra space?

Here is my Bitnami support ticket
8d891d28-bae9-08f4-7bcc-f3d893ab3375

Thank you so much!

Hi @leandro.charlotte,

The Bitnami installation is only using 7.4GB

-----------------------------------
Find biggest directories in installdir
-----------------------------------
Running: du -h . -d 1 | sort -h
In: /opt/bitnami

Output:

8.0K__./img
36K_./bndiagnostic
68K_./config
100K__./var
120K__./scripts
3.0M__./stats
3.4M__./sqlite
3.6M__./varnish
4.2M__./bnhelper
32M_./letsencrypt
82M_./php
117M__./bnsupport
143M__./common
182M__./bncert
369M__./licenses
771M__./apps
2.7G__./mysql
3.1G__./apache2
7.4G__.

but I can see the instance is using 15GB of disk

-----------------------------------
Check free amount of disk space
-----------------------------------
Running: df -h
In: /opt/bitnami

Output:

Filesystem      Size  Used Avail Use% Mounted on
udev            286M     0  286M   0% /dev
tmpfs            60M  7.7M   52M  13% /run
/dev/sda1        30G   15G   14G  52% /
...

I understand your instance is storing the rest of information in other directories. The du command will help you find the directories with more data in the instance.

https://superuser.com/questions/162749/how-to-get-the-summarized-sizes-of-directories-and-their-subdirectories

Happy to help!


Was my answer helpful? Click on :heart:

1 Like

Dear @jota thanks for the quick reply!

Please forgive my newbieness since I’m not IT crew.
I have configured my google cloud to do snapshots of my VM using the same disk that is running bitnami, so this is probably why the disk space is double of the bitnami correct? I just wonder if I’m not installing anything new, why my snapshots increase 1GB per week?

That bnsupport ticket was a week old, this one is brand new.
a4646f3b-5384-01e1-e9b6-e906551eb485

Thank you for the support!

Hi @leandro.charlotte,

If that’s the case, then you are storing your instance’s information twice in the server. Can you confirm you configured the backup that way? I suggest you use a different way to store the backups so you can easily recover the information in case of disk failure.

I suggest you check these guides to get more information

https://docs.bitnami.com/google/faq/troubleshooting/troubleshoot-server-performance/
https://docs.bitnami.com/google/apps/wordpress/troubleshooting/disable-binary-logging-mysql/

Note: The second guide assumes MySQL uses most of the space in the disk

1 Like

Dear @jota thanks for the advice and useful links. I’m goin to read them carefully. Have a great day! :smiley:

Dear @jota, thanks for the ongoing support.
I have disabled binary logging :slight_smile:

First, I’m sorry I have delivered wrong info, my snapshots are not stored in the same disk, they are stored in the same zone (east-1a). So thankfully, my backup is safe!
Second, I have found out that my /opt/bitnami/apache2/logs is 4GB is size (error_log alone is 3.6GB). Is it safe to delete these files?

Thank you again!

Hi @leandro.charlotte,

That sounds better :slight_smile:

Logrotate should be configure to rotate your logs in case they contain large number of lines. You can check its configuration or configure it by checking this guide

https://docs.bitnami.com/google/apps/wordpress/administration/configure-use-logrotate/

However, the error_log file is big because it contains many errors and you should fix them before removing the info. Once you review them, you can generate a new error_log file by running these commands

sudo /opt/bitnami/ctlscript.sh stop apache
sudo rm -rf /opt/bitnami/apache2/logs/error_log
sudo touch /opt/bitnami/apache2/logs/error_log
sudo chmod 744 /opt/bitnami/apache2/logs/error_log
sudo /opt/bitnami/ctlscript.sh start apache

Happy to help!


Was my answer helpful? Click on :heart:

1 Like

Thanks @jota I will definately do this!

The errors are related to the cookies settings of my wordpress multisite, lines 87, 88, 89 and 90 of my wp-config:

9PHP message: PHP Warning:  Division by zero in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98SITECOOKIEPATH\xe2\x80\x99 - assumed '\xe2\x80\x98SITECOOKIEPATH\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98 - assumed '\xe2\x80\x98' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x99 - assumed '\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning: A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message:
PHP Warning:  Division by zero in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90'
[Wed Apr 07 14:01:43.573197 2021] [proxy_fcgi:error] [pid 30714:tid 140384545888000] [client 172.68.10.62:59654] AH
01071: Got error 'PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98COOKIE_DOMAIN\xe2\x80\x99 - assumed '\xe2\x80\x98COOKIE_DOMAIN\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 87PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x9c - assumed '\xe2\x80\x9c' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 87PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98ADMIN_COOKIE_PATH\xe2\x80\x99 - assumed '\xe2\x80\x98ADMIN_COOKIE_PATH\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 88PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98 - assumed '\xe2\x80\x98' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 88PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x99 - assumed '\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 88PHP message: PHP Warning:  A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 88PHP message: PHP Warning:  A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 88PHP message: PHP Warning:  Division by zero in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 88PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98COOKIEPATH\xe2\x80\x99 - assumed '\xe2\x80\x98COOKIEPATH\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98 - assumed '\xe2\x80\x98' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x99 - assumed '\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  Division by zero in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 89PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98SITECOOKIEPATH\xe2\x80\x99 - assumed '\xe2\x80\x98SITECOOKIEPATH\xe2\x80\x99' (this will throw an Error in a future version of PHP) in opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x98 - assumed '\xe2\x80\x98' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  Use of undefined constant \xe2\x80\x99 - assumed '\xe2\x80\x99' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning: A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  A non-numeric value encountered in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90PHP message: PHP Warning:  Division by zero in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on line 90'

Weirdly, my wp-config is giving two values to COOKIE_DOMAIN. Maybe that is causing the error?

define( 'WP_DEBUG', false);
define( 'WP_DEBUG_LOG', false);
define( 'WP_DEBUG_DISPLAY', false);
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'riowebfest.net' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define( ‘COOKIE_DOMAIN’, “ );
define( ‘ADMIN_COOKIE_PATH’, ‘/’ );
define( ‘COOKIEPATH’, ‘/’ );
define( ‘SITECOOKIEPATH’, ‘/’ );
define('FS_METHOD', 'direct');

Thank you again, this community changed my life :smiley:

Hi @leandro.charlotte,

As you can see in your last message, you are using wrong quote characters (’) in the COOKIE_DOMAIN and related lines and that’s why WordPress is throwing errors.

You will need to use this block of code

define( 'WP_DEBUG', false);
define( 'WP_DEBUG_LOG', false);
define( 'WP_DEBUG_DISPLAY', false);
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'riowebfest.net' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define( 'COOKIE_DOMAIN', '' );
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIEPATH', '/' );
define( 'SITECOOKIEPATH', '/' );
define( 'FS_METHOD', 'direct' );

Note I changed with ' in the configuration lines you posted

1 Like

Fantastic! I was able to fix the error and delete the old log! Thank you so much @jota!!

Perfect! :tada: I’m really glad to hear that!

Enjoy! :slight_smile: