in reply to Re^3: Percent of CPU/Mem Usage for User
in thread Percent of CPU/Mem Usage for User

Well, if this script is being called only once, such as with a cron job, that's fine. However, if you were to put this into a CGI script, the number of processes or memory could quickly get out of control. You could add a check to see how many processes are running under the user. Then you could kill it (or something else that's cleaner) if there are too many processes, or too much memory is used. This might be the best of both worlds.
  • Comment on Re^4: Percent of CPU/Mem Usage for User