Browse Source

Reduce batching.

pull/687/head
Sebastian 5 years ago
parent
commit
14625bd48e
  1. 2
      backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs
  2. 4
      backend/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs
  3. 2
      backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs
  4. 2
      backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs

2
backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs

@ -105,7 +105,7 @@ namespace Migrations.Migrations.MongoDb
}, new ExecutionDataflowBlockOptions
{
MaxDegreeOfParallelism = Environment.ProcessorCount * 2,
MaxMessagesPerTask = 1,
MaxMessagesPerTask = 10,
BoundedCapacity = SizeOfQueue
});

4
backend/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs

@ -319,7 +319,7 @@ namespace Squidex.Domain.Apps.Entities.Backup
private async Task ReadEventsAsync(IBackupReader reader, IEnumerable<IBackupHandler> handlers)
{
const int BatchSize = 500;
const int BatchSize = 100;
var handled = 0;
@ -346,7 +346,7 @@ namespace Squidex.Domain.Apps.Entities.Backup
BoundedCapacity = 2
});
var batchBlock = new BatchBlock<(string, Envelope<IEvent>)>(500, new GroupingDataflowBlockOptions
var batchBlock = new BatchBlock<(string, Envelope<IEvent>)>(BatchSize, new GroupingDataflowBlockOptions
{
BoundedCapacity = BatchSize
});

2
backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs

@ -115,7 +115,7 @@ namespace Squidex.Infrastructure.Commands
new ExecutionDataflowBlockOptions
{
MaxDegreeOfParallelism = parallelism,
MaxMessagesPerTask = 1,
MaxMessagesPerTask = 10,
BoundedCapacity = parallelism
});

2
backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs

@ -71,7 +71,7 @@ namespace Squidex.Infrastructure.EventSourcing.Grains
}, new ExecutionDataflowBlockOptions
{
MaxDegreeOfParallelism = 1,
MaxMessagesPerTask = 1,
MaxMessagesPerTask = 10,
BoundedCapacity = batchSize
});

Loading…
Cancel
Save