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

enter image description here

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.

Please see the below image enter image description here

  • What is your total available space? May 23, 2020 at 8:33
  • i have total 50gb available. Yesterday when i have space issue i removed 1.2 gb from server now after 12 hour 1.2gb disk space also used 0% left . May 23, 2020 at 13:25
  • Check size of var/session ? May 23, 2020 at 19:43
  • i have checked the var/session folder but it is only 100 mb May 24, 2020 at 7:57
  • total size of /var/log/httpd is 676 mb May 24, 2020 at 8:14

3 Answers 3


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.


ncdu /

Update: Mageplaza SMTP log file was large.

  • dear friend my magento version is Magento ver. 2.2.6 . Now how can i solve this issue ? May 24, 2020 at 1:53
  • I checked solution in the link . I don't have lib/internal/Magento/Framework/Archive/Tar.php (Because there is no folder named Magento in internal folder) . But i have vendor/magento/framework/Archive/Tar.php . But the tar.php is last modified in 09/06/2018 . I think i am using magento 2.2.6 for last one year but the issue is just happens in the last 3, days May 24, 2020 at 2:05
  • I have removed 2 repetition of array_shift($dirFiles); in Tar.php and put $dirFiles = array_diff($dirFiles, ['..', '.']); as per the solution .I need to run any command in cmd after the code changes . Now how can i free up some space from server ? How can i make sure this is not happen again May 24, 2020 at 2:13
  • after the change in tar.php file also i free up 40 mb by deleting some unnecessary files i uploaded previously but after 10 minutes now i have only 25 mb left . Please help May 24, 2020 at 2:29
  • 1
    You can change in Magento backend => mageplaza SMTP configuration. To limit logs or disable them.
    – BartZalas
    May 25, 2020 at 5:03

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.