1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Large internal_data/temp folder

Discussion in 'Media Gallery Support' started by Fred., Jan 17, 2015.

  1. Fred.

    Fred. Well-Known Member

    I just noticed the internal_data/temp folder is 350+ MB

    I changed the extension of one of the files to jpg and it seems like those files come from media gallery.
    The directory is taking up more disk space every day.
    And it seems like they never get deleted. (Folder is chmod 777)

    I'm also using BD attachment store.

    This doesn't look normal.
    Does someone have an idea how I can fix this?

    Thanks!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The internal_data directory is where all attachments are stored.

    The thumbnails are stored in the data directory.

    If members are uploading attachments, images, resources, etc. then the size of both directories will increase.

    I can't comment on how the attachment store add-on works, you would need to post in the resource thread.
     
  3. Fred.

    Fred. Well-Known Member

    I know Brogan. :)
    They have separate folders.
    But only my temp dir is 350+ MB

    I'm wondering why those images are stored in the temp directory. And what is causing this.
     
  4. Fred.

    Fred. Well-Known Member

    @xfrocks Is there anything in BD attachment store or BD cache that stores data in the "internal_data/temp" folder?
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    How big is the contents of your internal_data/temp directory in comparison to the internal_data/attachments directory (or wherever Attachment Store puts the uploaded files)?

    I would expect the temp directory to contain a fraction of what you're actually storing. Also, how many of the files in the temp dir are prefixed with xf, how many are prefixed with xmg?

    Gallery temp files are prefixed with xmg. XF temp files are prefixed with XF.

    The use of the temp dir is typically expected and it is used in pretty much every file upload process. After a successful upload, the temp file involved in that upload should be removed. If there is an error of some sort, there's a possibility that it might not get cleaned up as expected. Over time, the temp dir can fill up, but the files can be removed safely, in theory.
     
  6. Fred.

    Fred. Well-Known Member

    internal_data = 526.6 MB (526.594.073 bytes)
    internal_data/temp = 354.2 MB (354.211.642 bytes)
    internal_data/attachments = 140.1 MB (140.116.103 bytes)

    All files have the xf prefix.

    So it looks like after an upload files are not deleted.
    I'm just going to delete those files and I'm moving to a new sever with Nginx next month so this problem will probably disappear then.
     
  7. Xon

    Xon Well-Known Member

    You can get cruff isolated into /temp if a php worker crashes or derps between writing the temp file but before it is renamed away to the right spot.
     
  8. Fred.

    Fred. Well-Known Member

    This problem still exist after moving to a new server with Nginx.
     
  9. Alluidh

    Alluidh Well-Known Member

    Got something like this too

    internal_data/attachments = 350 MB
    internal_data/image_cache = 99 MB
    internal_data/page_cache = 0 kB
    internal_data/sitemaps = 331 kB
    internal_data/temp = 4,3 GB
    internal_data/templates = 0 kB

    Is there a way to clean internal_data/temp?
    Is it possible and save to delete the files by hand?

    Thanks for support
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    It is safe to delete the contents of the temp directory.
     
  11. Alluidh

    Alluidh Well-Known Member

    Thank you Chris
     
  12. Mouth

    Mouth Well-Known Member

    Can/Should we set a cron to empty this directory every day/week/month?
     
    Last edited: Oct 30, 2016
  13. Mike

    Mike XenForo Developer Staff Member

    You can if you wish/feel the need. Chances are it'll be fine, but technically, you would only want to delete files with an mtime older than something like 24 hours. This would ensure that you don't delete a file that may currently be in use (race condition).
     

Share This Page