We experienced memory buildup and service crashes because of exception storms in our dockerized services. I know now this is due to a change in version 10 setting GSS session encryption ssl mode to 'prefer'. We found that in a high traffic environment, we got around 50k exceptions of 'Exception while performing GSS encryption' in the first minute, causing a memory buildup and cpu spikes. This happened in all of our services more or less (APIs and worker services). Disabling it via the connection string makes the problem disappear, however, I wouln't say 'the error is harmless', as stated in the docs.
Now 2 things could be going on here if there are no GSS libraries present in the container:
- the error gets thrown internally repeatedly
- we configured something wrong with npgsql and something gets reinitialized
We've been using npgsql (and with ef core) for years in prod without issues:
services
.AddDbContext<SoiDb>(options =>
{
options.ConfigureWarnings(w => w.Ignore(CoreEventId.RowLimitingOperationWithoutOrderByWarning));
options.UseNpgsql(Configuration.GetConnectionString("db"), o =>
{
o.UseNetTopologySuite().MigrationsAssembly(migrationsAssembly);
o.MigrationsHistoryTable(HistoryRepository.DefaultTableName, "ourdb");
}).UseSnakeCaseNamingConvention();
);
i couldn't find anyone posting an issue about this so this makes me think it is something we configured wrong?