Priority
Posted by Dan Creswell in Architecture, tags: architecture design prioritisation workload capacityPrioritisation is a solution that can be used in a few situations:
- Messaging – where some class of messages needs to be processed before one or more other classes.
- Job execution – where the results of some set of jobs need to be available before others.
- Levelling – where satisfying peak demand would require lots of hardware that in other periods would be significantly under-utilised.
It’s a very useful pattern but there are a few dark corners to think about:
- Even low priority items have some importance, otherwise they wouldn’t exist at all. If there are too many high priority items passing through the system there is significant risk the low priority items will not be processed in an acceptable time period.
- If there are too many high priority items passing through the system, the low priority items might not get processed at all leading to huge backlogs that take an age to process.
- If the high priority items begin taking a large amount of time to process, low priority items are delayed with resulting in a huge backlog as above.
In essence, a certain workload mix can mean that one must wait infinitely for low priority items to be processed and that is rarely acceptable. Making prioritisation work effectively means ensuring that there is sufficient capacity to process all work within their respective acceptable time periods.
For some applications there is a convenient “quiet” period overnight where low priority items can be cleared out of the system as there’s a dearth of high priority items to process. In other cases processing of priority classes must be interleaved e.g. process 100 high priority items, then 5 low priority items and repeat. Alternatively one can dedicate varying sized pools of resource (partitioning) to processing priority classes with each pool scaled according to their timeliness requirements.
Some technical staff naively use priority to solve a throughput problem where capacity is insufficient to cope with all work in parallel. This can appear to work for a while if there are lulls in demand as mentioned above but ultimately, as workload increases such an approach will fail unless care is taken in profiling the workload and ensuring there is sufficient capacity to satisfy all priorities.
Comments Off

Entries (RSS)