Documentation
¶
Overview ¶
instances provides for running a bunch of skiaserve instances.
Index ¶
Constants ¶
View Source
const ( // MAX_INSTANCES is the max number of concurrent skiaserve instances we // support in the hosted environment. MAX_INSTANCES = 200 // MIN_POOL_SIZE is the number of available spots in the pool that should be // maintained at all times. Instances will be culled by oldest lastUsed time // until this size is reached. MIN_POOL_SIZE = 10 // START_PORT Is the beginning of the range of ports the skiaserve instances // will communicate on. START_PORT = 30000 // START_WAIT_NUM poll the newly started skiaserve this many times before giving up. START_WAIT_NUM = 50 // START_WAIT_PERIOD poll the newly started skiaserve this often. START_WAIT_PERIOD = 100 * time.Millisecond // EXIT_WAIT_PERIOD is the time to wait for the instance to exit. EXIT_WAIT_PERIOD = 2 * time.Second // SKIASERVE is the full path to the skiaserve executable. SKIASERVE = "/usr/local/bin/skiaserve" )
Variables ¶
This section is empty.
Functions ¶
func NewInstanceID ¶
func NewInstanceID() string
NewInstanceID creates a new id for an instance of skiaserve.
Types ¶
type InstanceInfo ¶
type InstanceInfoSlice ¶
type InstanceInfoSlice []*InstanceInfo
func (InstanceInfoSlice) Len ¶
func (p InstanceInfoSlice) Len() int
func (InstanceInfoSlice) Less ¶
func (p InstanceInfoSlice) Less(i, j int) bool
func (InstanceInfoSlice) Swap ¶
func (p InstanceInfoSlice) Swap(i, j int)
type Instances ¶
type Instances struct {
// contains filtered or unexported fields
}
Instances is used to control a number of skiaserve instances all running at the same time.
Instances implements http.handler, which reverse proxies incoming requests to the right backend.
TODO(jcgregorio) Need to add memory limits to instance.
func (*Instances) DescribeAll ¶
func (s *Instances) DescribeAll() []*InstanceInfo
func (*Instances) ServeHTTP ¶
func (s *Instances) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface by proxying the requests to the correct instance based on the uuid.
All requests are routed to the instance, with the exception of /instanceStatus and /instanceNew which will be handled by 'co' itself.
Click to show internal directories.
Click to hide internal directories.