Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Microsoft

Setting CPU Priority on NT/Citrix? 48

Broue Master asks: "I was recently faced with the task of finding a way to prevent some users from taking 100% cpu time in Citrix. I'm no MS certified anything (but I am a Citrix certified admin) and I couldn't find a built in way to do this. After someone on the NTSysAdmin List suggested trying to set the CPU priority to low from the command line, I investigated and found a small freeware that did the trick: PrioSet. I don't have a big user base: 3 power users (who are my problem with their Access and Excel use) and 10 regular users (and the people most affected by the problem). I'd like to know if any of you have previously tried this software, or if you've run into the particular problem when one user is getting 99% of the CPU for a long time while all other users only share the spare 1%. Did the software solve the problem or did you solve the situation by other means?"
This discussion has been archived. No new comments can be posted.

Setting CPU Priority on NT/Citrix?

Comments Filter:
  • command line (Score:3, Informative)

    by sql*kitten ( 1359 ) on Tuesday January 07, 2003 @12:33PM (#5033059)
    After someone on the NTSysAdmin List suggested trying to set the CPU priority to low from the command line, I investigated and found a small freeware that did the trick: PrioSet.

    Type start /? into the prompt - it can start processes at different priorities. So you can replace direct shortcuts to your applications with .bat files that in fact start the application at a different priority.
  • Easy (Score:3, Informative)

    by duffbeer703 ( 177751 ) on Tuesday January 07, 2003 @12:36PM (#5033111)
    Change the shortcut that users launch Access & Excel with to point a CMD, shell or Perl script that launches Access or Excel, then sets drops the priority. It's pretty easy to use Perl to launch and control office applications.

    Another route may be to move the access database to an RDBMS, which may use less CPU horsepower than using Access as a client/server.
  • Might not apply, but (Score:4, Informative)

    by Asprin ( 545477 ) <(moc.oohay) (ta) (dlonrasg)> on Tuesday January 07, 2003 @12:45PM (#5033194) Homepage Journal

    If the problem is 16 bit DOS apps, Tame [tamedos.com] can help.

    Also, when you installed Office, did you run the appropriate app-tuning script afterward? (Search in x:\wtsrv for *.cmd and you'll find a whole bunch of them.) These scripts can make a big difference with certain versions of Windows.

    You might also try the MetaFrame Installation and Tuning Tips [thinplace.de]. You might find a more recent version if you dig around.

  • by m8pple ( 623433 ) on Tuesday January 07, 2003 @01:25PM (#5033629)
    If you have a bit of C knowledge then you could write something to throttle the processes back via API calls. Simplest would be to find all the access processes (via toolhelp), then every once in a while enumerate all the threads in each process and suspend them for a fraction of a second (SuspendThread/ResumeThread).

    As long as the suspensions are done quick and often there is usually no visible difference, except that the process takes a lower percentage of cpu time. Admittedly I've only used this sytem before to make processes self throttling, but there is no reason why it shouldn't work for third party processes.

    Obviously it would take a bit of tuning to get right, particularly if the access processes aren't competing with anything else most of the time, but it shouldn't take more than a hundred lines of code.

    Erm, yeah, or you could just run them at a lower priority.

  • by borgboy ( 218060 ) on Tuesday January 07, 2003 @02:20PM (#5034053)
    Actually, if he's running Win2k server, he can use the Job Object API [microsoft.com]
    This API allows you to set per-process limits on cpu, memory, user mode execution time, min/max working set, processor affinity, thread priority, UI restrictions, and security restrictions.
    I believe that Win2k Datacenter Server comes with a Job Object MMC for creating Job Objects / adding processes to a Job Object.
  • by m8pple ( 623433 ) on Tuesday January 07, 2003 @02:36PM (#5034172)
    Yeah, I though about mentioning it, but it seems like he's tied to NT. I'm using them for the same thing that I used to use the manual throttling for, and they are great, particularly when spawning lots of third party tools like compilers.

    AFAIK they work on any W2k or higher machine, but I could be wrong; I don't think I use any machines that aren't server (rather than pro) for my stuff.

  • by borgboy ( 218060 ) on Tuesday January 07, 2003 @02:51PM (#5034295)
    Yeah. According to the API docs, it works on W2k any edition, XP Pro and .Net Server. No go for NT, but I feel sorry for anyone still working in NT anyways.
  • Re:ulimit? jeez (Score:3, Informative)

    by larien ( 5608 ) on Tuesday January 07, 2003 @07:16PM (#5035890) Homepage Journal
    Ulimit isn't the same thing; ulimit limits on total CPU time, not % CPU at any given time.

    Thus, if they run an app for some time (e.g. over a few days) they might run up 30 minutes total CPU time with no real problems. On the other hand, someone could start an app, peg it at 99% for 10 minutes and completely hammer the server.

    Operating systems like Solaris have add-ons to achieve system limits like CPU allocations to individual users/groups, but that is NOT ulimit.

I tell them to turn to the study of mathematics, for it is only there that they might escape the lusts of the flesh. -- Thomas Mann, "The Magic Mountain"

Working...