examples.jsonโข11 kB
[
{
"input": {
"task_title": "Disk Space Crisis Management",
"task_objective": "Identify and resolve critical disk space issues on production servers",
"task_context": "Our production web servers are experiencing performance degradation. Initial investigation points to low disk space. We need to quickly identify the root cause and free up space without affecting running services.",
"os_version": "Windows Server 2022",
"system_architecture": "x64",
"user_context": "Senior SRE",
"admin_status": "Yes",
"powershell_version": "7.3.4",
"primary_goal": "Free up at least 20% disk space on all drives",
"success_criteria_1": "Identify largest files and directories",
"success_criteria_2": "Provide safe cleanup recommendations",
"success_criteria_3": "Suggest long-term monitoring solution",
"tech_requirement_1": "Must not disrupt running services",
"tech_requirement_2": "Preserve all log files less than 7 days old",
"tech_requirement_3": "Generate a cleanup report",
"tech_constraint_1": "No system restarts allowed during business hours",
"tech_constraint_2": "Must maintain 30 days of IIS logs",
"tech_constraint_3": "SQL Server tempdb must not be modified",
"business_constraint_1": "Zero downtime during cleanup",
"business_constraint_2": "Compliance with data retention policies",
"related_systems": "IIS, SQL Server, File Servers",
"dependencies": "Enterprise monitoring system, Backup solutions",
"previous_attempts": "Tried Windows Disk Cleanup, but it didn't free enough space",
"stakeholders": "CTO, DevOps Team, Security Team",
"special_instruction_1": "Highlight any security concerns in findings",
"special_instruction_2": "Prioritize cleanup of non-production environments first",
"special_instruction_3": "Include rollback steps for each cleanup action",
"metric_1": "Percentage of disk space freed",
"metric_2": "Number of files cleaned up",
"metric_3": "Time taken to complete cleanup",
"target_value": "20%",
"question_1": "Are there any specific compliance requirements we should consider",
"question_2": "Should we implement automated cleanup for temporary files",
"question_3": "Who should approve the cleanup plan before execution"
},
"output": "# ๐จ Disk Space Emergency Response Plan\n\n## ๐ต๏ธโโ๏ธ Current State Analysis\n```powershell\n# Get disk space overview (run as admin for full details)\nGet-Volume | Where-Object {$_.DriveType -eq 'Fixed'} | \nSelect-Object DriveLetter, \n @{Name='Size(GB)';Expression={[math]::Round($_.Size/1GB, 2)}}, \n @{Name='Free(GB)';Expression={[math]::Round($_.SizeRemaining/1GB, 2)}},\n @{Name='%Free';Expression={[math]::Round(($_.SizeRemaining/$_.Size)*100, 2)}}} |\nSort-Object -Property '%Free' -Descending |\nFormat-Table -AutoSize\n```
```
## ๐ Deep Dive: Space Hogs
```powershell
# Find large directories (top 10)
$targetDrive = "C:"
Get-ChildItem -Path $targetDrive -Directory |
ForEach-Object {
$size = (Get-ChildItem $_.FullName -Recurse -File | Measure-Object -Property Length -Sum).Sum
[PSCustomObject]@{
Directory = $_.FullName
'Size(GB)' = [math]::Round($size/1GB, 2)
}
} | Sort-Object 'Size(GB)' -Descending | Select-Object -First 10
```
## ๐งน Safe Cleanup Recommendations
### 1. Windows Update Cleanup (Safe)
```powershell
# Requires admin rights
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
```
### 2. Temporary Files
```powershell
# User temp files
Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
# Windows temp files
Remove-Item -Path "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue
```
### 3. IIS Logs (After 30 days)
```powershell
# Keep last 30 days of logs
Get-ChildItem -Path "C:\inetpub\logs\LogFiles" -Recurse |
Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} |
Remove-Item -Force -Recurse
```
## ๐ Monitoring Solution
```powershell
# Create a scheduled task to monitor disk space
$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-File "C:\Scripts\Monitor-DiskSpace.ps1"'
$trigger = New-ScheduledTaskTrigger -Daily -At 2am
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "Disk Space Monitor" -Description "Monitors disk space and sends alerts"
```
## ๐ก๏ธ Safety Checks
```powershell
# Always test with -WhatIf first
Remove-Item -Path "C:\Windows\Temp\*" -WhatIf
# Create restore point before major changes
Checkpoint-Computer -Description "Pre-disk-cleanup" -RestorePointType "MODIFY_SETTINGS"
```
## ๐ Next Steps
1. Review the output and estimated space savings
2. Test cleanup in staging environment
3. Schedule production cleanup during maintenance window
4. Implement monitoring to prevent future issues
## โ ๏ธ Important Notes
- Always have a verified backup before cleanup
- Monitor system stability after cleanup
- Document all changes for audit purposes"
},
{
"input": {
"task_title": "Performance Tuning for High-Traffic Web Servers",
"task_objective": "Optimize Windows Server 2022 for high-traffic web applications",
"task_context": "Our e-commerce platform is experiencing slowdowns during peak traffic. We need to optimize Windows Server settings to handle 10,000+ concurrent users while maintaining sub-second response times.",
"os_version": "Windows Server 2022 Datacenter",
"system_architecture": "x64",
"user_context": "DevOps Engineer",
"admin_status": "Yes",
"powershell_version": "7.3.4",
"primary_goal": "Reduce average response time by 40%",
"success_criteria_1": "Achieve sub-500ms response times under load",
"success_criteria_2": "Maintain <70% CPU usage during peak",
"success_criteria_3": "Eliminate HTTP 503 errors",
"tech_requirement_1": "IIS 10 optimization",
"tech_requirement_2": "TCP/IP stack tuning",
"tech_requirement_3": "Application pool optimization",
"tech_constraint_1": "Cannot change application code",
"tech_constraint_2": "Must maintain backward compatibility",
"tech_constraint_3": "Security standards must not be compromised",
"business_constraint_1": "Zero downtime deployment required",
"business_constraint_2": "Must work within existing hardware",
"related_systems": "IIS, SQL Server, Redis, CDN",
"dependencies": "ARR, URL Rewrite, Application Request Routing Cache",
"previous_attempts": "Increased VM resources, but saw minimal improvement",
"stakeholders": "CTO, Development Team, Business Owners",
"special_instruction_1": "Include before/after metrics",
"special_instruction_2": "Document all changes for rollback",
"special_instruction_3": "Provide monitoring recommendations",
"metric_1": "Requests per second",
"metric_2": "Average response time",
"metric_3": "Error rate",
"target_value": "<500ms response time",
"question_1": "What's the current peak traffic pattern",
"question_2": "Are there any specific pages with performance issues",
"question_3": "What monitoring tools are currently in place"
},
"output": "# ๐ Windows Server 2022 Performance Optimization Guide
## ๐ Current Performance Baseline
```powershell
# Check current IIS performance counters
Get-Counter '\Web Service(_Total)\Current Connections',
'\Web Service(_Total)\Connection Attempts/sec',
'\Web Service(_Total)\Get Requests/sec',
'\Process(w3wp)\% Processor Time',
'\Memory\Available MBytes' -SampleInterval 5 -MaxSamples 3
```
## ๐ ๏ธ Optimization Steps
### 1. IIS Application Pool Tuning
```powershell
# Set optimal application pool settings
Import-Module WebAdministration
Set-ItemProperty -Path 'IIS:\\AppPools\\YourAppPool' -Name queueLength -Value 5000
Set-ItemProperty -Path 'IIS:\\AppPools\\YourAppPool' -Name recycling.periodicRestart.time -Value '00:00:00'
Set-ItemProperty -Path 'IIS:\\AppPools\\YourAppPool' -Name processModel.idleTimeout -Value '00:00:00'
Set-ItemProperty -Path 'IIS:\\AppPools\\YourAppPool' -Name processModel.pingEnabled -Value $false
```
### 2. Kernel-Mode Caching
```powershell
# Enable kernel-mode caching
Set-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' \
-Filter 'system.webServer/staticContent' \
-Name clientCache \
-Value @{cacheControlMode='UseMaxAge'; cacheControlMaxAge='7.00:00:00'}
```
### 3. TCP/IP Stack Tuning
```powershell
# Optimize TCP/IP parameters (run as admin)
netsh int tcp set global autotuninglevel=restricted
netsh int tcp set global chimney=disabled
netsh int tcp set global rss=enabled
netsh int tcp set global netdma=disabled
# Increase dynamic port range
netsh int ipv4 set dynamicport tcp start=10000 num=55535
```
### 4. HTTP.sys Registry Tuning
```powershell
# Adjust HTTP.sys settings
Set-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\HTTP\\Parameters' -Name 'UriEnableCache' -Value 1
Set-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\HTTP\\Parameters' -Name 'UriMaxUriBytes' -Value 262144
Set-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\HTTP\\Parameters' -Name 'UriScavengerPeriod' -Value 120
```
## ๐ Monitoring & Validation
```powershell
# Create performance data collector
$DataCollectorSet = New-Object -ComObject PLA.DataCollectorSet
$DataCollectorSet.DisplayName = 'IIS_Performance_Monitor'
$DataCollectorSet.Duration = '01:00:00' # 1 hour
# Add performance counters
$DataCollector = $DataCollectorSet.DataCollectors.CreateDataCollector(0)
$DataCollector.FileName = 'IIS_Perf_'+ (Get-Date -Format 'yyyyMMdd_HHmmss') + '.blg'
$DataCollector.FileNameFormat = 1 # yyyyMMDD|hhmmss
$DataCollector.SampleInterval = 5 # seconds
$Counters = @(
'\\Web Service(_Total)\\Current Connections',
'\\Web Service(_Total)\\Connection Attempts/sec',
'\\Process(w3wp)\\% Processor Time',
'\\Memory\\Available MBytes',
'\\Network Interface(*)\\Bytes Total/sec',
'\\System\\Processor Queue Length'
)
$DataCollector.PerformanceCounters = $Counters
$DataCollectorSet.DataCollectors.Add($DataCollector)
$DataCollectorSet.Commit('IIS_Performance_Monitor', $null, 0x0003) # 0x0003 = Create new
$DataCollectorSet.Start($false)
```
## ๐ Deployment Strategy
1. **Staging Test**: Apply changes to staging first
2. **Canary Release**: Roll out to 10% of production servers
3. **Full Deployment**: After 24 hours of stability
4. **Rollback Plan**: Documented for each change
## ๐ Verification Steps
1. Run load tests using Apache Bench or JMeter
2. Monitor for memory leaks
3. Verify application functionality
4. Check for any security implications
## ๐ Expected Improvements
- 30-40% reduction in response times
- Increased request throughput
- Better resource utilization
- More stable performance under load"
}
]