Fleets

Fleets are pools of pre-warmed browser sessions ready for instant use. Instead of waiting for session creation, grab a warm session from a fleet with zero cold-start.

Why Fleets?

Approach Cold Start Max Throughput Cost
On-demand sessions ~2s Limited by creation rate Pay per session
Fleet (pre-warmed) ~0ms Limited by fleet size Pay for pool capacity

Create a Fleet

const fleet = await sk.fleets.create({
  name: 'scraping-pool',
  size: 20,              // Keep 20 sessions warm
  maxSize: 100,          // Scale up to 100 under load
  proxy: {
    type: 'datacenter',
    region: 'us',
  },
  stealth: 'basic',
  fingerprint: 'auto',
  sessionTimeout: 600,   // Each session lives 10 min max
})

console.log(`Fleet created: ${fleet.id}`)
console.log(`Status: ${fleet.status}`) // 'warming'

Acquire a Session

Grab a pre-warmed session from the fleet:

const session = await sk.fleets.acquire(fleet.id)

// Session is immediately ready — no cold start!
const browser = await chromium.connectOverCDP(session.cdpUrl)

Release Back to Pool

When done, release the session back instead of destroying it:

await sk.fleets.release(fleet.id, session.id)
// Session is recycled: cookies cleared, fingerprint regenerated

Auto-Scaling

Fleets auto-scale based on demand:

graph LR
    A[Demand Increases] --> B[Acquire rate > Available]
    B --> C[Scale up to maxSize]
    C --> D[New sessions warming...]
    
    E[Demand Decreases] --> F[Idle sessions > size]
    F --> G[Scale down to size]
    G --> H[Excess sessions destroyed]

Fleet Configuration

const fleet = await sk.fleets.create({
  name: 'production-crawlers',
  size: 50,
  maxSize: 200,
  
  // Session defaults
  proxy: {
    type: 'residential',
    country: 'US',
    sticky: true,
  },
  stealth: 'max',
  fingerprint: 'auto',
  sessionTimeout: 300,
  
  // Scaling config
  scaling: {
    scaleUpThreshold: 0.8,   // Scale up when 80% of pool is in use
    scaleDownThreshold: 0.3,  // Scale down when <30% in use
    cooldown: 60,             // Wait 60s between scaling events
  },
  
  // Recycling
  recycling: {
    clearCookies: true,
    clearStorage: true,
    regenerateFingerprint: true,
    maxReuses: 10,            // Destroy session after 10 reuses
  },
})

Fleet Status

Monitor fleet health:

const status = await sk.fleets.status(fleet.id)

console.log(status)
// {
//   id: 'flt_abc123',
//   name: 'production-crawlers',
//   status: 'healthy',
//   current: 50,
//   available: 35,
//   inUse: 15,
//   warming: 0,
//   maxSize: 200,
// }

Best Practices

  1. Right-size your fleet — Set size to your average concurrent usage, maxSize to your peak
  2. Use recycling — Regenerating fingerprints between uses avoids tracking across crawl targets
  3. Monitor utilization — If you're consistently >80% utilized, increase size
  4. Set session timeouts — Prevent leaked sessions from consuming pool capacity