bji wrote:
Can you give some more details on your method of remote disk storage? What vendor have you found cheap and reliable for this purpose? Have you tried SSHFS (which seems easier to set up than NFS), and can you compare it to NFS for this purpose?
Guspaz wrote:
sshfs is like s3fs in that it's a kind of hacky kludge that works OK for casual stuff, but not for serious stuff. It's *really* easy to use and set up, but it completely falls apart under any load, so it should be used for convenience, not as a replacement for SMB of NFS.
In my experience, sshfs has been much more reliable than s3fs. The code base is rock solid, and the performance is way better than s3fs. This probably has to do with the fact that SFTP, the underlying protocol for sshfs, was designed for filesystem-like access patterns. If I remember correctly, with SFTP/sshfs you don't have to transfer the whole file to access a few bytes or the metadata. S3 on the other hand is based on a RESTful protocol, which sucks for a filesystem.
However, as @Guspaz said, sshfs is nowhere near as robust as NFS or CIFS (Samba). Read-only access is generally OK as long as the latency is low, but try writing to the same file at the same time and the contention will get ridiculous. For example, it's possible to run a read-write SQLite database over NFS, but you don't want to do it on an sshfs volume.
It's probably OK if all you're doing is fetching old photos and sending them over the web once in a while. I'd run forum archives on an sshfs volume for months without a problem. Generating a few thumbnails might also be OK, depending on the latency and bandwidth between the hosts. But anything more and you should be looking at NFS or a local filesystem.
I don't know how Gallery organizes uploaded files, but if it's anything like /year/month/filename, it'll be very easy to transfer old photos to a remote server and keep newer photos locally, without changing any PHP code. Just mount the remote volume somewhere outside of the docroot, move old directories to the remote volume, and replace their original locations with symlinks. Do this every now and then as your local filesystem gets filled up. Gallery won't know anything is amiss. (In case it's pesky enough to complain about a symlink, just do a "mount --bind" instead.)
The primary benefit of SSHFS, of course, is that it works everywhere. Even the cheapest backup service or large-disk VPS host supports SSH. I know several reliable hosts, but since some of them are Linode's competitors, I won't post their names here. I'll PM you.