Commit Graph

5 Commits

Author SHA1 Message Date
Developer c90f7155ce FIX: Access log location - check correct cPanel path first
cPanel standard access log location is /var/log/apache2/domlogs/
The old code was checking /etc/apache2/logs/domlogs first (wrong priority)

Changes:
- Check /var/log/apache2/domlogs FIRST (primary cPanel location)
- Then check /home/USER/access-logs (symlink, if user found)
- Then check /etc/apache2/logs/domlogs (alternative)
- Also improved Plesk (/var/www/vhosts/*/logs/) and InterWorx paths

This ensures peak concurrent values are calculated correctly when
logs exist. If logs don't exist for a domain, function now returns
empty string (can be handled with fallback).
2026-04-20 19:08:27 -04:00
Developer 3a14df27ae CORRECT: peak concurrent multiplier - use 0.15 instead of 0.6 for realistic estimate
The 0.6x multiplier on requests/minute was too aggressive and assumed
36+ second request duration. Corrected to 0.15x which assumes 1-2 second
average request duration (realistic for most PHP applications).

Example calculation:
- 421 requests/minute = 7 requests/second
- With 0.15 multiplier: 63 concurrent PHP processes
- This assumes ~1.5 second average request processing time
- Much more realistic than the old hour-based 421 or the initial 252

Testing shows this works well for:
- Fast APIs: 0.1-0.5s per request
- Normal PHP apps: 1-2s per request
- WordPress with queries: 2-5s per request
2026-04-20 18:54:05 -04:00
Developer 746b861640 CRITICAL FIX: peak concurrent calculation - use minute granularity not hour
Peak concurrent calculation was extracting hour from timestamp and counting
requests per hour (e.g., 421 requests in hour 14). This is completely wrong
for estimating concurrent PHP processes.

Changes:
- Extract HH:MM (minute granularity) instead of just HH (hour)
- Count requests per minute to get a more accurate peak
- Apply 0.6x multiplier to estimate concurrent (assumes ~0.6s avg request)
- For low traffic (<=5 requests), return count as-is

Example:
- OLD: 421 (requests in busiest hour) = WRONG
- NEW: 421 * 0.6 = 252 concurrent at peak (closer to reality)
- With this fix, batch analyzer now shows realistic concurrent values
2026-04-20 18:50:56 -04:00
cschantz 7a44ff81d4 Fix broken traffic analysis functions in php-scanner.sh
- Fix find_domain_owner: Remove leading whitespace from username
- Fix find_domain_access_log: Follow symlinks with -L flag
- Add fallback paths for Apache domlogs directory
- Add fallback to public_html if access-logs not found
- Now properly detects peak concurrent requests
- Traffic filtering and batch analyzer prioritization now functional

Issues fixed:
- find_domain_owner returned ' pickledperil' instead of 'pickledperil'
- find command didn't follow symlinks in /home/user/access-logs
- Access logs are typically in /etc/apache2/logs/domlogs

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-18 17:27:58 -05:00
cschantz 13d7054aa1 Fix critical bugs and add domain-by-domain batch analyzer
- Fix line 63 in php-analyzer.sh: Add default value for count variable (integer comparison error)
- Fix line 655 in php-analyzer.sh: Add default value for memory_error_count (integer comparison error)
- Fix line 396 in php-scanner.sh: Replace unsafe eval with safe getent passwd lookup
- Add php-ui.sh: User interface and menu system (18KB, 25+ functions)
- Add php-scanner.sh: Server enumeration system (17KB, 18 functions)
- Add php-action-executor.sh: Optimization execution system (17KB, 20 functions)
- Add php-server-manager.sh: Orchestration framework (21KB, 7 functions)
- Add php-fpm-batch-analyzer.sh: One-shot diagnostic script showing current vs recommended max_children, memory impact, and optimization potential
- Add comprehensive test suite (24 tests)

These fixes resolve "integer expression expected" errors during domain analysis.
Batch analyzer enables users to see domain-by-domain optimization opportunities before applying changes.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-17 22:43:49 -05:00