title: mysql (python) AWS query build-up causes slowdown
body: <p>I am executing the following code 25 times before calling commit (very abbreviated).</p>
  
  <pre><code>def query_and_insert(conn):
      c = conn.cursor()
      result = c.execute("SELECT ...")
      result = modify_result(result)
      c.execute("INSERT ...".format(result))
      result.close()
  
  if __name__ == "__main__":
      conn = MySQLDB.connect(...)
      loop 25 times:
          query_and_insert(conn)
      conn.commit()
      conn.close()
  </code></pre>
  
  <p>After the first 15 or so queries, the speed slows down significantly (goes from &lt; 1 second per query/insert combo to > 20 seconds). The problem definitely isn't the complexity of the queries I'm executing; moving the last 10 queries to the beginning has them running just as fast, and then the last queries again slow down significantly.</p>
  
  <p>Is there some sort of throttling or decreased priority for processes that take too long on AWS? Is there any way around this?</p>
  
  <p>Edit: We are using a MicroInstance on Amazon EC2. There is no issue with building table size because we are doing the inserts on an empty table.</p>