<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Kill Hung Sessions Automatically in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784381#M23497</link>
    <description>Under normal operation I think SAS Studio will terminate the compute session when their session with the user ends, are you seeing a lot of these orphaned sessions out there? I'm concerned terminating any compute server older than 4 hours could result in legitimate sessions being terminated.</description>
    <pubDate>Mon, 06 Dec 2021 20:18:19 GMT</pubDate>
    <dc:creator>gwootton</dc:creator>
    <dc:date>2021-12-06T20:18:19Z</dc:date>
    <item>
      <title>Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784318#M23489</link>
      <description>&lt;P&gt;Yesterday we had a user reach out that was able to login to our Viya environment ok, but could not submit code. She would click run and then nothing would hang. I logged in and verified services a status check and then healthcheck and everything seemed good. I wasn't really sure what to do, if it was simply a problem with her code or something else. I then responded and asked her to run PROC SETINIT; RUN; She said that would run the first time she logged into a new session, but if she ran it a second time it would do the same thing. Her mentioning sessions made me wonder how many were open. I did a ps -aux and grepped for her user id and sure enough there was an old session from December 2 still open. I killed the two pid's from back then. Had her run her sas code again and everything was working again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone have any automated or better fixes for that type of scenario?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 14:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784318#M23489</guid>
      <dc:creator>five</dc:creator>
      <dc:date>2021-12-06T14:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784351#M23492</link>
      <description>&lt;P&gt;Start with a clear definition of "what constitutes a hung session on the operating system level". You may find that this is not as clear-cut as it looks at first.&lt;/P&gt;
&lt;P&gt;One thing that is easy: kill all remaining sessions at a given time during the night.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 17:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784351#M23492</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-06T17:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784363#M23494</link>
      <description>&lt;P&gt;Yea, I am no expert. Why I was asking the community if anyone had an idea of a good way to remedy this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have come up with this code, that I am thinking about running once an hour:&lt;/P&gt;
&lt;PRE&gt;ps -eo pid,etimes,comm,group | awk '{if ($3 ~ /compsrv/ &amp;amp;&amp;amp; $4 ~ /aduser/ &amp;amp;&amp;amp; $2&amp;gt;14400) print $1}'&lt;/PRE&gt;
&lt;P&gt;Returns the process id of our adusers that have compsrv running for more than 4 hours. I don't know if there is a better way to do it. But it's an idea I have at the moment, just to pipe those to kill.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 19:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784363#M23494</guid>
      <dc:creator>five</dc:creator>
      <dc:date>2021-12-06T19:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784381#M23497</link>
      <description>Under normal operation I think SAS Studio will terminate the compute session when their session with the user ends, are you seeing a lot of these orphaned sessions out there? I'm concerned terminating any compute server older than 4 hours could result in legitimate sessions being terminated.</description>
      <pubDate>Mon, 06 Dec 2021 20:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784381#M23497</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-12-06T20:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784386#M23498</link>
      <description>&lt;P&gt;No, I've only been made aware one time. The user said it had happened before. And the initial email from the professor said multiple students were having the same issue, but I only had an exchange with one student and hers was the only process that was 4 days old.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the moment I have a few users with sessions greater than 4 hours. I am just going to keep an eye on it and see how it transpires through the week. I could always increase the number to 24 hours or something like that.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784386#M23498</guid>
      <dc:creator>five</dc:creator>
      <dc:date>2021-12-06T20:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784505#M23499</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154090"&gt;@five&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please keep in mind killing orphaned processed on their own sometime are not enough, you'll need to cleanup the temporary data these processes leave behind.&lt;/P&gt;
&lt;P&gt;In a typical normal SAS process termination, SAS&amp;nbsp;would remove all the temporary files that particular session had created as it terminates/shut downs.&lt;/P&gt;
&lt;P&gt;Therefore,&amp;nbsp;for the orphaned process that being manually terminated by user intervention, its temporary files needs to be deleted as well!&lt;/P&gt;
&lt;P&gt;Have a look at the SAS cleanwork utility&lt;/P&gt;
&lt;P&gt;- &lt;A title="SAS Usage Utilities: cleanwork" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/n13ozwpq7az8v6n1s77r8c2zp9d1.htm" target="_blank" rel="noopener"&gt;Linux&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- &lt;A title="Cleanwork Utility" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/n0j43jculk2kasn1qh5h12f3kl3z.htm" target="_blank" rel="noopener"&gt;Windows&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 11:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784505#M23499</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2021-12-07T11:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Kill Hung Sessions Automatically</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784514#M23500</link>
      <description>&lt;P&gt;Yea I did run that bash script afterward. If it gives any feedback, when it does something then it must not have done anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;sudo /opt/sas/spre/home/SASFoundation/utilities/bin/cleanwork /saswork
Running as user root on hostname web01.server.edu&lt;/PRE&gt;
&lt;P&gt;I have run it a few times and it either displays sessions still running or returns nothing like above. And there have been times where ps aux will show sessions still running and there will be nothing listed in /saswork as well.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 12:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Kill-Hung-Sessions-Automatically/m-p/784514#M23500</guid>
      <dc:creator>five</dc:creator>
      <dc:date>2021-12-07T12:59:28Z</dc:date>
    </item>
  </channel>
</rss>

