diff --git a/modules/performance/php-fpm-batch-analyzer.sh b/modules/performance/php-fpm-batch-analyzer.sh index 21630fc..963d13a 100755 --- a/modules/performance/php-fpm-batch-analyzer.sh +++ b/modules/performance/php-fpm-batch-analyzer.sh @@ -280,17 +280,18 @@ for idx in "${sorted_indices[@]}"; do continue fi - # Determine traffic indicator + # Determine traffic indicator based on traffic PERCENTAGE (not peak concurrent) traffic_indicator="" - if [[ "$peak" =~ ^[0-9]+$ ]]; then - if [ "$peak" -ge 20 ]; then - traffic_indicator="${RED}⚠ CRITICAL TRAFFIC (${peak})${NC}" - elif [ "$peak" -ge 10 ]; then - traffic_indicator="${YELLOW}⚠ HIGH TRAFFIC (${peak})${NC}" - elif [ "$peak" -ge 5 ]; then - traffic_indicator="${CYAN}→ MEDIUM TRAFFIC (${peak})${NC}" + traffic_pct="${traffic_percentage_arr[$idx]:-0}" + if [[ "$traffic_pct" =~ ^[0-9]+$ ]]; then + if [ "$traffic_pct" -ge 50 ]; then + traffic_indicator="${RED}⚠ CRITICAL TRAFFIC${NC}" + elif [ "$traffic_pct" -ge 25 ]; then + traffic_indicator="${YELLOW}⚠ HIGH TRAFFIC${NC}" + elif [ "$traffic_pct" -ge 10 ]; then + traffic_indicator="${CYAN}→ MEDIUM TRAFFIC${NC}" else - traffic_indicator="${WHITE}○ LOW TRAFFIC (${peak})${NC}" + traffic_indicator="${WHITE}○ LOW TRAFFIC${NC}" fi else traffic_indicator="${WHITE}○ TRAFFIC UNKNOWN${NC}" @@ -317,7 +318,7 @@ for idx in "${sorted_indices[@]}"; do else cecho "${GREEN}[$idx]${NC} $domain" cecho " Owner: $owner" - cecho " Traffic: $traffic_indicator" + cecho " Traffic: $traffic_indicator (${traffic_percentage_arr[$idx]}% of server)" cecho "" cecho " ${BOLD}Pool Settings:${NC}" cecho " pm.max_children: $current"