Skip to main content
All Moru accounts have the same resource limits.

Resource Limits

ResourceLimit
Disk per sandbox10 GB
Concurrent sandboxes20
Max sandbox duration1 hour
Max vCPUs2 cores
Max RAM4 GB
Concurrent template builds5

Checking Current Usage

Via Dashboard

  1. Go to moru.io/dashboard
  2. View Usage section
  3. See current sandboxes, templates, and resource usage

Via SDK

# Check sandbox metrics
metrics = sandbox.get_metrics()
for m in metrics:
    print(f"CPU: {m.cpu_used_pct:.1f}%")
    print(f"Memory: {m.mem_used / 1024 / 1024:.0f} MB / {m.mem_total / 1024 / 1024:.0f} MB")
    print(f"Disk: {m.disk_used / 1024 / 1024:.0f} MB / {m.disk_total / 1024 / 1024:.0f} MB")

Via CLI

# Check sandbox metrics
moru sandbox metrics sbx_abc123

# List all sandboxes
moru sandbox list

Handling Quota Errors

Concurrent Sandbox Limit

When you hit the concurrent sandbox limit:
from moru.exceptions import SandboxException

try:
    sandbox = Sandbox.create()
except SandboxException as e:
    if "quota" in str(e).lower():
        # Kill old sandboxes
        for info in Sandbox.list():
            if should_cleanup(info):
                Sandbox.kill(info.sandbox_id)
        # Retry
        sandbox = Sandbox.create()

Disk Space Limit

from moru.exceptions import NotEnoughSpaceException

try:
    sandbox.files.write("/large_file", data)
except NotEnoughSpaceException:
    # Clean up old files
    sandbox.commands.run("rm -rf /tmp/*")
    sandbox.commands.run("rm -rf ~/.cache/*")
    # Retry
    sandbox.files.write("/large_file", data)

Need More Resources?

If you need higher limits (more concurrent sandboxes, longer duration, more vCPUs/RAM), contact us at hi@moru.io.

Resource Optimization Tips

Reuse Sandboxes

# Keep sandbox alive for multiple tasks
sandbox = Sandbox.create(timeout=3600)  # 1 hour

for task in tasks:
    sandbox.commands.run(task)
    sandbox.set_timeout(3600)  # Reset timeout

sandbox.kill()

Clean Up Promptly

# Use context manager for automatic cleanup
with Sandbox.create() as sandbox:
    result = sandbox.commands.run("task")
# Sandbox automatically killed

Use Templates

Pre-install dependencies in templates to reduce setup time and disk usage per sandbox.

Next Steps