Posts

Showing posts from June, 2020

Load testing with artillery

So you need to load test an application to find its maximum capacity? This set of basic scripts will get you started. Install artillery with: npm install -g artillery … assuming you already have npm installed. The premium version of artillery comes with all sorts of fancy features, such as the ability to run distributed load tests. But the free version is more than enough to do a basic set of tests. As a word of warning, if you’re running this against a production system, you’ll want to schedule it to run out of hours. loadtest.ps1 Npm only allows a certain amount of CPU to be in use by a process before it starts throwing warnings out. So to get around this, we can spawn multiple processes using this script: param ( [int] $clients = 1 ) <# .SYNOPSIS Run load tests .PARAMETER clients Runs this many concurrent load tests .EXAMPLE .\loadtest.ps1 This will run the load test with a single client .EXAMPLE .\loadtest.ps1 -clients 3 This will run the load test with three cl

Taking a memory dump of a w3wp process

Taking a memory dump of a w3wp process Taking a memory dump of an IIS worker process in a live system can be problematic, as IIS will kill the process if it has been suspended for more than 60 seconds. Only use these steps if your application is on a high availability cluster, else you’ll take your app down! copy sysinternals procdump.exe and pssuspend.exe to target machine create powershell file with: $iispid = Get-Process svchost | ? { $_ . modules . ModuleName -eq "iisw3adm.dll" } | Select - First 1 - ExpandProperty Id $workerpid = Get-Process w3wp | Sort ws - Descending | Select - First 1 - ExpandProperty Id & ".\pssuspend.exe" $iispid Write-Output "Creating memory dump for w3wp PID $workerpid " & ".\procdump.exe" - ma $workerpid & ".\pssuspend.exe" $iispid - r (taken from stackoverflow ) 3) check the w3wp process has reached the high level of RAM usage that you’re intending to