I'm deploying a Magento 2 site to AWS, the site will have a load balancer in front which serves via multiple instances (frontends). I've enabled redis for cache and session storage. The media folder is a shared NFS directory across the instances.
Should I also make the 'var' directory a shared NFS folder? I'm unsure about when and why Magento writes to the var folder during operation and what problems this could cause if a user is moved from one server to another during their time on the site.
One annoyance of not using NFS for the 'var' directory would be trying to check logs and reports of any problems that Magento writes to 'var'.
pub/static/_cache
directory if you have JS file merging turned on (which is important for performance). This directory is populated on the fly from requests (not fromstatic-content:deploy
), and if the page load runs on a different node than the merged JS file is requested from, the JS file load will fail. See github.com/magento/magento2/issues/13225