|
15 Analyzers |
65+ Checks |
5 Fix Generators |
< 3s Avg Runtime |
100% Open Source |
A comprehensive performance analysis and optimization tool for Magento 2 and Adobe Commerce installations with automated fix generation and intelligent CDN detection.
- βοΈ Enhanced Fastly CDN Detection - Multi-method detection via composer, env.php, HTTP headers, and module configuration
- π― Intelligent Caching Recommendations - Automatically adapts recommendations based on Fastly vs Varnish setup
- βοΈ Refactored Varnish Commands - Modular command generation with better error handling
- π§ Improved Configuration Loading - Enhanced reliability with EnhancedConfigLoader
- π Smarter Fix Scripts - Context-aware script generation based on detected infrastructure
|
|
|
|
# Download latest release
wget https://github.com/PiotrSiejczuk/m2-performance-review/raw/v1.0.3/m2-performance.phar
# Make executable
chmod +x m2-performance.phar
# Run analysis
./m2-performance.phar review /path/to/magento2git clone https://github.com/PiotrSiejczuk/m2-performance-review.git
cd m2-performance-review
composer install
php bin/performance review /path/to/magento2# Run comprehensive performance review
./m2-performance.phar review /var/www/magento2
# Generate fix scripts automatically
./m2-performance.phar review /var/www/magento2 --generate-fix
# Export results in various formats
./m2-performance.phar review /var/www/magento2 --export json,html,csv# Monitor cache performance in real-time
./m2-performance.phar cache:monitor /var/www/magento2
# Watch mode with 5-second refresh
./m2-performance.phar review /var/www/magento2 --watch# Check for updates
./m2-performance.phar self-update --check
# Update to latest version
./m2-performance.phar self-update
# Rollback if needed
./m2-performance.phar self-update --rollback| Analyzer | Checks | Focus Area |
|---|---|---|
| ConfigurationAnalyzer | 50+ | Core Magento settings, cache config, optimization flags |
| CacheAnalyzer | 12 | FPC, block cache, Varnish, Fastly CDN detection |
| DatabaseAnalyzer | 8 | Slow queries, indexes, foreign keys, SKU mismatches |
| FrontendAnalyzer | 10 | Bundle sizes, HTTP/2, Core Web Vitals, critical CSS |
| SecurityChecklistAnalyzer | 15 | Permissions, exposed files, security headers, admin URL |
| CodebaseAnalyzer | 6 | Large files, code quality, deprecated patterns |
| ModulesAnalyzer | 5 | Disabled modules, problematic extensions |
| LayoutCacheAnalyzer | 3 | Cacheable="false" blocks, layout issues |
| HttpProtocolAnalyzer | 7 | HTTP/2, HSTS, compression, keep-alive |
| APIRateLimitingAnalyzer | 4 | API security, rate limiting configuration |
| OpCacheAnalyzer | 8 | PHP OPcache, JIT compilation (PHP 8.3) |
| RedisEnhancedAnalyzer | 10 | Redis config, L2 cache, persistence, memory |
| ServerUptimeAnalyzer | 3 | System health, uptime monitoring |
| IndexersAnalyzer | 5 | Indexer config, search engine setup |
| VarnishPerformanceAnalyzer | 12 | Hit rates, ESI, grace mode, session cleanup |
The tool uses a sophisticated scoring algorithm that:
- Weights issues by priority: High (10 points), Medium (4 points), Low (1 point)
- Applies exponential penalties: Multiple issues compound performance impact
- Provides letter grades: A+ (95+) to F (<60)
- Tracks affected files: Know exactly where issues exist
- A+ (95-100): Exceptional - Production optimized
- A (90-94): Excellent - Minor optimizations possible
- B (80-89): Good - Several improvements recommended
- C (70-79): Fair - Notable performance gaps
- D (60-69): Poor - Significant issues present
- F (<60): Critical - Major performance problems
The tool generates executable shell scripts for common issues:
- Magento Configuration - Optimal settings commands
- Database Optimization - Query optimization scripts
- Frontend Cleanup - Asset optimization commands
- Security Hardening - Permission and security fixes
- Varnish Optimization - VCL snippets and configuration
# Generate comprehensive fix script
./m2-performance.phar review /var/www/magento2 --generate-fix
# Review generated script
cat performance_fixes_20240124_143022.sh
# Execute fixes (always review first!)
bash performance_fixes_20240124_143022.shExport analysis results for reporting and tracking:
# JSON - Full metadata for automation
./m2-performance.phar review /path/to/magento --export json
# HTML - Styled reports for stakeholders
./m2-performance.phar review /path/to/magento --export html
# CSV - Spreadsheet analysis
./m2-performance.phar review /path/to/magento --export csv
# Markdown - Documentation format
./m2-performance.phar review /path/to/magento --export md
# Multiple formats at once
./m2-performance.phar review /path/to/magento --export json,html,csvChoose the right profile for your needs:
# Basic - Quick essential checks
./m2-performance.phar review /path/to/magento --profile=basic
# Full - Comprehensive analysis (default)
./m2-performance.phar review /path/to/magento --profile=full
# Security - Focus on security issues
./m2-performance.phar review /path/to/magento --profile=security
# Custom - Specific analyzers only
./m2-performance.phar review /path/to/magento --analyzers=cache,database,redis# Using Docker
docker run -v /path/to/magento:/app \
ghcr.io/piotrsiejczuk/m2-performance:latest \
review /app
# Docker Compose
version: '3'
services:
performance-tool:
image: ghcr.io/piotrsiejczuk/m2-performance:latest
volumes:
- ./magento2:/app
command: review /app --watch# Run analyzers in parallel for faster results
./m2-performance.phar review /path/to/magento --asyncThe tool automatically detects development environments and adjusts recommendations accordingly:
- Skips production-only optimizations in dev mode
- Provides environment-specific suggestions
- Warns about settings that differ between environments
# Exit with error code if score below threshold
./m2-performance.phar review /path/to/magento --min-score=80
# GitHub Actions example
- name: Performance Analysis
run: |
./m2-performance.phar review . --export json --min-score=75
cat performance_analysis.json- Configuration: 10-15 suboptimal settings
- Caching: 3-5 cache configuration issues
- Database: 5-10 index/query problems
- Frontend: 8-12 optimization opportunities
- Security: 2-4 security recommendations
After implementing recommended fixes:
- Page Load Time: 20-35% reduction
- Server Response Time: 15-25% improvement
- Database Query Time: 30-40% optimization
- Cache Hit Rate: 10-20% increase
- PHP: 7.4, 8.0, 8.1, 8.2, 8.3
- Magento: 2.3.x, 2.4.0-2.4.7
- Adobe Commerce: 2.4.x Cloud & On-premise
- OS: Ubuntu 20.04/22.04, CentOS 7/8, RHEL 8/9, macOS
- Web Servers: Apache 2.4, Nginx 1.18+
- Cache: Redis 5.x/6.x/7.x, Varnish 6.x/7.x, Fastly CDN
We welcome contributions! Areas of focus:
- New Analyzers: GraphQL, PWA, B2B modules
- Cloud Platforms: AWS, GCP, Azure specific checks
- Fix Generators: Additional automated fixes
- Integrations: Monitoring tools, APM services
See CONTRIBUTING.md for guidelines.
- Changelog - Detailed version history
- Roadmap - Future development plans
- API Documentation - For custom integrations
- Analyzer Guide - Writing custom analyzers
GPL v3 License - see LICENSE file for details.
- Magento/Adobe Commerce Community
- Contributors and testers
- Performance optimization experts who provided feedback
- GitHub Issues: Bug reports and feature requests
- Email: piotr.siejczuk@gmail.com
- LinkedIn: Piotr Siejczuk
Made with β€οΈ for the Magento Community
If you find this tool helpful, please β star the repository!