k8s-cluster-simulator icon indicating copy to clipboard operation
k8s-cluster-simulator copied to clipboard

Making k8s-cluster-simulator event-driven

Open oza opened this issue 5 years ago • 0 comments

Currently, the k8s-cluster-simulator is designed as a time-driven simulator (using a variable, tick, as a time). The simplicity of the design is nice :-) This design, however, might cause some difficulties when simulating:

  1. Some events, like node failures, are not guaranteed to occur at regular intervals. If an event happens between ticks, it has to be postponed until the next tick.
  2. As a workaround of 1, we can make the tick value smaller. This can cause additional useless ticks. The result is a longer simulation time.

To address the difficulties, this issue proposes to make the simulator event-driven instead of time-driven one. The event-driven simulator can skip useless ticks since it only handles events (an element to change state) instead of handling periodic ticks. Events include a scheduler’s scheduling , node addition/deletion, submitter’s job submission/cancellation, and so on. One deficit of the proposal I recognize is complexity - I don’t know whether it fits in the current simulator’s design. So, do you have any comments about the point?

For the purpose of reference, I implemented a basic data structure, evseq, for an event-driven simulator. I hope that this sample pseudo main loop helps our discussion.

oza avatar Apr 15 '19 04:04 oza