BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gaetan
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

@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)

View solution in original post

8 REPLIES 8
JuanS_OCS
Amethyst | Level 16

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

Gaetan
Obsidian | Level 7

Thank you form your anwer.

 

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

 

Gaetan

Kurt_Bremser
Super User

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)

Gaetan
Obsidian | Level 7

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

Kurt_Bremser
Super User

@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)

Gaetan
Obsidian | Level 7

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 !

boemskats
Lapis Lazuli | Level 10

@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 🙂

 

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

 

 

Nik

 

 

Gaetan
Obsidian | Level 7

Hi,

 

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

 

Thanks,

Gaetan

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 7530 views
  • 17 likes
  • 4 in conversation