How do I setup Drupal with EC2 scaling? I want to scale my Drupal site and I was wondering how to approach it with Drupal and Amazon EC2. This is a bit related to How to use Drupal in the cloud with on demand instances.

With Amazon, I can monitor my server and if certain metrics are hit then it can launch a new instance that is load-balanced. My questions are then:


Does Drupal create specific files as users do stuff? Is everything on the database? (I have a separate database server that all my nodes point to.)
Are sessions local or is it on the database as well? I'm thinking of situations where user connects to server A and then gets moved to server B. Would the user lose anything?


If it helps, I'm using Drupal 6.
Drupal core code creates files only when a user uploads a file. With third-party modules, files could be created in other cases. For example, if you are using Apache Solr Search Integration some files could be created; if you are using a module that implements an alternative caching system, some files could be created as well.
sess_write() saves the session ID in the "{sessions}" table, together the value of $user-&gt;cache, the IP address used by the user to connect, and the current timestamp.




db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user-&gt;uid, isset($user-&gt;cache) ? $user-&gt;cache : '', ip_address(), $value, time(), $key);
if (db_affected_rows()) {
  // Last access time is updated no more frequently than once every 180 seconds.
  // This reduces contention in the users table.
  if ($user-&gt;uid &amp;&amp; time() - $user-&gt;access &gt; variable_get('session_write_interval', 180)) {
    db_query("UPDATE {users} SET access = %d WHERE uid = %d", time(), $user-&gt;uid);
  }
}