title: Trouble configuring Presto's memory allocation on AWS EMR
body: <p>I am really hoping to use Presto in an ETL pipeline on AWS EMR, but I am having trouble configuring it to fully utilize the cluster's resources.  This cluster would exist solely for this one query, and nothing more, then die.  Thus, I would like to claim the maximum available memory for each node and the one query by increasing <code>query.max-memory-per-node</code> and <code>query.max-memory</code>.  I can do this when I'm configuring the cluster by adding these settings in the "Edit software settings" box of the cluster creation view in the AWS console.  But the Presto server doesn't start, reporting in the server.log file an IllegalArgumentException, saying that max-memory-per-node exceeds the useable heap space (which, by default, is far too small for my instance type and use case).  </p>
  
  <p>I have tried to use the session setting <code>set session resource_overcommit=true</code>, but that only seems to override query.max-memory, not query.max-memory-per-node, because in the Presto UI, I see that very little of the available memory on each node is being used for the query. </p>
  
  <p>Through Google, I've been led to believe that I need to also increase the JVM heap size by changing the -Xmx and -Xms properties in /etc/presto/conf/jvm.config, but it says here (<a href="http://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-presto.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-presto.html</a>) that it is not possible to alter the JVM settings in the cluster creation phase. </p>
  
  <p>To change these properties after the EMR cluster is active and the Presto server has been started, do I really have to manually ssh into each node and alter jvm.config and config.properties, and restart the Presto server?  While I realize it'd be possible to manually install Presto with a custom configuration on an EMR cluster through a bootstrap script or something, this would really be a deal-breaker.    </p>
  
  <p>Is there something I'm missing here?  Is there not an easier way to make Presto allocate all of a cluster to one query?  </p>