Concurrent Stream Limits
Your Odyssey plan includes a limit on the number of concurrent interactive streams you can run simultaneously. This limit is displayed in your Developer Portal dashboard. For example, a Free tier account allows up to 5 concurrent streams. This means you can have 5 active interactive sessions running at the same time across all your applications and devices.Concurrent stream limits apply only to interactive streaming sessions created with
startStream().Simulation jobs created through the Simulate API use a separate queue with its own limit - currently up to 10 queued simulation jobs.Why My Concurrent Count Seems Higher Than Expected
You may occasionally notice that your concurrent stream count appears higher than the number of streams you believe are active. This is typically caused by dangling sessions—sessions that were not properly closed.If you’re consistently hitting your concurrent limit due to dangling sessions, try implementing proper disconnect handling in your application (see best practices below).
Common Causes of Dangling Sessions
- Browser crashes or tab closures: If you close a browser tab without properly disconnecting, the session may remain active on our servers until it times out.
- Network interruptions: Sudden network disconnections (Wi-Fi drops, mobile network switches) can prevent the disconnect signal from reaching our servers.
- Application crashes: If your application crashes or is force-quit, it may not have a chance to send the disconnect signal.
- Hot Module Replacement (HMR): Development tools like Vite, Webpack, and Next.js use HMR to update your code without a full page reload. When a component that holds an Odyssey connection is replaced, the old connection may not be properly cleaned up, leaving orphaned sessions.
- Development restarts: Restarting your dev server (Ctrl+C and restart) without proper cleanup can leave sessions open on the server side.
- Multiple browser tabs: Opening the same application in multiple tabs can create multiple sessions, which may not all be cleaned up when you close the window.
Idle Session Timeout
Sessions that remain connected but have no active stream for 15 minutes are automatically disconnected. This prevents idle connections from holding GPU resources. If your application needs to keep a connection open between streams, ensure you start a new stream within 15 minutes or handle the disconnection gracefully.Individual streams also have a separate per-stream duration limit. See Stream Duration Limits for details and reconnection patterns.
How Dangling Sessions Are Resolved
Odyssey automatically cleans up stale sessions through a background process:- Sessions that haven’t sent a heartbeat within the timeout window are marked as stale
- Stale sessions are automatically terminated and won’t count against your concurrent limit
- This cleanup process runs continuously, typically resolving dangling sessions within a few minutes
Typical Session Lifecycle
An Odyssey session follows a simple lifecycle: A connection is established withconnect(). Once connected, your application can start and stop multiple streams within the same connection.
When finished, call disconnect() to release resources.
For a conceptual explanation of how connections and streams relate, see Connections vs Streams.
Best Practices for Clean Session Management
Always Disconnect When Done
Call the disconnect method when your user leaves or when the session is no longer needed:Handle Page Visibility Changes
For web applications, consider pausing or disconnecting when the user switches tabs:Implement Reconnection Logic
If your application needs to maintain long-running sessions, implement reconnection logic that properly cleans up the old session:Handle Hot Module Replacement (HMR)
HMR is one of the most common causes of dangling sessions during development. When your bundler (Vite, Webpack, Next.js) hot-reloads a component, the previous instance’s cleanup function may not run correctly, leaving WebRTC connections open.Finding and Closing Dangling Sessions
If you need to immediately free up your concurrent session slots, you can find and terminate processes that may have orphaned Odyssey connections.Identify Processes with Active Connections
Odyssey sessions use WebRTC connections to our streaming servers. You can find processes holding these connections using network inspection tools.- macOS
- Linux
- Windows
- Open Activity Monitor (Cmd + Space, type “Activity Monitor”)
- Search for “node”, “python”, or your browser name
- Select the process and click the X button to quit
Browser-Specific Cleanup
For web applications, dangling sessions often persist in browser tabs or service workers:- Chrome
- Firefox
- Safari
- Close all tabs running your Odyssey application
- Clear site data: Settings → Privacy → Clear browsing data → Cookies and site data
- Check service workers: DevTools (F12) → Application → Service Workers → Unregister
- Force close:
chrome://restartin the address bar
Development Environment Cleanup
During development, orphaned processes are common. Here’s how to clean up:Monitoring Your Usage
The Developer Portal dashboard shows your current usage in real-time:- Concurrent Streams: The number of active interactive sessions right now
- Total Hours Used: Cumulative streaming time this billing period
- Simulation Hours: Time spent on simulation/headless jobs