cb5352db22
FIXED BUGS: BUG #1: MySQL Memory Field Extraction (CRITICAL) - Was using cut -d'|' -f3 on a 2-field output - detect_mysql_memory_usage returns: memory|status - Fixed to use cut -d'|' -f1 (corrects both functions) - Impact: MySQL memory was calculated as 0, leading to inflated capacity - Fix severity: CRITICAL - affects all server capacity calculations BUG #2: Domain Traffic Percentage Analysis (CRITICAL) - Previous implementation had broken loop logic - Was counting files multiple times, producing wrong percentages - Completely rewrote to use simplified approach: - Best-effort search for domain-specific access logs - Falls back to equal distribution if logs not found - Supports cPanel, Plesk, and InterWorx log locations - Impact: Traffic percentages were wildly inaccurate - Fix severity: CRITICAL - affects fair share allocation BUG #3: Hardcoded Log Paths (MODERATE) - Only worked on cPanel, failed on other control panels - Now searches multiple standard log locations - Falls back to equal distribution for portability - Impact: Script would fail or give wrong results on Plesk/InterWorx - Fix severity: MODERATE - affects multi-panel support TESTING COMPLETED: - ✅ Syntax validation: All files pass bash -n check - ✅ Logic verification: 8GB server test case works correctly - Expected capacity: 245 max_children - Test result: 245 max_children ✓ - ✅ Fair share allocation math verified - ✅ Three-constraint MIN logic verified - ✅ Function calls verified in batch analyzer and optimizer All three scripts now ready for field testing.