Skip to content
Back to skills

Collection

ASecurity

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

  • 24 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
devopspythongobashdocker

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-a815ae2f/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-a815ae2f)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: worker-monitor
description: |
  Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.
---

## Quick Reference

| Action | Command |
|--------|---------|
| Queue status | `inv core.rq-status` |
| Scale workers | `inv core.ws --workers N` (max 4) |
| Worker logs | `docker logs parcelum-worker-1 --tail 50` |
| Container status | `docker ps --format "table {{.Names}}\t{{.Status}}" \| grep -E "worker\|redis\|mongo"` |

## Monitoring Workflow

### 1. Check Environment Health

```bash
# Docker containers
docker ps --format "table {{.Names}}\t{{.Status}}" | grep -E "worker|redis|mongo"

# Expected: parcelum-worker-1 (healthy), parcelum_redis (healthy), parcelum_mongodb (up)
```

**Health indicators**:
- `(healthy)` = good
- `(unhealthy)` or missing = problem
- Worker count: check how many `parcelum-worker-N` containers exist

### 2. Check Queue Depth

```bash
inv core.rq-status
```

**Output interpretation**:
| Metric | Healthy | Action if unhealthy |
|--------|---------|---------------------|
| `queued` | < 20 | Scale up if > 20 |
| `started` | 1 per worker | Normal |
| `failed` | 0 | Investigate failures |

### 3. Check Worker Logs

```bash
# Recent activity
docker logs parcelum-worker-1 --tail 30

# Search for errors
docker logs parcelum-worker-1 2>&1 | grep -i "error\|exception\|failed" | tail -20

# Follow live (use sparingly)
docker logs parcelum-worker-1 --follow --tail 10
```

**Log patterns**:
| Pattern | Meaning |
|---------|---------|
| `Streaming ... (valuations)` | Processing sub-files |
| `Saved batch N/M` | Progress indicator |
| `Successfully saved X parcels` | Batch complete |
| `ERROR` or `Exception` | Problem - investigate |

## Scaling Rules

**Max workers: 4** (hardware constraint)

### When to Scale Up

| Signal | Action |
|--------|--------|
| Queue depth > 10 jobs | Scale to 2 |
| Queue depth > 20 jobs | Scale to 3-4 |
| Processing large counties (dallas, tarrant, harris) | Scale to 3-4 |

### When to Scale Down

| Signal | Action |
|--------|--------|
| Queue empty, no started jobs | Scale to 1 |
| After batch reprocessing completes | Scale to 1 |

### Scale Commands

```bash
# Scale up
inv core.ws --workers 2
inv core.ws --workers 4

# Scale down
inv core.ws --workers 1

# Check current scale
docker ps | grep worker | wc -l
```

## Wait-for-Completion Pattern

When waiting for jobs to finish (e.g., after `inv core.rqp`):

```bash
# Poll every 30 seconds until queue empty
while true; do
  status=$(inv core.rq_status 2>&1)
  queued=$(echo "$status" | grep -oP 'queued: \K\d+' || echo "0")
  started=$(echo "$status" | grep -oP 'started: \K\d+' || echo "0")
  
  if [ "$queued" = "0" ] && [ "$started" = "0" ]; then
    echo "All jobs complete"
    break
  fi
  
  echo "Waiting... queued=$queued started=$started"
  sleep 30
done
```

Or use the monitoring script:

```bash
python .claude/skills/worker-monitor/scripts/monitor.py --wait
```

## Troubleshooting

### Jobs Stuck in Queue

1. Check workers are running: `docker ps | grep worker`
2. Check worker health: `docker logs parcelum-worker-1 --tail 20`
3. Restart worker if needed: `docker restart parcelum-worker-1`

### Worker Not Processing

1. Check Redis connection: `docker logs parcelum-worker-1 2>&1 | grep -i redis`
2. Check for import errors: `docker logs parcelum-worker-1 2>&1 | grep -i "import\|module"`
3. Rebuild if code changed: `docker-compose build worker && inv core.ws --workers 1`

### High Memory Usage

1. Check: `docker stats --no-stream | grep worker`
2. If memory > 4GB per worker, scale down and let jobs complete
3. Large counties (dallas, tarrant) need more memory per worker

## Integration with data-quality Skill

When reprocessing counties after fixes:

1. **Before reprocessing**: Check queue is empty, scale to 2+ workers
2. **After enqueueing**: Monitor progress with `inv core.rq_status`
3. **While waiting**: Check logs for errors
4. **After completion**: Scale down to 1, proceed to validation

Example flow:
```
# 1. Scale up
inv core.ws --workers 2

# 2. Enqueue jobs
inv core.rqp fort_bend -r
inv core.rqp dallas -r

# 3. Monitor
inv core.rq_status
docker logs parcelum-worker-1 --tail 20

# 4. After complete, scale down
inv core.ws --workers 1

# 5. Validate
python -m county_parser.cli.validate --county fort_bend,dallas --size 500
```

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…