CAP icon indicating copy to clipboard operation
CAP copied to clipboard

ScheduleMessagesOfDelayedAsync Limit

Open PoteRii opened this issue 8 months ago • 4 comments

Hello, If for some reason there is large number of records in db with Delayed or Queued status, all of the records are fetched into memory and this might create problems if you are running pods in K8s, because typically each pod does not have much memory. What do you think about adding a limit here? it can be configurable https://github.com/dotnetcore/CAP/blob/master/src/DotNetCore.CAP.PostgreSql/IDataStorage.PostgreSql.cs#L240

PoteRii avatar May 15 '25 09:05 PoteRii

I'd prefer not to add this configuration, as the CAP scheduler is inherently lightweight by design. How much data do you intend to load into memory?

yang-xiaodong avatar May 22 '25 09:05 yang-xiaodong

It mostly depends on the feature and use-case, but limitless query from db into memory is always a bad idea...

PoteRii avatar May 22 '25 09:05 PoteRii

@yang-xiaodong we can create configuration with lot's of limit for example 100K or something like this but whoever will need to decrease it will decrease on his side. We had issue few days ago and lot's of queued messages accumulated so everything went down for this service and we needed lots of apport to fix this

kvrivishvil1 avatar Jun 02 '25 09:06 kvrivishvil1

any progress regarding this issue? We have a lot of delayed messages and our services are consuming huge amount of ram at the moment

tamazbagdavadze avatar Jun 13 '25 11:06 tamazbagdavadze

Could this be available on preview @yang-xiaodong ???

carlosxjose avatar Jul 23 '25 16:07 carlosxjose

Fixed in version 8.4.0-preview-270476069

yang-xiaodong avatar Jul 28 '25 12:07 yang-xiaodong