I have had to just do a double take as I've realised our website is taking up near 46GB.. how can I find out what is taking up most of the space?

It is hosted on ‪Ubuntu 12.04.5 LTS‬

  • First please check the var/cache, var/session and also the media images. Remove backup and unused files. Also truncate the log tables. Commented Apr 27, 2018 at 11:33
  • ncdu should help you track it down. or if you can mount it on a computer wtih a GUI, QDirStat should make it even easier to see where your disk space is being used.
    – hanshenrik
    Commented Apr 27, 2018 at 15:30

2 Answers 2


On your server, make this shell command du -hs your/path/* to see wich directory is heavy.

Then remove unused files (cache, log, session, report, media, ...). If you need keep some backups, you can compress them to save space.

Also check your database and clean some tables if necessary.

  • Thank you, I'm not that proficient in database things so I wouldn't know how to clean tables.
    – cz84
    Commented Apr 27, 2018 at 11:49
  • 1
    I think it's easier to start to clean (or compress) unused files than start to clean database. What is the weigh of your src/var/* ? In your database, you can check the tables related to order, invoice, creditmemo, media, ... It depends of your database and where your have too much data not useful.
    – Kozame
    Commented Apr 27, 2018 at 11:59
  • I'm currently running this command but find var/session/ -mtime +7 -exec rm {} \; to clean the session folder (I know the folder is big from a previous backup of our website) but it is taking a while. If this finishes before I leave work I will check the size of the entire var folder.
    – cz84
    Commented Apr 27, 2018 at 14:09
  • 1
    When you launch my command, wich folder is heavier ? (you already remove 15Go, good! :D)
    – Kozame
    Commented Apr 30, 2018 at 9:43
  • 1
    Go on the folder where you have your code (folder with app, dev, includes, media, ...) ofter named 'src/' and make du -hs *, then du -hs var/*. You will have the details of the weigh of all your folders.
    – Kozame
    Commented Apr 30, 2018 at 9:58

There might be several reason

  1. please check media folder size
  2. Please remove unnecessary files from var directory
  3. Please remove unnecessary backup files
  4. Please check the database size

You can run this query to check the database size

SELECT table_schema AS "Database Name", 
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size in (MB)" 
FROM information_schema.TABLES 
GROUP BY table_schema

You can truncate log tables

TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;
  • Thank you, I've just ran the query and it came back as 3.2GB I think this might be a lot as I have another site on Magento with the same amount of products (about 100) and it is 400mb.
    – cz84
    Commented Apr 27, 2018 at 14:14
  • Please check the log tables ,you can clean those tables to make some space Commented Apr 27, 2018 at 14:59

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.