slot tracking improvements (#562)

* fn: remove 100 msec sleep for hot containers

*) moved slot management to its own file
*) slots are now implemented with LIFO semantics, this is important since we do
   not want to round robin hot containers. Idle hot containers should timeout properly.
*) each slot queue now stores a few basic stats such as avg time a call spent in a given
   state and number of running/launching containers, number of waiting calls in those states.
*) first metrics in these basic stats are discarded to avoid initial docker pull/start spikes.
*) agent now records/updates slot queue state and how much time a call stayed in that state.
*) waitHotSlot() replaces the previous wait 100 msec logic where it sends a msg to
   hot slot go routine launchHot() and waits for a slot
*) launchHot() is now a go routine for tracking containers in hot slots, it determines
   if a new containers is needed based on slot queue stats.
This commit is contained in:
Tolga Ceylan
2017-12-15 15:50:07 -08:00
committed by GitHub
parent a9820cfbab
commit 25a72146f5
3 changed files with 512 additions and 174 deletions

View File

@@ -300,6 +300,7 @@ type call struct {
req *http.Request
stderr io.ReadWriteCloser
ct callTrigger
slots *slotQueue
}
func (c *call) Model() *models.Call { return c.Call }