News for hackers. Stuff that matters.
Re:Building a fair multi-tenant queuing system by jillesvangurp on Monday January 22, 2024 @11:36PM (#39099703)
I found a nice article on skip locked last week: https://www.crunchydata.com/blog/message-queuing-using-nativ...

We went ahead and implemented our own little queue in postgres based on that to get rid of a wonky thing we had that built on top of redis. What I like about this is that it's simple, robust, and transactional. So, you get some nice guarantees out of that.

For fairness, you might do stuff with partitioning on the priority column. Simply set up your workers to only hit a certain partition. So you have separate workers for higher and lower priority queue items. If you then dynamically lower the priority of tenants sending you lots of traffic, the system becomes more fair for the others. You could work with some simple moving average here. Just an idea, but something like this might work.

There are no comments on this comment yet.