Magento 2.2.6 disk space utilization - /var/lib/mysql/ folder is taking 43 gb
-
14-04-2021 - |
Question
Due to some reason my magento 2 website (Magento ver. 2.2.6) taking too much space from the server . Yesterday there is 1.2 gb available now only 240mb available . Please help on this .
Please see the attached picture now
UPDATE : I have found that most of the disk space is taken by /var/lib/mysql/webna this folder (42 gb). Here webna is my database name .In that folder i can see lots of IBD , FRM, MYI files. There is on file inside the webna folder called mageplaza_smtp_log.ibd and it's file size is 43 gb.
Solution
var/cache - store all cacheable objects but not page cache
var/page_cache cache from full page cache (if you don't use varnish or redis)
Doc: https://devdocs.magento.com/guides/v2.3/howdoi/php/php_clear-dirs.html
Your issue can be related with advanced reporting, but I don't know what version of Magento you use.
Check /tmp/analytics is it taking a lot of space?
Issue Magento 2.2.6 -advanced reporting
You can install ncdu on server , it's nice visualization to find what is taking a lot of space.
Command:
ncdu /
Update: Mageplaza SMTP log file was large.
OTHER TIPS
It seems that you're using Mageplaza SMTP module.
This module has a configuration setting to delete all emails after X days. Simply set to 30 days, and the next cron run will reduce your database size.
Did you check auto Backup (Scheduled Backup ) is enabled, under store->Configuration->ADVANCED->System->Backup Settings. you have to maintain your Backup Scheduled.
What specific version of Magento are you on?
How many SKU do you have in your store? #Sku's will drive page cache and block cache growth.
Its possible images being resized are also probably increasing storage space - when you import product photos we don't re-size the images until the store takes traffic. Your store is getting traffic and triggering the image resizes. You'll have a # of image resizes based on the # of different images your theme uses.
Have you tried flushing your cache? That should clean up the cache files from var/. You'd want to do that after you upgraded anyway so there's no harm in doing it before to reduce your backup time.
reference https://github.com/magento/magento2/issues/9458#issuecomment-298407480