I'm trying to insert a few thousand records in a simple table structure into a postgres table. In my c# unit test I create a fresh database from the latest docker alpine image, and then using NPGSQL create a table try and insert a few thousand record.
After about 11k records the container seems to hang, and eventually the test times out. The container logs show nothing after it stops inserting records.
At first I thought it was NPGSQL, however the same test on a normal (non docker) database works fine, so it must be related to the docker image? I've tried several different settings for docker memory/cpu's and also shared_buffers and max_connections for example for the postgres db. The test hangs on the same number of inserts regardless.
I realise bulk inserts are better done with the COPY command, but for this test multiple inserts are relevant.
NpgSql 5.0.7 PostgreSQL 13.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit