You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-9Lines changed: 45 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,14 @@
1
1
# qstat-cache
2
-
A cached version of the PBS Pro qstat command that reduces load on the scheduler's database
2
+
A cached version of the PBS Pro qstat command that reduces load on the
3
+
scheduler's database
3
4
4
5
## Details
5
-
Most users run the qstat command at reasonable intervals and things work well. However, with the advent of workflow managers more users are running qstat at frequencies much too high for current versions of PBS Pro to support well. This utility creates a simple text-based cache of common qstat output and provides a script to serve that data to users. If an option is not cached (e.g., -xf output), the query is sent to PBS's version of qstat for processing. Usage:
6
+
Most users run the qstat command at reasonable intervals and things work well.
7
+
However, with the advent of workflow managers more users are running qstat at
8
+
frequencies much too high for current versions of PBS Pro to support well. This
9
+
utility creates a simple text-based cache of common qstat output and provides a
10
+
script to serve that data to users. If an option is not cached (e.g., -xf
11
+
output), the query is sent to PBS's version of qstat for processing. Usage:
-Fjson display full output in JSON format (use with -f)
24
32
-H job output regardless of state or all finished jobs
25
33
-l disable labels (no header)
26
34
-n display a list of nodes at the end of the line
@@ -34,9 +42,12 @@ Options:
34
42
## Installation
35
43
36
44
1. Clone this repository on your system.
37
-
2. Copy or rename the site.cfg.example file to site.cfg and edit the configuration settings.
38
-
3. Run the `validate.sh` script to ensure your site.cfg is set up properly (*optional, but recommended*).
39
-
4. Schedule the gen_data.sh script to run at regular intervals (typically every minute via a cron job).
45
+
2. Copy or rename the site.cfg.example file to site.cfg and edit the
46
+
configuration settings.
47
+
3. Run the `validate.sh` script to ensure your site.cfg is set up properly
48
+
(*optional, but recommended*).
49
+
4. Schedule the gen_data.sh script to run at regular intervals (typically every
50
+
minute via a cron job).
40
51
5. Add the cached version of `qstat` to your (and your users') environment PATH.
41
52
42
53
### site.cfg settings
@@ -93,20 +104,45 @@ GENFREQ=10
93
104
# user queries (use qstat -Bf to get server names)
94
105
95
106
SERVERMAP=
107
+
108
+
# Which potentially expensive options do you want to enable
109
+
110
+
CACHEFLAGS="f Fjson"
111
+
112
+
# Enable privilege checking according to following user and
113
+
# group settings. If false, all queries allowed.
114
+
115
+
PRIV_MODE=true
116
+
117
+
# Permit users and groups from these two lists respectively to
118
+
# see "full" job output from other users (can contain sensitive
119
+
# information if user is passing environment with -V)
120
+
121
+
PRIV_USERS="root"
122
+
PRIV_GROUPS="admins support"
96
123
```
97
124
98
125
### Example crontab
99
126
100
-
Here is a sample crontab that will run the gen_data.sh script every minute (sub-minute scheduled is recommended and enabled via the site.cfg). The idea here is to run often enough that users and their workflows are satisfied, but not so often that we put our own load on PBS.
127
+
Here is a sample crontab that will run the gen_data.sh script every minute
128
+
(sub-minute scheduled is recommended and enabled via the site.cfg). The idea
129
+
here is to run often enough that users and their workflows are satisfied, but
There are two environment variables you may set to assist in debugging. Setting `QSCACHE_DEBUG` to `true` will cause qstat to print the error stream from the cache read command if it fails (otherwise this output is suppressed). It will also print the age of the cache, assuming it can be found.
140
+
There are two environment variables you may set to assist in debugging. Setting
141
+
`QSCACHE_DEBUG` to `2` will cause qstat to print the error stream from the
142
+
cache read command if it fails (otherwise this output is suppressed). If set to
143
+
`1` or greater, qstat will also print the age of the cache, assuming it can be
144
+
found.
111
145
112
-
If you set `QSCACHE_BYPASS` to `true`, the cache will be bypassed regardless of which options are set, and the scheduler version of qstat will instead be called.
146
+
If you set `QSCACHE_BYPASS` to `true`, the cache will be bypassed regardless of
147
+
which options are set, and the scheduler version of qstat will instead be
0 commit comments