Offload S3 and ProSites storage limit

We installed Offload S3 plugin that uploads media to AWS S3 bucket.
Plugin is set to delete media from server after upload to S3.
We have storage quota set for levels.

Since media is not on the server will quota still work?
How does quota calculate storage data for sub sites?

Thanks.

  • Adam Czajczyk

    Hello Jason,

    I hope you're well today and thank you for your question!

    The plugin itself doesn't measure/calculate upload/storage quotas. The way it works is that it hooks up to core WP functions and "dynamically adjusts" WP behavior according to limits set in plugin's database.

    WordPress itself then calculates the size of upload directory with a basic PHP "get_dirsize()" function. Therefore if those files are removed from the upload folder I think the quota should not be applied.

    I'm not 100% sure though how WordPress treats such off-loaded files. I mean, it's mostly related to how the plugin handles files uploaded to the site. If it properly interact with WordPress then it should be reflected in Pro Sites and offloaded files shouldn't take up limits.

    If you have additional questions, let me know please.

    Best regards,
    Adam

  • Jason Bishop

    Thanks for the quick reply.

    The plugin itself has option to keep files on server or delete them after upload, we have it set to delete files.

    So ProSites calculates just uploads directory of the site?
    like wp-content/uploads/sites/siteID

    Also previously we used W3TC to move WP directories (wp-includes, etc.) to AWS S3 or CDN.
    would that be compatible with MU install?

    Do you have recommendations, instructions or resources for best way to "offload" MU install, maybe MaxCDN or similar.

    What do you guys use on EduBlogs?

    Thank you so much.

  • Adam Czajczyk

    Hello Jason!

    So ProSites calculates just uploads directory of the site?
    like wp-content/uploads/sites/siteID

    That'd be pretty much how it works The plugin calls "get_space_used()" WP native function to read the space usage:

    https://developer.wordpress.org/reference/functions/get_space_used/

    That function basically uses (it's a part of WP core)

    $upload_dir = wp_upload_dir();
    $space_used = get_dirsize( $upload_dir['basedir'] )

    PHP code to just read the directory size of a specified upload dir, like "wp-content/uploads/sites/siteID"

    Also previously we used W3TC to move WP directories (wp-includes, etc.) to AWS S3 or CDN.
    would that be compatible with MU install?

    I must admit I never used it that way on Multisite and actually I don't even think it's a good idea after all and necessary. If it's beneficial to offload/move away any folders it would be the /wp-content/uploads folder. Other folder do not occupy that much space and even offloading them won't in my opinion affect server load. At least not significantly.

    Do you have recommendations, instructions or resources for best way to "offload" MU install, maybe MaxCDN or similar.

    In my personal opinion, offloading "install" is not a way to go. Two aspects that could and probably would be worth "offloading" would be aforementioned uploads folder. That can be achieved e.g. with the plugin that you are already using.

    If you got a huge and complex database, that could be "offloaded" to. That doesn't actually require any special tool, the only thing that I'd do in that case would be to start some cloud based database instance, copy the database there and simply update wp-config.php file with credentials to access this new DB. This way WP could easily work with e.g. Amazon hosted databases while the core of WP would still work on its own separate server.

    Yet, I would still say that that probably the simplest while "beneficial" way would be to just move entire install to some nice cloud-based environment.

    What do you guys use on EduBlogs?

    We're using powerful cloud architecture plus CDN in front and as far as I know also some custom solution. I'm not however familiar enough with that infrastructure to be able to tell you more about it.

    Best regards,
    Adam