Kirby and AWS Beanstalk, How to deal with multiple instances?


I want to set up our website in an environment of high availability with AWS Beanstalk, load balancer, and multiples instances or servers.

Everything is fine except when I need to sync the Kirby’s /content folder in all the running instances, so, If I upload an image using the Panel on the server 1, it also should be available in the server 2.

AWS offers a service called Elastic File System (EFS) which can mount the content folder on any running instance, I tested with EFS, but after that, the speed of the site decreased a lot, in fact, too much. logically it is not the same that the local read for the files. So I thought that I needed a similar solution but with a cache. So I tested s3fs, but this was worst than EFS. I’m very frustrated.

The site has many related pages, so, I suppose that Kirby needs to read a lot of .txt files to get the information so this could impact the read performance.

Has anyone dealt with something similar?

Any help? :frowning:

I have never used any of this stuff but maybe you can use rsync to propogate the content to the other instances? I imagine that would be a less intensive process, since rysnc deals with only what is new or has changed rather then entire fileset (this is true after the first transfer, after that it will be much faster). You could tie this into a panel hook that triggers on page creation or update. Another possibility is githooks.

Kirby autogit plugin maybe of use because you can sync the instances up with a repo.

Im just putting these things out there as ive not used the platform you are running on, sorry if those ideas are a red herring.

Also, try searching the forums, im sure ive seen a few threads around AWS.

Maybe post on stackoverflow, as this sounds like its an environment issue rather than a Kirby issue. how do other people keep sites current on this platform? Remember Kirby is just files, so solutions for other systems maybe applicable.

Hey @jimbobrjames,

I’m thinking the same as you, I’m going to try a solution using rsync. I’m come back here with the results of this possible solution.

Many thanks for your reply