Here you can find some information on how to resolve this error with the aborted connections. Using connection pools should definitely help as well. I understand that this issue seems to only show up after the aborted connections error gets triggered. However, generally speaking, if you want to achieve higher performance on inserts, you can try disabling the autocommit flag. Please note that autocommit is enabled by default to prevent users from accidentally forgetting to commit a transaction. You could also try enabling the performance schema flag although I’m not sure it’ll make much difference for 1k batches of insert.