S
S
Sergey Sokolov2017-06-19 13:25:57
Algorithms
Sergey Sokolov, 2017-06-19 13:25:57

How to recruit a group of tasks when they arrive randomly?

One-time tasks are received as input. It takes some time to complete them.
Tasks can be grouped into packs of N, and they will be completed quickly, in time as one. Does not parallelize: sent 1 or several for execution - we are waiting for the result.
So far I see two options:

  1. Or run the first execution as soon as the first task arrived. This is inefficient when several tasks arrive at once - they could be launched in one batch, otherwise the 1st one will leave and then all minus the 1st one - in two "tacts".
  2. Whether to wait for some time before execution in case of receipt of many tasks at once. Then inefficient downtime in the case of a single job.

What do the world's best practices say about this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-06-19
@sergiks

In the general case, there can be no tricky solution here that would guarantee optimality.
You need to look specifically at your situation.
How critical is the delay? What is more important - to launch each new task as soon as possible or to minimize the average processing time? How long does a batch of tasks take to process? Are there any statistics on how many new tasks arrive during this time? Tasks usually come randomly and evenly in time, or are there any patterns? Do all tasks have the same priority, or are some urgent and some not so urgent?
Moreover, all this should be in concrete numbers. Then something can be decided.
In the current formulation, nothing can be said at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question