{"id":4012,"date":"2014-05-28T13:54:52","date_gmt":"2014-05-28T11:54:52","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=4012"},"modified":"2014-05-28T13:57:35","modified_gmt":"2014-05-28T11:57:35","slug":"runbook-pid-2","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=4012","title":{"rendered":"Runbook PID"},"content":{"rendered":"<p><span style=\"color: #333333; font-family: Georgia; font-size: 10pt;\">Yesterday I was investigating runbooks consuming much memory. We had a number of runbooks running Powershell scripts and we could see that the Runbook server was almost out of memory. When looking in Task Manager we saw a lot of PolicyModule.exe processes, some using a lot of memory, but we had no mapping between running runbooks and running PolicyModule.exe process. We needed to figure out which script\/runbook is consuming all the memory.<br \/>\n<\/span><\/p>\n<p><span style=\"color: #333333; font-family: Georgia; font-size: 10pt;\">This can be done in a couple of different ways. One way is to publish Runbook Process ID for any activity in a runbook. To use Runbook Process ID you need to enable &#8220;Show common Published Data&#8221; in the Published Data dialog box. The published data will show you the PID for the PolicyModule.exe process.<br \/>\n<\/span><\/p>\n<p><span style=\"color: #333333; font-family: Georgia; font-size: 10pt;\">Another way to get the PID is to look in the Orchestrator database. The following SQL query will show you runbook name, start and stop time and process ID.<br \/>\n<\/span><\/p>\n<blockquote><p>\nSELECT POLICYINSTANCES.TimeStarted, POLICYINSTANCES.TimeEnded, POLICYINSTANCES.ProcessID, POLICYINSTANCES.SeqNumber, POLICIES.Name<br \/>\nFROM POLICYINSTANCES INNER JOIN POLICIES ON POLICYINSTANCES.PolicyID = POLICIES.UniqueID<br \/>\nORDER BY POLICYINSTANCES.TimeStarted DESC\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2014\/05\/052814_1154_RunbookPID1.png\" alt=\"\" \/><span style=\"color: #333333; font-family: Georgia; font-size: 10pt;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I was investigating runbooks consuming much memory. We had a number of runbooks running Powershell scripts and we could see that the Runbook server was almost out of memory. When looking in Task Manager we saw a lot of PolicyModule.exe processes, some using a lot of memory, but we had no mapping between running &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=4012\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[60],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4012"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4012"}],"version-history":[{"count":5,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4012\/revisions"}],"predecessor-version":[{"id":4017,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4012\/revisions\/4017"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4012"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}