I've moved from Azure to AWS since Azure is so painful

I've moved from Azure to AWS since Azure is so painful to work with, but that is not the point, Since im using AWS and CloudFront to store my media uploads in S3, if my users have 100 MB of space, how does pro sites calculate this? since all media is copied to s3 and removed from the wp-content folder to make room for my ec2 instance. is my only choice to say unlimited space, for all users even free?

  • Rheinard

    Hi @Theodor,

    Pro Sites uses WordPress core's functions for the Upload Quota module. These are get_space_allowed() and get_space_used(). But this is only to set the values for each of your sites and to calculate space used.

    Once these values are set then WordPress takes over. So Pro Sites' Upload Quota is entirely at the mercy of WordPress core to return the correct values.

    If it does not work for you, then please do let us know. We have a few people here that contribute back to core, so its possible we might be able to push the issue if needed.

    Cheers,
    Rheinard

  • Rheinard

    Hi @Theodor,

    I completely understand and fully agree. Just to reiterate, ProSites rely on WordPresses' core storage, so the limitation here depends on how WP handles services like CloudFront.

    To answer your other question, Edublogs relies on multiple databases and solid server architecture. As far as how it manages the multiple databases goes, take a look at our Multi-DB plugin: https://premium.wpmudev.org/project/multi-db/

    As far as the other architecture goes, we might have to get one of our Edublogs sysadmins to answer the rest of your question.

    Cheers,
    Rheinard

  • Theodor

    Thanks, but I believe I got this covered, I found the most useful thing since I discovered the internet, this is by far the most useful article i've read to date, I managed to use s3fs S3 file system to map wp-content in linux as a virtual directory so linux takes my bucket as a normal folder, seems to work, well see how that goes with scalability.

    http://wordpress-tips4all.blogspot.in/2014/07/wordpress-uploads-to-amazon-s3-using-s3fs.html

    However I would love some insight to how that is handled by you guys, and what your thoughts are, Pro Sites seems and is pretty awesome, which means that if you are planing to scale beond a single instance, you need proper architecture, which means, the guys behind edublogs could do best. ( just an idea ) also, if you dont mind, passing on the question, does a virtually mapped folder with s3fs serve well from an architectural perspective?

    • Rheinard

      Great thinking using s3fs. I myself used this a few years ago and its good to see it still kicking around :slight_smile: I'll see if I can get a sysadmin to give you a definitive answer, but from my experience symlinks work rather well and the best thing is if your folder ever moves you can update the symlink. Be careful however not to use the symlinked wp-content folder together with the S3 plugin. Choose one or the other.

      As far as Pro Sites and scalability is concerned. Pro Sites scales with WordPress and relies on WordPress core. Its primarily a plugin that allows you to configure your multisite network within the bounds of WordPress and sell different configurations as sites. So as far as the architecture is concerned, that is the job of the person who manages the WordPress install. Regardless if a sysadmin uses a single instance or multiple instances with CDN, Pro Sites scales with WordPress.

      That said, your suggestion is certainly welcome, however, I think it goes way beyond the scope of this plugin :slight_smile:

  • Rheinard

    Hi again @Theodor,

    You got me really curious about your implementation, so I did a bit of deeper digging in core. As well as the plugins you are using (Amazon Web Services and S3 and CloudFront).

    WordPress' get_space_used() function like you said checks your upload directory. That said, digging around in that function WP has a filter for other plugins - pre_get_space_used. Which storage plugins can use to feed correct information back to WordPress. That's the good news!

    The bad news is that the two plugins you are using for AWS does not hook that filter, so WP will check the upload directory. If the S3 and CloudFront plugin was to determine the file size of your S3 bucket and then hook the pre_get_space_used filter then WordPress and consequently the Pro Sites Upload Module, will work correctly.

    You could post on the support forums for the S3 and CloudFront plugin and ask the developer to hook the WordPress filter or even someone in our 'Jobs and Pros' board could add that function to the S3 and CloudFront plugin for you.

    Hope that helps.

    Cheers,
    Rheinard