Claude Code CommandPerformance25 installs

System Behavior Simulator

Install with the Claude Code Templates CLI
$ npx claude-code-templates@latest --command="performance/system-behavior-simulator" --yes

Requires Claude Code. The command adds this command to your project's .claudedirectory — nothing runs on ToolZip's servers.

What's inside this command

Component source (preview)

System Behavior Simulator

Simulate system performance under various loads with capacity planning, bottleneck identification, and optimization strategies.

Instructions

You are tasked with creating comprehensive system behavior simulations to predict performance, identify bottlenecks, and optimize capacity planning. Follow this approach: $ARGUMENTS

1. Prerequisites Assessment

Critical System Context Validation:
  • System Architecture: What type of system are you simulating behavior for?
  • Performance Goals: What are the target performance metrics and SLAs?
  • Load Characteristics: What are the expected usage patterns and traffic profiles?
  • Resource Constraints: What infrastructure and budget limitations apply?
  • Optimization Objectives: What aspects of performance are most critical to optimize?

If context is unclear, guide systematically:
Missing System Architecture:
"What type of system needs behavior simulation?
- Web Application: User-facing application with HTTP traffic patterns
- API Service: Backend service with programmatic access patterns
- Data Processing: Batch or stream processing with throughput requirements
- Database System: Data storage and query processing optimization
- Microservices: Distributed system with inter-service communication

Please specify system components, technology stack, and deployment architecture."

Missing Performance Goals:
"What performance objectives need to be met?
- Response Time: Target latency for user requests (p50, p95, p99)
- Throughput: Requests per second or transactions per minute
- Availability: Uptime targets and fault tolerance requirements
- Scalability: User growth and load handling capabilities
- Resource Efficiency: CPU, memory, storage, and network optimization"

2. System Architecture Modeling

Systematically map system components and interactions:

Component Architecture Framework

System Component Mapping:

Application Layer:
- Frontend Components: User interfaces, single-page applications, mobile apps
- Application Services: Business logic, workflow processing, API endpoints
- Background Services: Scheduled jobs, message processing, batch operations
- Integration Services: External API calls, webhook handling, data synchronization

Data Layer:
- Primary Databases: Transactional data storage and query processing
- Cache Systems: Redis, Memcached, CDN, and application-level caching
- Message Queues: Asynchronous communication and event processing
- Search Systems: Elasticsearch, Solr, or database search capabilities

Infrastructure Layer:
- Load Balancers: Traffic distribution and health checking
- Web Servers: HTTP request handling and static content serving
- Application Servers: Dynamic content generation and business logic
- Network Components: Firewalls, VPNs, and traffic routing

Interaction Pattern Modeling

System Interaction Analysis:

Synchronous Interactions:
- Request-Response: Direct API calls and database queries
- Service Mesh: Inter-service communication with service discovery
- Database Transactions: ACID compliance and locking mechanisms
- External API Calls: Third-party service dependencies and timeouts

Asynchronous Interactions:
- Message Queues: Pub/sub patterns and event-driven processing
- Event Streams: Real-time data processing and analytics
- Background Jobs: Scheduled tasks and delayed processing
- Webhooks: External system notifications and callbacks

Data Flow Patterns:
- Read Patterns: Query optimization and caching strategies
- Write Patterns: Data ingestion and consistency management
- Batch Processing: ETL operations and data pipeline processing
- Real-time Processing: Stream processing and live analytics

3. Load Modeling Framework

Create realistic traffic and usage pattern simulations:

Traffic Pattern Analysis

Load Characteristics Modeling:

User Behavior Patterns:
- Daily Patterns: Peak hours, lunch dips, overnight minimums
- Weekly Patterns: Weekday vs weekend usage variations
- Seasonal Patterns: Holiday traffic, business cycle fluctuations
- Event-Driven Spikes: Marketing campaigns, viral content, news events

Request Distribution:
- Geographic Distribution: Multi-region traffic and latency patterns
- Device Distribution: Mobile vs desktop vs API usage patterns
- Feature Distribution: Popular vs niche feature usage ratios
- User Type Distribution: New vs returning vs power user behaviors

Load Volume Scaling:
- Concurrent Users: Simultaneous active sessions and request patterns
- Request Rate: Transactions per second with burst capabilities
- Data Volume: Payload sizes and data transfer requirements
- Connection Patterns: Session duration and connection pooling

Synthetic Load Generation

Load Testing Scenario Framework:

Baseline Load Testing:
- Normal Traffic: Typical daily usage patterns and request volumes
- Sustained Load: Constant traffic over extended periods
- Gradual Ramp: Slow traffic increase to identify scaling points
- Steady State: Stable load for performance baseline establishment

Stress Testing:
- Peak Load: Maximum expected traffic during busy periods
- Capacity Testing: System limits and breaking point identification
- Spike Testing: Sudden traffic increases and recovery behavior
- Volume Testing: Large data sets and high-throughput scenarios

Resilience Testing:
- Failure Scenarios: Component outages and degraded service behavior
- Recovery Testing: System restoration and performance recovery
- Chaos Engineering: Random failure injection and system adaptation
- Disaster Simulation: Major outage scenarios and business continuity

4. Performance Modeling Engine

Create comprehensive system performance predictions:

Performance Metric Framework

Multi-Dimensional Performance Analysis:

Response Time Metrics:
- Request Latency: End-to-end response time measurement
- Processing Time: Application logic execution duration
- Database Query Time: Data access and retrieval performance
- Network Latency: Communication overhead and bandwidth utilization

Throughput Metrics:
- Requests per Second: HTTP request handling capacity
- Transactions per Minute: Business operation completion rate
- Data Processing Rate: Batch job and stream processing throughput
- Concurrent User Capacity: Simultaneous session handling capability

Resource Utilization Metrics:
- CPU Usage: Processing power consumption and efficiency
- Memory Usage: RAM allocation and garbage collection impact
- Storage I/O: Disk read/write performance and capacity
- Network Bandwidth: Data transfer rates and congestion management

Quality Metrics:
- Error Rates: Failed requests and transaction failures
- Availability: System uptime and service reliability
- Consistency: Data integrity and transaction isolation
- Security: Authentication, authorization, and data protection overhead

Performance Prediction Modeling

Predictive Performance Framework:

Analytical Models:
- Queueing Theory: Wait time and service rate mathematical modeling
- Little's Law: Relationship between concurrency, throughput, and latency
- Capacity Planning: Resource requirement forecasting and optimization
- Bottleneck Analysis: System constraint identification and resolution

Simulation Models:
- Discrete Event Simulation: System behavior modeling with event queues
- Monte Carlo Simulation: Probabilistic performance outcome analysis
- Load Testing Data: Historical performance pattern extrapolation
- Machine Learning: Pattern recognition and predictive analytics

Hybrid Models:
- Analytical + Empirical: Mathematical models calibrated with real data
- Multi-Layer Modeling: Component-level models aggregated to system level
- Dynamic Adaptation: Models that adjust based on real-time performance
- Scenario-Based: Different models for different load and usage patterns

5. Bottleneck Identification System

Systematically identify and analyze performance constraints:

Bottleneck Detection Framework

Performance Constraint Analysis:

CPU Bottlenecks:
- High CPU Utilization: Processing-intensive operations and algorithms
- Thread Contention: Locking and synchronization overhead
- Context Switching: Excessive thread creation and management
- Inefficient Algorithms: Poor time complexity and optimization opportunities

Memory Bottlenecks:
- Memory Leaks: Gradual memory consumption and garbage collection pressure
- Large Object Allocation: Memory-intensive operations and caching strategies
- Memory Fragmentation: Allocation patterns and memory pool management
- Cache Misses: Application and database cache effectiveness

I/O Bottlenecks:
- Database Performance: Query optimization and index effectiveness
- Disk I/O: Storage access patterns and disk performance limits
- Network I/O: Bandwidth limitations and latency optimization
- External Dependencies: Third-party service response times and reliability

Application Bottlenecks:
- Blocking Operations: Synchronous calls and thread pool exhaustion
- Inefficient Code: Poor algorithms and unnecessary processing
- Resource Contention: Shared resource access and locking mechanisms
- Configuration Issues: Suboptimal settings and parameter tuning

Root Cause Analysis

  • Performance profiling and trace analysis
  • Correlation analysis between metrics and bottlenecks
  • Historical pattern recognition and trend analysis
  • Comparative analysis across different system configurations

6. Optimization Strategy Generation

Create systematic performance improvement approaches:

Performance Optimization Framework

Multi-Level Optimization Strategies:

Code-Level Optimizations:
- Algorithm Optimization: Improved time and space complexity
- Database Query Optimization: Index usage and query plan improvement
- Caching Strategies: Application, database, and CDN caching
- Asynchronous Processing: Non-blocking operations and parallelization

Architecture-Level Optimizations:
- Horizontal Scaling: Load distribution across multiple instances
- Vertical Scaling: Resource allocation and capacity increases
- Caching Layers: Multi-tier caching and cache invalidation strategies
- Database Sharding: Data partitioning and distributed storage

Infrastructure-Level Optimizations:
- Auto-Scaling: Dynamic resource allocation based on demand
- Load Balancing: Traffic distribution and health checking optimization
- CDN Implementation: Geographic content distribution and edge caching
- Network Optimization: Bandwidth allocation and latency reduction

System-Level Optimizations:
- Monitoring and Alerting: Performance visibility and proactive issue detection
- Capacity Planning: Resource forecasting and growth accommodation
- Disaster Recovery: Backup strategies and failover mechanisms
- Security Optimization: Performance-aware security implementation

Cost-Benefit Analysis

  • Performance improvement quantification and measurement
  • Infrastructure cost implications and budget optimization
  • Development effort estimation and resource allocation
  • ROI calculation for different optimization strategies

7. Capacity Planning Integration

Connect performance insights to infrastructure and resource planning:

Capacity Planning Framework

```

Systematic Capacity Management:

Growth Projection:

  • User Growth: Customer acquisition and usage pattern evolution
  • Data Growth: Storage requirements and processing volume increases
  • Feature Growth: New capabilities and functionality impacts
  • Geographic Growth: Multi-region expansion and latency requirements

Resource Forecasting:

  • Compute Resources: CPU, memory, and processing power requirements
  • Storage Resources: Database, file system, and backup capacity needs
  • Network Resources: Bandwidth, connectivity, and latency optimization
  • Human Resources: Team scaling and expertise development needs

Scaling Strategy:

  • Horizontal Scaling: Instance multiplication and load distribution
  • Vertical Scaling

Preview truncated. View the full source on GitHub →

Type
Command
Category
Performance
Installs
25
Source
GitHub ↗

Related Claude Code Commands

Catalog data and component content are sourced from the open-source davila7/claude-code-templates project (MIT license). ToolZip curates the listing and writes original descriptions; every component links back to its original source. Claude Code is a product of Anthropic. ToolZip is an independent catalog and is not affiliated with or endorsed by Anthropic.