Is there a way to return the load averages, excluding any load caused by nice'd processes?We have a load balancing mechanism in place that checks the load of multiple Linux servers, and submits a job to the server having the lowest load.  We had a scenario where all servers had too high a load and so no server could be selected in the load balancing.  However, I noticed that the servers were handling a bunch of nice'd processes, so although the load averages were high, it was still safe to submit another job.Let me know if clarification is needed.  Thanks.
Get load average excluding niced processes
linux;load;nice
You can write up your own script that uses ps to list all processes in the run/runnable state without a nice value greater than 0. The specific syntax you need to use will differ based on your version of ps. Something like this may work:ps -eo state,nice | awk 'BEGIN {c=0} $2<=0 && $1 ~ /R/ { c++ } END {print c-2}'It runs ps collecting the state and nice level of all processes and pipes the output to awk which sets a count variable c and increments it whenever the second column (nice) is less than or equal to 0 and the first column includes R (for runnable). Once it's done it prints out the value of c after subtracting 2. I subtract 2 because the ps and the awk commands will almost always be considered runnable for the duration of the command's execution. The end result will be a single number which represents the number of processes that were runnable at the time that the script executed excluding itself and processes run nicely, which is essentially the instantaneous load on the machine. You'd need to run this periodically and average it over 1, 5, and 15 minutes to determine the typical load averages of the machine.