Skip to main content
Topic: Attachments folder growing up fast (Read 3621 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Attachments folder growing up fast

Hi everybody,

I am having a strange problem with my attachments. One/two weeks ago my attachments were about 1GB, I installed the smush.it addon and I was able to reduce the size for about 10%. I noticed that in the next days my attachment size grow up fast, I set 2GB as limit ant that limit was reached after a couple of days. Now I have 3GB of total attachments. I set this limit to 4 GB otherwise I get the email notification that my attachments folder is full.

I don't know if this is related to smush.it addon, I also use AIR addon (attachments Image Resizing) and ILA attachments. I take a look  inside folders ( I use one folder per month) and I see a lot of small files. This month after 2 days and only a few attachments I have 492 files, 90MB. This is surely something strange.

Last days I disabled the PNG thumbnail creation (I had this set up for a few days) and I also deleted manually the thumbnails from elkarte attachments. I noticed that they get created even if this is disabled.

I really don't know how to solve this? Any idea?

Last Edit: February 02, 2016, 05:04:46 pm by radu81
sorry for my bad english

Re: Attachments folder growing up fast

Reply #1

I fell asleep thinking about this, that means I have to go sleep. xD
Bugs creator.
Features destroyer.
Template killer.

Re: Attachments folder growing up fast

Reply #2

I download a copy of my ftp files and attachments are about 1.7 GB. Setting the attachments folder to 4 GB did not helped, the error I receive (attachments folder full) is because I set 2000 images per folder. Anyway this month I have about 20 attachments (about 5MB totaly) but in the folder of this month there are 1600 files, more than 90MB
sorry for my bad english

Re: Attachments folder growing up fast

Reply #3

The size shown in the admin panel refers to the one in the database, so most likely the addons are re-encoding the file changing the size, but not "fixing" the data before (or after) it is saved into the database (wild guess!!!). That may explain the 1.7 VS 4 GB.

About the 90 files... would you mind checking in phpmyadmin how many attachments are stored there?
Unfortunately I don't have a ready-to-use query, what I would do is find the fist message of the month and then do a:
Code: [Select]
SELECT * FROM {db_prefix}attachments WHERE id_msg > {id_first_message_of_the_month}
Bugs creator.
Features destroyer.
Template killer.

Re: Attachments folder growing up fast

Reply #4

From phpmyadmin it seems to look correctly, but on FTP in /attachments/2016/02 I got 1900 files and a total of 9MB

I attach the export I did from phpmyadmin

Re: Attachments folder growing up fast

Reply #5

Did you do any repair attachments? (Do not do it, just tell me if you run the task.)
Bugs creator.
Features destroyer.
Template killer.

Re: Attachments folder growing up fast

Reply #6

I  did it several times in the last days
sorry for my bad english

Re: Attachments folder growing up fast

Reply #7

In the attachments table there are a lot of... let's say unneeded entries (I mean those with the full path, they look like stuff introduced by the repair or something similar).

Do you have shell access on your server?
I'd like to replicate the environment, but without having to ask you for access (and download everything).
If you have ssh access, could you run the following command:
Code: [Select]
find /path/to/forum/ > file_names.txt
and download the file_names.txt file and send it to my email address? (emanuele45 gmail.com)
I'd need also the results of the query:
Code: [Select]
select id_msg, id_topic, id_board, 'none' as subject, 'empty' as body, poster_time FROM {db_prefix}messages
and the backup of the tables topics and boards.
Attachments is already up there, this should be the minimum amount of stuff needed to test the issue I think.

Is it too much of a trouble?
Bugs creator.
Features destroyer.
Template killer.

Re: Attachments folder growing up fast

Reply #8

I have ssh ;) I sent all you asked, thanks for your help
sorry for my bad english

Re: Attachments folder growing up fast

Reply #9

Thanks, received!
I'll have a look at them as soon as possible, likely tomorrow evening... sorry. :(
Bugs creator.
Features destroyer.
Template killer.

Re: Attachments folder growing up fast

Reply #10

First thing I think I found is Smush.it apparently doesn't delete the ".tmp" file that it creates.
I think after:
Code: [Select]
					save_smushit_file($tempfile, $filename_withpath, $file, $response);
there should be a:
Code: [Select]
@unlink($tempfile);

What do you think @Spuds ?
Bugs creator.
Features destroyer.
Template killer.

Re: Attachments folder growing up fast

Reply #11

 :-[  Yup for sure I boned that one up ... I updated the repo and addon site with the update.  Thanks for the debug !


Re: Attachments folder growing up fast

Reply #13

Here is what I did:
- uninstalled Smush.it addon 0.2
- installed Smush.it 0.3
- deleted .tmp files manually (about 650MB totaly)

The problem is that in the month of february attachments\2016\02 I still got about 2000 . elk files and in february I have about 20 attachments. What should I do next?
sorry for my bad english

Re: Attachments folder growing up fast

Reply #14

mhh, maybe that's thumbnails generated for older files inside the current directory?
Thorsten "TE" Eurich
------------------------