Architecting, installing and maintaining your SAS environment

SAS Administrator : how to find the PID of a specific WORK Folder

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

SAS Administrator : how to find the PID of a specific WORK Folder

Hi,

 

I am an administrator of a sas platform with dozens of TeraBytes accessible to users. Some users do not master their processing and fulfill the mutualized WORK space, endangering the Platform. In this case, killing the sessions of these users is essential but I want to kill only the session that abnormally fills the WORK.

 

So, my question is simple, how to know which pid is associated with a specific directory of the mutualized WORK ?

Thank you for your answers,

Gaetan


Accepted Solutions
Solution
‎12-02-2016 06:26 AM
Super User
Posts: 7,773

Re: SAS Administrator : how to find the PID of a specific WORK Folder


Gaetan wrote:

I add some information to my first message, a little light:
- we use a Linux system with the SAS Grid module

- we do not apply quota

 

I don't manage to make the link between WORK folder and PID :

SAS_work3F3000003EBC_xxxxxxx

 

With the tool "Easy Clculation" :

3F3000003EBC => 69475390996156

 

Where is my mistake ?

 

Gaetan


Use only the part of the directory name after the sequence of 0's, in your case 3EBC. That's what I meant by "the end of the directory name immediately before the _hostname". You should have a process 16060 (if it's not there, run the cleanwork utility; the directory should be gone after that)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Trusted Advisor
Posts: 1,312

Re: SAS Administrator : how to find the PID of a specific WORK Folder

[ Edited ]

Hello @Gaetan,

 

I am sure that the administration of big platforms is a challenge. Good for us, there are tools that are intended to make our job easier.

 

On one side, there are system tools that can help a lot. On windows I like Process Explorer, and on Linux htop works like a charm. As soon as you search for an specific folder or item or file, it will give you the pid and other items related to the process.

 

Also, @boemskats is providing an excellent tool for monitoring all SAS processes, the Enterprise Session Monitor ( https://boemskats.com/esm/ ) tool that I am having great experiences during this last year. Nice thing of this tool, is that it helps with monitoring many aspects of SAS sessions, identify the type of the sas session, and to analyse performance, bottle necks, and even errors from logs.

 

PS. SAS Environment Manager is supposed to help with this as well, and it comes with your SAS deployments. Some people say it is able to provide this information. But, so far, I did not managed to get anyone giving me the technical details. maybe a communities colleage or SAS Technical Support might be able to help with that.

 

Is this helping you a bit?

 

Best regards,

Juan

Contributor
Posts: 20

Re: SAS Administrator : how to find the PID of a specific WORK Folder

Posted in reply to JuanS_OCS

Thank you form your anwer.

 

Unforunately, we are using SAS 9.2 version and SAS Environmemnt Manager is not available.

 

Gaetan

Super User
Posts: 7,773

Re: SAS Administrator : how to find the PID of a specific WORK Folder

[ Edited ]

The PID is coded hexadecimally into the directory name. Take the end of the directory name right before the _hostname, and decode that (ie with https://www.easycalculation.com/hex-converter.php).

 

But I'd tackle the problem in a proactive way: set reasonable quotas for users in the WORK location. That way misbehaving processes run into "file is full and maybe damaged" messages long before a showstopper (that affects all users) happens.

 

PS and make use of the cleanwork utility to remove all orphaned WORK and UTILLOC directories (where the processes have died without cleaning up properly)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 20

Re: SAS Administrator : how to find the PID of a specific WORK Folder

Posted in reply to KurtBremser

I add some information to my first message, a little light:
- we use a Linux system with the SAS Grid module

- we do not apply quota

 

I don't manage to make the link between WORK folder and PID :

SAS_work3F3000003EBC_xxxxxxx

 

With the tool "Easy Clculation" :

3F3000003EBC => 69475390996156

 

Where is my mistake ?

 

Gaetan

Solution
‎12-02-2016 06:26 AM
Super User
Posts: 7,773

Re: SAS Administrator : how to find the PID of a specific WORK Folder


Gaetan wrote:

I add some information to my first message, a little light:
- we use a Linux system with the SAS Grid module

- we do not apply quota

 

I don't manage to make the link between WORK folder and PID :

SAS_work3F3000003EBC_xxxxxxx

 

With the tool "Easy Clculation" :

3F3000003EBC => 69475390996156

 

Where is my mistake ?

 

Gaetan


Use only the part of the directory name after the sequence of 0's, in your case 3EBC. That's what I meant by "the end of the directory name immediately before the _hostname". You should have a process 16060 (if it's not there, run the cleanwork utility; the directory should be gone after that)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 20

Re: SAS Administrator : how to find the PID of a specific WORK Folder

Posted in reply to KurtBremser

good, i have the right pid for my WORK folder.

It's Ok now, I will be able to control and ... end SAS sessions easily.

Thank you very much Kurt !

Frequent Contributor
Posts: 106

Re: SAS Administrator : how to find the PID of a specific WORK Folder

@Gaetan,

 

I had some free time a couple of weekends ago, and your post inspired me to write a slightly more elegant solution to this problem. I got a bit carried away, so now we've ended up with this utility called WORKtop, that not only periodically sizes and decodes your work&util directory names, but also gives you with a nice way of identifying the Metadata User owner of each workspace session (if they're configured to run as sassrv). SASWORK, UNIX top.... WORKtop. Get it?  

 

rec

 

I've put it all up on GitHub, so head over to https://github.com/boemska/worktop to read all about it and get the code. It's just a shell script which should work fine on Red Hat Enterprise Linux 6 and newer.

 

And @JuanS_OCS, thank you for the kind words about ESM! I'm very happy that our enterprise monitoring product is making your job easier and more enjoyable. The thing is, like you say, ESM is a big tool that does a lot more than just solve this relatively simple problem of monitoring SASWORK and UTIL directories, so using it would be overkill just to solve a problem that can be addressed with a few lines of bash. Although it's a valid suggestion as ESM does work perfectly on SAS 9.2 Smiley Happy

 

Anyway, I hope that someone finds this WORKtop utility useful. I had a lot of fun writing it.

 

 

Nik

 

 

Contributor
Posts: 20

Re: SAS Administrator : how to find the PID of a specific WORK Folder

Posted in reply to boemskats

Hi,

 

this initiative is a good idea, I will test it as soon as possible.

 

Thanks,

Gaetan

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 1662 views
  • 16 likes
  • 4 in conversation