i built an highly available and fault tolerant Wordpress site on AWS Cloud,
i using ubuntu 20.04 and apache2.4,
/var/www/html is mounted on EFS filesystem configured whit provisioned troughtput at 15mbps (108$ month),
i have an autoscaling group (accessible trought ALB) launching my ami on t3.medium istances,
the scaling working pretty fine but the site is slow even after caching on the broswer,
i know that the problem is the EFS couse if i use the ebs the site speed is ok,
i tryed to configure all the site on cloudfront following this configuration here but it seems to make things wrost,
anyway the .php files need to be executed on the local filesystem,
im using opcache at 900 revalidate freq 512 memory and 20000 max for the files,
anyway if use ebs the site is work a lot better,
that is a possible solution but i dont know if could work i need some help:
the customer load/change php files (rarely) like wp-settings trought sftp on a master istance,
this master istance is not in the autoscaling group,
so for the master istance i want mount 2 efs volumes,
Master EC2:
EFS1 mounted /var/www/html
EFS2 mounted /var/www/html/wp-content
Istances in the autoscaling groups:
EFS2 mounted/var/www/html/wp-content
EFS1 mounted /mount/efs1
then i need to synch the folder "/mount/efs1" whit the folder"/var/www/html/" excluding subfolder "wp-content" every minute and set a delay of 70-80 for the scaling of a new istance in the autoscaling,
i dont know how to synch in the right manner the two folders and if i have to synch it two ways or if i have to set a master and a slave,
im wondering if use lsyncd, rsync or unison,
any help or alternative solution will be appreciated
thanks in advance