Mysql innoDB write operations are extremely slow
innodb_flush_log_at_trx_commit = 2 for better speed (=1 for better safety)
sync_binlog = 0 if you are not using the binlog.
"Batch" INSERTs &mdash; many rows in a single INSERT statement. (If you have lots, do 100 at a time.)  LOAD DATA is also excellent for loading.
innodb_buffer_pool_size = 70% of available RAM.
auto_commit = 1, or use BEGIN ... COMMIT
thread_stack = 256K I'm surprised it did not crash with your small value.


Still, the times (1s-6s) are grossly unreasonable.  Even with everything set "wrong", 0.1s for a simple INSERT should be expected.

Is this running in a "cloud"?  Is something else going on?