Skip to content

Commit

Permalink
Increase semaphore grants and max connections (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
karashiiro authored Jul 27, 2024
1 parent 36f765e commit 1f18ea6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Universalis.DbAccess/DbAccessExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public static void AddDbAccessServices(this IServiceCollection sc, IConfiguratio
// Notes on query idempotence and speculative execution: https://docs.datastax.com/en/developer/csharp-driver/3.20/features/speculative-retries/#query-idempotence
var scyllaCluster = Cluster.Builder()
.AddContactPoints(scyllaConnectionString.Split(','))
.WithPoolingOptions(PoolingOptions.Create()
.SetMaxRequestsPerConnection(3000))
.WithSpeculativeExecutionPolicy(new ConstantSpeculativeExecutionPolicy(200, 3))
.WithQueryOptions(new QueryOptions()
.SetDefaultIdempotence(true)
Expand Down
2 changes: 1 addition & 1 deletion src/Universalis.DbAccess/MarketBoard/SaleStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SaleStore(ICluster scylla, ICacheRedisMultiplexer cache, ILogger<SaleStor
_cache = cache;
_logger = logger;

_lock = new SemaphoreSlim(1000, 1000);
_lock = new SemaphoreSlim(1800, 1800);

// Doing database initialization in a constructor is a Bad Idea and
// can lead to timeouts killing the application, so this just gets
Expand Down

0 comments on commit 1f18ea6

Please sign in to comment.