-- Fix tech_specs vcpu_per_users to realistic values
-- vcpu_per_users = how many users 1 vCPU can handle (higher = lighter workload)

-- ============================================
-- WEB SERVERS (very light - reverse proxy, static)
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 2000 WHERE name = 'nginx';
UPDATE tech_specs SET vcpu_per_users = 2000 WHERE name = 'caddy';
UPDATE tech_specs SET vcpu_per_users = 1500 WHERE name = 'traefik';
UPDATE tech_specs SET vcpu_per_users = 800 WHERE name = 'apache';
UPDATE tech_specs SET vcpu_per_users = 2000 WHERE name = 'haproxy';

-- ============================================
-- CACHES (very light - in-memory)
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 2000 WHERE name = 'redis';
UPDATE tech_specs SET vcpu_per_users = 3000 WHERE name = 'memcached';

-- ============================================
-- RUNTIMES / LANGUAGES
-- ============================================
-- Light runtimes (Go, Rust - very efficient)
UPDATE tech_specs SET vcpu_per_users = 800 WHERE name = 'go';
UPDATE tech_specs SET vcpu_per_users = 800 WHERE name = 'rust';

-- Medium runtimes (Node.js, Deno, Bun)
UPDATE tech_specs SET vcpu_per_users = 400 WHERE name = 'nodejs';
UPDATE tech_specs SET vcpu_per_users = 400 WHERE name = 'deno';
UPDATE tech_specs SET vcpu_per_users = 500 WHERE name = 'bun';

-- Scripting languages (PHP, Python, Ruby)
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'php';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'python';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'ruby';

-- JVM-based (heavier due to JVM overhead)
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'java';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'kotlin';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'scala';

-- .NET
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'dotnet';

-- ============================================
-- DATABASES
-- ============================================
-- Light databases
UPDATE tech_specs SET vcpu_per_users = 1500 WHERE name = 'sqlite';

-- Standard RDBMS
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'mysql';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'postgresql';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'mariadb';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'mssql';

-- NoSQL (document-based - lighter queries)
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'mongodb';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'couchdb';

-- Time-series / Analytics (heavy)
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'clickhouse';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'timescaledb';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'questdb';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'influxdb';

-- Search engines (heavy)
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'elasticsearch';

-- Distributed databases (heavy)
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'cassandra';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'cockroachdb';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'vitess';
UPDATE tech_specs SET vcpu_per_users = 60 WHERE name = 'neo4j';

-- ============================================
-- MESSAGE QUEUES
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'rabbitmq';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'kafka';
UPDATE tech_specs SET vcpu_per_users = 500 WHERE name = 'nats';

-- ============================================
-- WEB FRAMEWORKS
-- ============================================
-- Node.js frameworks
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'express';
UPDATE tech_specs SET vcpu_per_users = 350 WHERE name = 'fastify';
UPDATE tech_specs SET vcpu_per_users = 250 WHERE name = 'nestjs';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'nextjs';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'nuxt';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'remix';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'adonis';

-- Python frameworks
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'django';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'flask';
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'fastapi';

-- Ruby frameworks
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'rails';

-- PHP frameworks
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'laravel';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'symfony';

-- Java frameworks
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'spring-boot';

-- Go frameworks
UPDATE tech_specs SET vcpu_per_users = 600 WHERE name = 'gin';
UPDATE tech_specs SET vcpu_per_users = 600 WHERE name = 'fiber';
UPDATE tech_specs SET vcpu_per_users = 600 WHERE name = 'echo';

-- ============================================
-- CMS / ECOMMERCE
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'wordpress';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'drupal';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'joomla';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'ghost';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'strapi';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'directus';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'payload';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'keystone';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'wagtail';

-- Heavy CMS/ERP
UPDATE tech_specs SET vcpu_per_users = 40 WHERE name = 'magento';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'woocommerce';
UPDATE tech_specs SET vcpu_per_users = 40 WHERE name = 'odoo';
UPDATE tech_specs SET vcpu_per_users = 40 WHERE name = 'erpnext';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'shopify';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'medusa';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'saleor';

-- ============================================
-- COMMUNICATION / CHAT
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'mumble';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'teamspeak';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'matrix';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'mattermost';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'rocketchat';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'zulip';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'revolt';
UPDATE tech_specs SET vcpu_per_users = 500 WHERE name = 'discord-bot';

-- Video conferencing (CPU intensive)
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'jitsi';

-- ============================================
-- DEVOPS / CI/CD
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 30 WHERE name = 'gitlab';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'gitea';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'gitness';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'jenkins';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'drone';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'woodpecker';
UPDATE tech_specs SET vcpu_per_users = 60 WHERE name = 'concourse';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'argocd';
UPDATE tech_specs SET vcpu_per_users = 60 WHERE name = 'sonarqube';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'harbor';

-- ============================================
-- MONITORING / OBSERVABILITY
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'grafana';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'prometheus';
UPDATE tech_specs SET vcpu_per_users = 80 WHERE name = 'loki';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'jaeger';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'zipkin';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'zabbix';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'nagios';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'netdata';
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'uptime-kuma';

-- ============================================
-- AUTOMATION / LOW-CODE
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'n8n';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'nocodb';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'appwrite';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'supabase';

-- ============================================
-- DOCUMENTATION / WIKI
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'bookstack';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'wiki-js';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'hedgedoc';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'outline';

-- ============================================
-- MEDIA / FILES
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'nextcloud';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'seafile';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'photoprism';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'immich';

-- Media streaming (CPU intensive for transcoding)
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'plex';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'jellyfin';
UPDATE tech_specs SET vcpu_per_users = 10 WHERE name = 'audiobookshelf';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'calibre-web';

-- ============================================
-- AI / ML (very CPU/GPU intensive)
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 1 WHERE name = 'ollama';
UPDATE tech_specs SET vcpu_per_users = 1 WHERE name = 'vllm';
UPDATE tech_specs SET vcpu_per_users = 1 WHERE name = 'text-generation-webui';
UPDATE tech_specs SET vcpu_per_users = 1 WHERE name = 'localai';
UPDATE tech_specs SET vcpu_per_users = 1 WHERE name = 'stable-diffusion';
UPDATE tech_specs SET vcpu_per_users = 1 WHERE name = 'comfyui';
UPDATE tech_specs SET vcpu_per_users = 2 WHERE name = 'whisper';
UPDATE tech_specs SET vcpu_per_users = 10 WHERE name = 'langchain';
UPDATE tech_specs SET vcpu_per_users = 10 WHERE name = 'tensorflow';
UPDATE tech_specs SET vcpu_per_users = 10 WHERE name = 'pytorch';

-- ============================================
-- GAME SERVERS (CPU intensive, low player count)
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 10 WHERE name = 'minecraft';
UPDATE tech_specs SET vcpu_per_users = 15 WHERE name = 'minecraft-bedrock';
UPDATE tech_specs SET vcpu_per_users = 10 WHERE name = 'valheim';
UPDATE tech_specs SET vcpu_per_users = 15 WHERE name = 'terraria';
UPDATE tech_specs SET vcpu_per_users = 8 WHERE name = 'factorio';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'ark';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'rust-game';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'palworld';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = '7daystodie';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'satisfactory';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'enshrouded';
UPDATE tech_specs SET vcpu_per_users = 8 WHERE name = 'projectzomboid';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'conanexiles';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'dayz';
UPDATE tech_specs SET vcpu_per_users = 8 WHERE name = 'vrising';
UPDATE tech_specs SET vcpu_per_users = 15 WHERE name = 'csgo';
UPDATE tech_specs SET vcpu_per_users = 20 WHERE name = 'l4d2';
UPDATE tech_specs SET vcpu_per_users = 15 WHERE name = 'gmod';
UPDATE tech_specs SET vcpu_per_users = 20 WHERE name = 'unturned';

-- ============================================
-- VIDEO / ENCODING (CPU intensive)
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 3 WHERE name = 'ffmpeg';
UPDATE tech_specs SET vcpu_per_users = 5 WHERE name = 'obs';

-- ============================================
-- SECURITY / AUTH
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'vaultwarden';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'vault';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'keycloak';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'authelia';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'authentik';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'crowdsec';

-- ============================================
-- NETWORKING / PROXY / VPN
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'openvpn';
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'wireguard';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'squid';

-- ============================================
-- BACKUP (depends on compression)
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'borgbackup';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'restic';
UPDATE tech_specs SET vcpu_per_users = 50 WHERE name = 'duplicati';

-- ============================================
-- CONTAINER / ORCHESTRATION
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'docker';
UPDATE tech_specs SET vcpu_per_users = 100 WHERE name = 'kubernetes';
UPDATE tech_specs SET vcpu_per_users = 150 WHERE name = 'nomad';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'consul';

-- ============================================
-- MISC / UTILITIES
-- ============================================
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'homeassistant';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'paperless';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'freshrss';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'wallabag';
UPDATE tech_specs SET vcpu_per_users = 300 WHERE name = 'mealie';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'excalidraw';
UPDATE tech_specs SET vcpu_per_users = 200 WHERE name = 'graphql';
