[][src]Struct ciruela::cluster::Config

pub struct Config { /* fields omitted */ }

Configuration for clustered connection

More settings will be added as needed.

Methods

impl Config
[src]

Create an initial config connecting to 127.0.0.1:24783

Set number of connections to initiate when accessing cluster

Default: 3.

Ciruela picks num random addresses from the ones passed to connection constructor, and connects to them initially. Then if image is not accepted at this node or if the node fails, ciruela establishes connections to other nodes keeping max num connections for any specific image upload.

In other words, this is a hint of how much simultaneous uploads might be going of any specific image. Rules of thumb:

  1. Too large value means you're uploading data to more servers from a client which presumably has slower connections than local connection between nodes.
  2. Small value like 1 is bad when node downloading image would fail
  3. The default of 3 is just good enough

Note, that big value (1) is also not a big deal because nodes will try top optimize download anyway. Also, num=1 (2) is not big deal as ciruela will reconnect when node fails anyway. So technically any value is okay.

Set ciruela server port

This port is used both for initial connections and when redirecting connections to other host names.

Define how to define early success of an upload

Basically this means that if after timeout we couldn't get notifications that all hosts are downloaded the image, but this number of hosts done, we stop the upload tool and report success.

The number of hosts is determined as the following:

  1. Find out hosts that accept a directory, ceil(accepting_hosts*fraction)
  2. If the number above is smaller than hosts we the latter instead
  3. If accepting_hosts is smaller than hosts we use former

Defaults are: hosts=3, fraction=0.75, duration=30 sec

By default this provides resilience in the following ways:

  1. Upload to at least three hosts (unless total hosts count is smaller)
  2. Tolerate 25% of nodes currently failing
  3. Do not wait full deadline if some hosts are failing because that would make deploy too long

(I.e. we need to keep the deadline huge, because 100% new/uncached image over a slow channel between CI and production might take lot of time to upload)

Maximum time to wait before for upload before reporting failure

Default: 30 minutes

Thix timeout should be big, because 100% new/uncached image over a slow channel between CI and production might take lot of time to upload. Still default might be too pessimistic if you know your setup better.

Finalize config and return an Arc of a config

Trait Implementations

impl Clone for Config
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Config
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Same for T

Should always be Self

impl<T> Erased for T

impl<T> Any for T where
    T: Any
[src]