Huge size images folder issue

Hello,

Images folder is really huge taking a lot of space on my server 76G, is this normal for only 1500 products ?

[root@cpanel]# du -hsx – * | sort -rh | head -10
76G images
18G upgrades

It seems like I need a way to store images to another server like Amazon S3.and not on my server, is there anyway to achieve that ? I don’t need any CDN service which will still keep the images files on my server but to totally move all images to Amazon S3 or similar.and all new future product images (or thoser imported via feed) to be uploaded there and not to my server.

1 Like

Hi there!

I’d recommend that you go down one level into the images directory to check how exactly space is allocated within that parent directory. If most of the storage space is taken up by the thumbnails folder, you can attempt to clear it. However, please note that regenerating a large number of thumbnails can cause a significant load on your server, potentially impacting your customers’ experience of using your store.

At present, there is no pre-existing integration for S3 in CS-Cart. However, I am making efforts to convey the need for integration to our developers :slight_smile:

1 Like

Here is it the result, it seems like detailed folder and thumbnails is taking most of the space. Can I deleted detailed folder ? It will be regenerated ?

63G detailed
11G thumbnails
2.7G watermarked

1 Like

No. The detailed image folder will not regenerate. Those are the main images used to regenerate all others.

If you think you have a lot of miscellaneous images, export your detailed images (will create a backup of images at /var/files/companyid/exim/backup/images/) then delete the detailed and thumbnail folders then reimport the images from the export.

1 Like

My server size is only 100G and 95G are taken by images and upgrades folders, if by exporting it creates backup at at /var/files/companyid/exim/backup/images it will not be enough space.

I just tried to export it using export images features, it generated one csv file. Then I changed the folders name from detailed to detailed2 and thumbnails to thumbnails2, then I created new folders detailed and thumbnails , then I tried to import the images but fail its stuck with importing screen doing nothing.

1 Like

Do you think you have miscellaneous images or are your images just too big?

1 Like

I don’t know what’s going on or if I have have miscellaneous images (how to check it?), few days ago I noticed that my server space is full so I checked the server and noticed that the images folder is very big.

1 Like

It is better to be cautious when deleting all images from this folder, as this folder may also contain images added by your customers using the Product Reviews add-on.

I wasn’t even aware of the Product Reviews add-on. :stuck_out_tongue_winking_eye:

1 Like

I even checked the code to be sure :wink:

What should be the recommended server disk size for multi-vendor version ?

There is no answer to that because there is a lot that it depends on.

If you only have 1500 products and only a few images for each product, I would assume that you are using high resolution images. If so, you need to optimize your images so they do not take up so much space.

They are taken via feed import, is there any way to solve it in that case? Each product have around 10-15 photos… I would go for dedicated server but I rather have cloud instance due to daily backup option, with dedicated I need double the monthly payment and pay extra to backup database to a different location.

I don’t understand how backup images works, I just tried to export it using export images features, I selected thumbnail and detailed images, it generated one csv file and server backup folder /var/files/companyid/exim/backup/ has only 501M, how is that possible because website images folder its way bigge,r 63G detailed and 11G thumbnails. I changed the images folder name in order not to lose original files and tried to restore it and admin are its frozen. Please tell me how can be such image size difference.

You would probably have to take a look at the contents of those folders, otherwise you won’t get any answers since no one knows what else your server has in those folders besides images.

if your ijages are not optimised this could be the problem.try something like this or downliad and optimise your self then reupload using exact same names

After deleting thumbnails and detailed folder I still got many empty images on each product. Than after import the images backup file I have many duplicate images on each product. Please advice on how to fix it.

You can add the following code to the index.php file:

$_image_data = db_get_array("SELECT * FROM ?:images_links WHERE object_type = 'product'");
foreach ($_image_data as $d) {
    fn_delete_image($d['image_id'], $d['pair_id']);
}

after this line:

require(dirname(__FILE__) . '/init.php');

Save the file and go to the home page. And do not forget to delete the code then

It seems to have no effect after, I added the code and opened home page, I even cleaned the cache folder.

In this case try to log in the phpMyAdmin, find the cscart_images_links table, make search by object_type=product and delete all found items