I am using the Cosmo's DB Gremlin API to insert a bunch of data into the cosmos DB database. However, it is very inconsistent as the data sometimes insert successfully and sometimes times out or have too many requests. My throughput is set manually at 10,000 RU/s. Here are the settings that I am using for the connection pool properties
ConnectionPoolSettings = new ConnectionPoolSettings()
{
MaxInProcessPerConnection = 10,
PoolSize = 30,
ReconnectionAttempts = 3,
ReconnectionBaseDelay = TimeSpan.FromMilliseconds(500)
};
If I increase the MaxInProcessPerConnection or the Poolsize, it sometimes results in 429. If I lower it by too much, it sometimes results in time out errors. Is there a formula or a rule of thumb on how to adjust these settings properly?