Any experience with Amazon CDN?

Does anyone have any experience with using Amazon CDN? I'm working on an idea that will depend heavily on photo sharing. Even though my server has plenty of space at the moment, I know it could fill up fast. I've toyed around with Amazon CDN. Not so much for the regional benefit but for the storage benefit. I know it's not easy to switch from CDN to local server, or vise versa, so making the right choice up front is important.

I've never been a fan of depending on outside servers or services for my websites, but if the advantages are positive enough I'd do it.

Anyway, just curious if anyone has any Amazon CDN wisdom they can share.


  • @Mandi does. Her site is set up with CDN stuffs. They are heavy into photos. See how she set hers up (via Cazaratech).

  • edited April 2017

    I don't use Amazon, but I do use CDN storage servers from CazaraTech/PHPFoxSolutions. We have three storage servers, labeled storage1, storage2, and storage3. Storage3 is now the "main" storage server, and most of the previously uploaded photos are on storage2. All are also run through Cloudflare.

    There are some things to consider.

    They DO fill up fast, and when they are filled up, all photo uploads error out and can REALLY annoy your users. Plan ahead for that. Keep an eye on space and get a new storage server up before you need it. We haven't figure out how to keep an eye on storage space ourselves yet, though. I assume your set-up will be different and could provide that snapshot easily.

    Multi-Server setups are a pain in the behind. They WILL drive you insane. For instance, we busted through three storage servers. So now, people can't select to use a previously uploaded photo as their profile photo, because older photos are on the older storage server, not the new "main" one. It requires them re-adding the same picture that's already on the system, because they need to add it again in order to use it. This clogs up photo uploads with duplicates that are unnecessary.

    Random network outages occur as you add more storage servers to the mix. We frequently have storage server drag and issues. Since it's temporary, by the time people look for the issues, the problem has usually resolved itself, so therefore, can't be easily fixed. This will be incredibly annoying, as users will complain loudly when things are visibly broken. If you run on donations like I do, or subscriptions, this will have monetary consequences, sometimes insurmountable. Storage2 seems to be the aggravating one, as it's the one that's most "full" at the moment, and when it drags, the whole site drags, leading to a loss of donations and users leaving. It's a big deal, so plan adequately for issues.

    You will want a plan in place for limiting uploads eventually, if people abuse the privilege, because they will. Give an inch, and all. We've done several.

    _Limit to 1000 uploads per account.
    -Hide photo only posts from the main feed, they MUST include writing to be shown there.
    -Limit size to 5mb.
    -Give more uploads (1500-2000) to those that donate.

    Now, the biggest issue that I've found, besides the random drags on the storage server network service, is that PHPFox sometimes doesn't work properly. When a user deletes their account or an admin deletes it, you have orphan photos everywhere taking up space that don't get properly deleted. Sometimes deleting times out, and never finishes deleting everything. We've managed to set up a system where once a month we run SQL queries to find and delete any orphan photos from the servers.

    You cannot limit photo uploads and add a spam check at the same time. It causes some kind of hissy fit in the script that makes it so users can only upload one photo at a time anywhere on the site, and locks them down for spam after that first photo, instead of allowing 50 per 30 minutes like we had it set. We had to turn the spam time of 30 minutes off.

    When dealing with a ton of photo uploads and the prospect of eventually having to limit them to protect storage space, these are things to keep in mind.

    Also, I wish I'd had the money to splurge on 2TB servers from the get-go. We are now looking at the idea of combining our storage servers into two 2TB servers, and adding on as we need them. Unfortunately, this will be a time consuming and likely expensive process. If you think you'll need bigger, and can afford it, just get it at the start to stop some heartache once you realize you're just adding way too many servers to the mix, increasing the likelihood of network issues.

    All in all though, I still recommend CDN servers for photo uploads, especially if you plan to focus heavily on them. Diverting site traffic from photo traffic is a smart move, IMHO, because it lets you easily divert resources when needed, and if a storage server goes down, it only affects photos, not the entire site. It's a safety valve, really, especially for an active site.

  • Mandi! Thank you for all that information.

Sign In or Register to comment.