• Resolved Mountain Man

    (@comountainman)


    Hello Plugin Author,

    I need some guidance. We are running our WordPress Website on Google’s App Engine Flexible Env and I need to know how your plugin works. Can you tell me if your plugin allows the entire /wp-content/uploads/ directory to be created in a GCS bucket? Or does your plugin only move image files over to the CGS bucket?

    Google has developed their own GCS Offload Plugin to be used with App Engine Flex but it is not as robust as yours. It’s called ‘gcs-media-plugin’ and the information about it can be found here: https://github.com/GoogleCloudPlatform/wordpress-plugins/tree/master/gcs-media-plugin

    I am just trying to understand how your plugin works. The GCS plugin hijacks the entire /uploads/ folder and enables the files written to this folder to be saved in GCS.

    I am trying to understand if your plugin also does this or not. Many plugins like say, Beaver Builder, WooCommerce, and LearnDash write cache files to the /wp-content/uploads/ directory, which we would need to work on the App Engine Flex Env.

    Any detailed information you can provide on how your plugin handles the /wp-content/uploads folder would be greatly appreciated!

    Thank You!

    • This topic was modified 5 years, 3 months ago by Mountain Man.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey Mountain Man,

    My team and I tried to achieve the same, but in the end, we gave up and moved to a custom Kubernetes network infrastructure instead. Here are a few caveats that in the end put the nails in the coffin for WordPress & App Engine:
    Except for the official plugin from Google all other plugins hook into the media uploading process. Beside of the custom integrations that ship with WP Stateless (e.g. for Elementor), it requires plugins to use the default media uploading process, which fires the required actions and filters (e.g. wp_handle_upload_prefilter). This means that plugins that use a custom way to write to the uploads folder, will not be recognized by WP Stateless and similar plugins.
    They do it for reason. Hooking into every file write process like the Google plugin does on every request, can be very costly. Once you have installed a couple of plugins that rely on the uploads directory, you will notice a hefty performance drop.
    What we initially liked about App Engine is that it appeared to cope well, even with larger WordPress websites. The performance was stunning. But after we had to do some optimization to get a better score in PageSpeed Insights the performance dropped significantly. Page caching made it even worse because before the cached page is output, most caching plugins check if the file exists, this is rather slow, if you use GCS for this.
    Google ships App Engine with its own Memcache integration, which we thought will solve these issues (we even wrote a custom caching plugin to utilize this feature), however, it only works with PHP 5.5 in App Engine.
    As mentioned earlier, we have now built our own Kubernetes infrastructure, which basically simulates App Engine, but keeps the uploads folder writable.
    For page caching, we have our own Redis services inside the network and a (real) CRON function that syncs files from the uploads folder to GCS every minute and also after some actions are triggered.
    This way we can use any plugins without customizing them and those plugins that allow us to use a CDN URL to point to their files (like Fast Velocity Minify => awesome for PageSpeed Insights) work great by using the GCS URL as a CDN URL.

    If you want to go the same route, one more tip: Google Kubernetes Persistant Storage Volume that can be used to store persistent data across multiple pods, does not allow multiple nodes to write to the volume. Hence we moved away from this integration and use the CRON function instead. Now our Kubernetes network spins up new nodes when we see traffic spikes and shuts nodes down when there is only a low amount of traffic. Pretty much everything that App Engine does, the Kubernetes network can do as well.

    I hope this helps you to move forward. I just could not see someone else struggling with this nightmare of a situation ??

    Best,

    Jan

    Thread Starter Mountain Man

    (@comountainman)

    Hi MB-Jan,

    Thanks for the detailed post. I really appreciate the time you took to share your pain points with us. We noticed all of this. Our outcome was that we eventually dumped the Google GCS Plugin and are using WP Stateless. Luckily for us our developer was able to modify some of the plugins that had dependencies on the WP Media Uploads folder. Unfortunately, we do lose some native WordPress Uploads functionality but we really didn’t have much choice because we invested so much money in App Engine DevOps that we just stuck with it.

    My hope is that WP Stateless will become more widely used and thus more developed. It would be great if Google were to figure out a better solution for the native GCS plugin. Because we’d rather use that. But the amount of load time that it added to our website was absolutely abysmal.

    Hi @comountainman would you be willing to share or sell me a copy of your wp stateless plugin that works with Google App Engine ? the google plugin literally makes my site crawl to an unreasonable speed but i’d really like to use app engine …you may be the only hope?

    Thread Starter Mountain Man

    (@comountainman)

    Hi @ds123,

    Unfortunately, a lot of the functions that our developer had to build into the Stateless plugin to enable it to function on GAE was actually done in a separate plugin that we maintain in-house that overrides some of the Stateless functions. Its a fully custom solution that our developer built for our setup. So, it wouldn’t really be possible to share this with you, because it wouldn’t work on your site.

    My advice is to have a developer who is very familiar with PHP go in and build you a custom solution that will enable your theme and other functions within WP to work without uploading to your /uploads/ directory.

    Sorry I couldn’t be more helpful.

    @comountainman really appreciate you taking the time to reply ….. i will look into hiring a developer for this ….. i don’t have a huge budget will it take a pro more than 10-20 hours you think?

    the other question i have if you wouldn’t mind …is it worth it ? i wanted to run on app engine because of the ease of scaling ….pretty cool seems ….is that why you are using it + this plugin + your custom plugin ?

    Plugin Author Eric Sopp

    (@ideric)

    @ds123 feel free to reach out to us. [email protected]

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use on Google App Engine Flex Env’ is closed to new replies.