Local filesystem on load balanced servers

Posted 11 months ago by alexleonard

I have load balancing set up to split a Laravel site between multiple servers and have been running into issues using local file storage.

For compliance reasons we can't use a remote Flysystem adapter (eg AWS), and I haven't worked out the best way to handle user uploads (eg image uploaded to Server A, but not available Server B). At the moment we just have a scheduled rsync to keep Server A and B public disks in sync, but it's not instant.

I believe we could set up some form of folder watching to trigger sync between the servers but I was wondering is there an easy way to set up the local flysystem adapter/public disk to actually store files on a single server shared between load balanced web server? Thus Server Z would be just Laravel 'local' storage, and Server A and B would read/write to Server Z?

DevOps is not entirely my forte... ;)

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.