Answers.Body: <p>Personally, I'd <a href="https://craftcms.stackexchange.com/a/4729/57">lean towards</a> keeping the shared NFS volume.  It's not just the runtime folder, but things like backups, site logos, user avatars, etc. and anything else plugins might be storing in storage that you'd want to consider as well.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-26T19:31:17.627Z
Answers.LastActivityDate: 2017-01-26T19:31:17.627Z
Answers.LastEditDate: 2017-04-13T12:51:00.160Z
Answers.UserDisplayName: Brad Bell
Body: <p>We have a multi-server Craft setup, for redundancy and scaling.</p>
  
  <p>We've been using an shared NFS drive to to host Craft's storage directory, by setting <code>CRAFT_STORAGE_PATH</code> to a mounted <code>/craft-data/</code> directory on each machine.</p>
  
  <p>in <code>public/index.php</code>:</p>
  
  <pre><code>define('CRAFT_STORAGE_PATH', '/craft-data/');
  </code></pre>
  
  <p>One reason it was important to do this was to let Craft share sessions across machines, because they were stored on the filesystem.</p>
  
  <p>Recently, we transitioned from saving our sessions in the filesystem to saving them in redis.</p>
  
  <p>If we can, I'd like to abandon the NFS drive altogether and let each machine have its own <code>/craft-data/</code> directory, since we no longer need to maintain this shared filesystem for session sharing.</p>
  
  <p>Looking at the contents of the craft <code>/runtime/</code> directory, we see several subdirectories that seem like they could contain important shared state, such as <code>cache</code> and <code>state</code>:</p>
  
  <p><code>
  $ pwd &amp;&amp; ls -l
  /craft-data/runtime
  total 16
  drwxrwxr-x   5 craft_user users   45 Jan 19 16:12 assets
  drwxrwxr-x   2 craft_user users   49 Jan 26 09:34 cache
  drwxrwxr-x 100 craft_user users 4096 Jan 26 09:37 compiled_templates
  drwxr-xr-x   2 craft_user users   65 Jan 25 12:12 CSS
  drwxr-xr-x   2 craft_user users   65 Jan 25 12:00 HTML
  drwxrwxr-x   2 craft_user users 4096 Jan 19 16:12 logs
  drwxrwxr-x   2 craft_user users 4096 Jan 26 08:52 sessions
  drwxrwxr-x   2 craft_user users   22 Nov 16 14:55 state
  drwxrwxr-x   2 craft_user users 4096 Jan 25 15:17 temp
  drwxr-xr-x   2 craft_user users   65 Dec 14 11:27 URI
  </code></p>
  
  <p>Do any of these directories need to be shared, in a multi-server setup? Is it safe for us to stop using a networked filesystem, for the <code>CRAFT_STORAGE_PATH</code>?</p>
  
Tags: <config><server>
Title: Do servers in a multi-server Craft setup need to share a storage directory?
ThreadText: # Do servers in a multi-server Craft setup need to share a storage directory?
  
  (Asked by: username_0 on 2017-01-26)
  
  We have a multi-server Craft setup, for redundancy and scaling.
  
  We've been using an shared NFS drive to to host Craft's storage directory, by setting `CRAFT_STORAGE_PATH` to a mounted `/craft-data/` directory on each machine.
  
  in `public/index.php`:
  
  ```
  define('CRAFT_STORAGE_PATH', '/craft-data/');
  
  ```
  
  One reason it was important to do this was to let Craft share sessions across machines, because they were stored on the filesystem.
  
  Recently, we transitioned from saving our sessions in the filesystem to saving them in redis.
  
  If we can, I'd like to abandon the NFS drive altogether and let each machine have its own `/craft-data/` directory, since we no longer need to maintain this shared filesystem for session sharing.
  
  Looking at the contents of the craft `/runtime/` directory, we see several subdirectories that seem like they could contain important shared state, such as `cache` and `state`:
  
  `$ pwd && ls -l
  /craft-data/runtime
  total 16
  drwxrwxr-x 5 craft_user users 45 Jan 19 16:12 assets
  drwxrwxr-x 2 craft_user users 49 Jan 26 09:34 cache
  drwxrwxr-x 100 craft_user users 4096 Jan 26 09:37 compiled_templates
  drwxr-xr-x 2 craft_user users 65 Jan 25 12:12 CSS
  drwxr-xr-x 2 craft_user users 65 Jan 25 12:00 HTML
  drwxrwxr-x 2 craft_user users 4096 Jan 19 16:12 logs
  drwxrwxr-x 2 craft_user users 4096 Jan 26 08:52 sessions
  drwxrwxr-x 2 craft_user users 22 Nov 16 14:55 state
  drwxrwxr-x 2 craft_user users 4096 Jan 25 15:17 temp
  drwxr-xr-x 2 craft_user users 65 Dec 14 11:27 URI`
  
  Do any of these directories need to be shared, in a multi-server setup? Is it safe for us to stop using a networked filesystem, for the `CRAFT_STORAGE_PATH`?
  
  **Tags:** config, server
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-01-26. Score: 3 | Accepted answer
  
  Personally, I'd [lean towards](https://craftcms.stackexchange.com/a/4729/57) keeping the shared NFS volume. It's not just the runtime folder, but things like backups, site logos, user avatars, etc. and anything else plugins might be storing in storage that you'd want to consider as well.
  
  
  ---
  
  