+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / SF_CHUNKS table size

SF_CHUNKS table size

5 posts, 0 answered
  1. Jared
    Jared avatar
    122 posts
    Registered:
    04 Apr 2013
    14 Oct 2013
    Link to this post
    Is there a recommended way to minimize the size of the sf_chunks table?  It is currently around 2 GB, which is half the size of our entire DB.  Any thoughts or suggestions would be appreciated!
  2. Craig
    Craig avatar
    82 posts
    Registered:
    07 Apr 2009
    14 Oct 2013 in reply to Jared
    Link to this post
    Jared,
    I am 99% sure this is where were all BLOBs (Binary Large Objects) are stored in Sitefinity.  Anything you store under Images, Video, or Documents will be stored in the database by default.

    One way of reducing the size of this file could be to store these files on the file system.  Any top level library will allow you to change the storage location by going to Actions > Move to another storage.  Select File System and the files will be moved from inside the database to you file system under /App_Data/Storage/FileSystem.  This is the default location but this can be changed.

    Hope this helps.

    Craig
  3. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    05 Dec 2016
    16 Oct 2013
    Link to this post
    Hi,

    The table sf_chunks contains the binary data for the uploaded documents on the site, each document,  binary data is split into chunks with a certain size stored in this table, the table gets updated when a document is deleted so I suppose the media contents on the site is matching the size of the table and check if this is true execute the query below to check the sizes of all uploaded media content (the size is in bytes).
    LibrariesManager manager = LibrariesManager.GetManager();
           var docs = manager.GetDocuments();
           long allDocumentsSize = 1L;
           foreach (var item in docs)
           {
               //the size is in bytes
               allDocumentsSize += item.TotalSize;
           }
     
           Response.Write(allDocumentsSize.ToString());

    As Craig mentions the default location for storing binary data is database and can be changed to file system or external storage provider like dropbox (sample provider for dropbox is available in sitefinity SDK, DropboxLibraries provider), azure storage provider or amazon S3 storage.

    Regards,
    Stanislav Velikov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. jason
    jason avatar
    3 posts
    Registered:
    04 May 2009
    08 Oct 2014 in reply to Stanislav Velikov
    Link to this post

    External Storage option does not work properly. Choosing Azure Storage if you put images in a root level library, and then put images in a sub-library with the same names, Sitefinity puts them both in a folder with the name of the root level library. So you cannot have images with the same name in sublibraries. 

    http://feedback.telerik.com/Project/153/Feedback/Details/124015-uploading-images-with-the-same-name-in-azure-storage-causes-issues

     

    Local file system is not an option for a clustered environment. 

    Database storage is expensive, and I'm experiencing large load on queries to sf_chunks table. Some responses are taking up to 30 seconds. Sure would be nice to use Azure Storage and CDN instead.

     

  5. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    21 Nov 2016
    09 Oct 2014
    Link to this post
    Hello,

    I have marked this bug as important for clients and I hope that we will be able to address it soon:

    http://feedback.telerik.com/Project/153/Feedback/Details/124015-uploading-images-with-the-same-name-in-azure-storage-causes-issues


    You could follow the item in order to receive notifications when the status of the items is changed.

    Excuse us for the inconvenience.

    Regards,
    Stefani Tacheva
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
5 posts, 0 answered