Issue solved by adding
innodb_flush_log_at_trx_commit = 0
in the /etc/my.cnf
There is an interlocking problem when multiple threads want to write the file at the same time, this way the log will be flushed every second.