3.8 KiB
3.8 KiB
TechIRCd Stress Testing Tool
A comprehensive Python-based stress testing tool for TechIRCd IRC server.
Features
- Configurable Test Scenarios: JSON-based configuration
- Multiple Test Types: Connection tests, message flooding, command spam
- Gradual or Mass Operations: Connect/disconnect clients gradually or all at once
- Real-time Statistics: Connection counts, message statistics, error tracking
- Logging: Detailed logging to file and console
- SSL Support: Test both plain and SSL connections
Requirements
pip3 install asyncio # Usually included with Python 3.7+
Usage
Run All Test Scenarios
python3 stress_test.py
Run Specific Scenario
python3 stress_test.py --scenario "Basic Connection Test"
Use Custom Configuration
python3 stress_test.py --config my_config.json
Configuration
Edit stress_config.json to customize tests:
Server Settings
{
"server": {
"host": "localhost", // IRC server hostname
"port": 6667, // IRC server port
"ssl": false, // Use SSL connection
"ssl_port": 6697, // SSL port
"nick_prefix": "StressBot", // Prefix for bot nicknames
"auto_join_channels": ["#test"] // Channels to auto-join
}
}
Test Scenarios
Each scenario supports:
client_count: Number of concurrent clientsduration: How long to run the test (seconds)connect_gradually: Connect clients one by one vs all at onceconnect_delay: Delay between gradual connectionsdisconnect_gradually: Disconnect gradually vs all at onceactivities: List of activities to perform during test
Activity Types
- channel_flood: Flood channels with messages
- private_flood: Send private messages between clients
- join_part_spam: Rapid JOIN/PART operations
- nick_change_spam: Rapid nickname changes
- random_commands: Send random IRC commands
Pre-configured Test Scenarios
-
Basic Connection Test (10 clients, 30s)
- Simple connection and registration test
-
Mass Connection Stress (50 clients, 60s)
- Many simultaneous connections with channel flooding
-
Gradual Connection Test (30 clients, 45s)
- Gradual connection buildup with private messaging
-
Heavy Activity Test (25 clients, 90s)
- Multiple activity types running simultaneously
-
Nick Change Spam (15 clients, 30s)
- Rapid nickname change testing
-
Channel Chaos Test (20 clients, 60s)
- JOIN/PART spam with message flooding
-
Maximum Load Test (100 clients, 120s)
- Push server to maximum capacity
Monitoring
- Real-time logs: Monitor progress in console
- Log file: Detailed logs saved to
stress_test.log - Statistics: Connection counts, message statistics, error tracking
Example Output
2025-09-07 12:00:00 - INFO - Starting scenario: Basic Connection Test
2025-09-07 12:00:00 - INFO - Clients: 10, Duration: 30s
2025-09-07 12:00:00 - INFO - Mass connecting 10 clients...
2025-09-07 12:00:01 - INFO - Connected 10/10 clients
2025-09-07 12:00:03 - INFO - Registered 10/10 clients
2025-09-07 12:00:33 - INFO - Stats: 10 connected, 10 registered, 0 messages sent
2025-09-07 12:00:35 - INFO - Scenario Basic Connection Test completed
Tips for Testing
- Start Small: Begin with basic connection test
- Monitor Resources: Watch TechIRCd memory/CPU usage
- Check Logs: Review both stress test and TechIRCd logs
- Gradual Increase: Increase client counts gradually
- Test Different Scenarios: Each scenario tests different aspects
Troubleshooting
- Connection Refused: Make sure TechIRCd is running
- SSL Errors: Check SSL configuration in both TechIRCd and test config
- Memory Issues: Reduce client count or test duration
- Python Errors: Ensure Python 3.7+ with asyncio support