×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Setting CPU Priority on NT/Citrix?

Cliff posted more than 11 years ago | from the preventing-bad-apples-from-spoiling-the-whole-bushel dept.

Microsoft 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?"

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

48 comments

i thought it said 'selling CPU time.... (2, Interesting)

avi33 (116048) | more than 11 years ago | (#5033036)

...like the old days...

Though if you could find a way to do that, you might be able to convince your 'power users' to mind their manners. How about a contest every week...whoever uses the least CPU gets free beer?

Re:i thought it said 'selling CPU time.... (0, Offtopic)

jpsst34 (582349) | more than 11 years ago | (#5033183)

I could win this contest hands down - 0% utilization. Just watch me not use the CPU. As for free beer, I homebrew [slashdot.org] now! Make it an ingredients kit.

Re:i thought it said 'selling CPU time.... (1)

Broue Master (576074) | more than 11 years ago | (#5058940)

Great idea... except that we already work for a brewing compagny (no jokes!) :)

command line (3, Informative)

sql*kitten (1359) | more than 11 years ago | (#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 (3, Informative)

duffbeer703 (177751) | more than 11 years ago | (#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.

Why ask us? (-1, Flamebait)

Anonymous Coward | more than 11 years ago | (#5033128)

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....Did the software solve the problem or did you solve the situation by other means?

Why are you asking us??? Go ask the people on the NTSysAdmin List or the PrioSet people. Why would you possibly submit this question to a general group of tech people -- go ask the specialists.

archeology (2, Funny)

NeoEinstein (625476) | more than 11 years ago | (#5033133)

NT on Citrix ? Wow, that's an archeological found :D !

just kiddin'

Re:archeology (0)

Anonymous Coward | more than 11 years ago | (#5037334)

I took a look at your webpage. I'm going to cut you a break because English is obviously not your first language.

However, geek isn't either. You meant to say:

"Citrix on NT? Wow, that's an archeological find!"

Before you learn bastardizations of contractions like 'just kiddin', you might want to brush up on your tenses and logical flow. I'd comment on your username, but like I said, I'm cutting you a break here.

Re:archeology (1)

NeoEinstein (625476) | more than 11 years ago | (#5093002)

If your look at my homepage was so good as you mention here, you should have noticed that the english translation is done by an automatic process by altavista's babelfish !

Comment on what you want, your only an Anonymous Coward so I won't waste any more time !

Access - cpu killer. (0)

Anonymous Coward | more than 11 years ago | (#5033168)

Access is a terrible resource hog. The best thing you could do is tell them to stop using it, they will thank you for it in a short time.

Might not apply, but (4, Informative)

Asprin (545477) | more than 11 years ago | (#5033194)


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.

Re:Might not apply, but (1)

jpsst34 (582349) | more than 11 years ago | (#5033205)

What if he doesn't have an "x" drive. Is that a networked drive at your site?

Re:Might not apply, but (2)

Asprin (545477) | more than 11 years ago | (#5033302)


I used X: as a variable since I don't know on which drive his %systemroot% folder is located. Citrix allows you to remap the local drive letters (C, D, E, etc.) on installation to something that won't conflict with the client PC's (M, N, O, etc.). This is taught in the Citrix cert classes, so he'll be aware of it.

I guess on second thought, I should have sent him to search %systemroot% and avoided the issue, but I haven't managed a Citrix network in a few months, so I'm a bit rusty.

Re:Might not apply, but (1)

jpsst34 (582349) | more than 11 years ago | (#5033565)

I'm sorry. I was trying to make a stupid joke but it was just that - stupid. I know to many IT/HelpDesk people who get real comments like "I just got a new computer and I can't find my J drive." It's kind of like "the internet's broken," or "the T1 is down," or "my AGP printer is busted."

I knew what you were tyring to say, just trying to make a dumb joke.
[hangs head in shame]

mmmm (1)

doofusclam (528746) | more than 11 years ago | (#5033274)

You can reduce the priority of the given app but any system processes used by it (api calls, drivers, software raid etc) can still use up that cpu/io anyway. Don't think I ever saw a workable solution for this, which is why i'm glad I don't have to write software anymore where I get told at the last minute 'oh by the way all the users will be running on the same citrix box'

seany

Dear Slashdot (1, Funny)

Anonymous Coward | more than 11 years ago | (#5033276)

Dear slashdot; Some of my users are doing actual work, and it's making the rest of the users look bad. By doing work they show that we've bought underpowered hardware for too many users. How can I make them not do work so I get to keep my job?

ulimit? jeez (1)

photon317 (208409) | more than 11 years ago | (#5033290)


How many DECADES have unices had ulimit support working by default? Wake up Micro$loth, here's another innovation you're completely missed the boat on.

Re:ulimit? jeez (0)

Anonymous Coward | more than 11 years ago | (#5035246)

"ulimit" is not of much use in this case. you don't want a poweruser being thrown out of Excel 5 seconds before saving his work because he has exceeded the CPU quota.

The problem here is the very static process priority in NT. All user processes are started at the same priority and stay there, no matter what they do. So one process looping or spending lots of CPU cuts performance for a competing process in half.

This is solved better in Unix, where process priorities are dynamic, and processes that spend a lot of CPU time get reduced in priority. So the others that require little CPU get relatively higher priority, get quickly serviced, and the remainder of available CPU is spent on the heavy users.

It is THIS feature that MS should have included in NT. Now they have only a couple (5, if I remember well) fixed settable priorities for user processes, which is overly limiting and can be experienced as unfair. The dynamic mechanism is much better.

Re:ulimit? jeez (1)

CodeArt (540731) | more than 11 years ago | (#5037933)

This absolutely does not make any sense and is completely untrue.

Windows NT/2000 scheduler works at the thread granularity and not at the process granularity.

A thread's priority can change dynamically in Windows NT/2000!

And Windows NT/2000 uses in total 32 priority levels (16 real-time, 15 variable levels and 1 system level).

Please check facts first before bashing Windows NT/2000.

Re:ulimit? jeez (3, Informative)

larien (5608) | more than 11 years ago | (#5035890)

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.

Re:ulimit? jeez (2)

photon317 (208409) | more than 11 years ago | (#5050919)


Fair enough. I was quick to reply, and ulimit cpu limits aren't quite what the guy is looking for. I bet if there was sufficient demand for such a thing, this could be hacked in as another setrlimit (ulimit) value with minimal effort.

Just to continue being a "12 year old microsoft basher" as the AC response put it: Maybe we haven't seen a need in unix because schedulers work better there, and apps are better behaved?

Re:ulimit? jeez (2)

larien (5608) | more than 11 years ago | (#5053423)

Like I said, you can get similar things and Sun sell some resource management software which is used to guarantee that users/groups get a specified amount of CPU time. In short, there can be a need in Unix, although the schedulers do tend to work a little better.

Re:ulimit? jeez (0)

Anonymous Coward | more than 11 years ago | (#5036668)

Grow up, you cliche Slashdotting twelve-year old Microsoft basher. ulimit is only for limiting CPU time, not CPU usage.

why are you asking this here? (4, Insightful)

kevin lyda (4803) | more than 11 years ago | (#5033291)

ask microsoft or citrix. go buy their books or their cdrom reference libraries.

you paid for licenses and support, now go get your money's worth. why are you asking a bunch of (mainly) free software people who probably don't know the best answer?

and if you think we do, why don't you use the software we use?

Task Manager (1)

bob_dinosaur (544930) | more than 11 years ago | (#5033345)

You can set the priority of any given task by right-clicking on the process in Task Manager. If you've got admin rights, and have "Show All Processes" ticked, you'll be able to set the priority for any user's task from within your Citrix session. I'm not sure whether this information will persist between sessions; you'll have to try that yourself. If you've got more than one server, put the three power users on one, and the other 10 on the other.

How bout you switch to FreeBSD (0)

Dirty_Sanches (619600) | more than 11 years ago | (#5033544)



Or most other BSD's out there include per user resource managment, you can restrict every resource imaginable.

Throttle the processes programmatically (2, Informative)

m8pple (623433) | more than 11 years ago | (#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.

Re:Throttle the processes programmatically (4, Informative)

borgboy (218060) | more than 11 years ago | (#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.

Re:Throttle the processes programmatically (2, Informative)

m8pple (623433) | more than 11 years ago | (#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.

Re:Throttle the processes programmatically (2, Informative)

borgboy (218060) | more than 11 years ago | (#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.

A similar problem (4, Interesting)

Kj0n (245572) | more than 11 years ago | (#5033848)

I once heard of a similar problem with a NT server running Terminal Server and several users accessing it from a UNIX machine. The CPU usage of Excel would suddenly go to 100% and stay there.

Apparently, users used Shift + arrow key to switch to another virtual desktop. Unfortunately Excel went into a busy loop after the Shift key was pressed (it was busy waiting for the next key) and stayed there until the user switched back to the Terminal Server window. This resulted in Excel taking the entire CPU.

Simple solution (0)

Anonymous Coward | more than 11 years ago | (#5034169)

Without knowing any of the technical details (nor ctrix, nor Windows), may I suggest you buy two boxes. Put the three power users on one, and let them fight over the cpu. Put the remaining nice users on the other, they'll have a lot of power. Everybody gets what they deserve. for a price that is probably less than it would cost to locate and implement a fair sharing system.

The Obligatory Useless Answer (0)

Anonymous Coward | more than 11 years ago | (#5034197)

Use MetaFrame for UNIX and OpenOffice instead!

Multiple CPU (0)

Anonymous Coward | more than 11 years ago | (#5035113)

We found in the past that even without power users single-CPU Citrix boxes have stinky performance. Dual CPU's help a lot - single Excel or Word threads still leave the other CPU available. We typically have 20-30 users per dual CPU box and don't get complaints.

Not the answer you are looking for (2)

iangoldby (552781) | more than 11 years ago | (#5035811)

I know this is not the answer you are looking for, but wouldn't it just be so much easier to let the three power users run Excel locally on their own PCs rather than on the server? They are probably already using 800MHz+ PCs as the 'thin clients' - that is more than adequate for most Excel tasks.

Unless they really need to jump from desk to desk, I'm sure they'd get much better performance, and the other users would be happier too.

Re:Not the answer you are looking for (2)

larien (5608) | more than 11 years ago | (#5035878)

Some thin clients really are just that; "toasters" with little/no CPU power.

There's also the issue about licenses; while there may be licences for the server, buying licenses for all the clients might be expensive.

Re:Not the answer you are looking for (2)

digidave (259925) | more than 11 years ago | (#5036597)

I'm pretty sure that with Citrix all the clients need software licenses as well. At least I think they do for MS apps. This should mean that there will be no licensing problems, assuming that the licenses used with Citrix can be used as local installations.

Ask your vendor (1)

gruntvald (22203) | more than 11 years ago | (#5036006)

You buy proprietary software because you expect it to be supported. Go ask there. Or ask yourself why you are not. Or why you think you can run a product that you are not trained to administer.

If you've got money to spend... (1)

chriskenrick (89693) | more than 11 years ago | (#5036200)

You could try products from the company I work for. Check out http://www.aurema.com. Allows setting of CPU shares by user, and is highly customisable.

IN SOVIET RUSSIA... (0)

Anonymous Coward | more than 11 years ago | (#5038327)

In Soviet Russia, the CPU sets YOUR priority!

Setting CPU Priority on NT/Citrix? (1)

stalinvlad (591479) | more than 11 years ago | (#5047929)

Access limited on CPU? Hmm you sure you are doing the measurments correct. I thought this was limited by disk and RAM.

Likewise Excel can be a CPU hog or a disk hog, depending on what people are using it for, keeping lists of things or doing monster LP problems.

How is the citrix server set up, does it contain all the apps and user data or is some off loaded onto other networked servers? I would suggest you need 300MHz of CPU per a user so for example 10 users=3GHz, say 2x1.5GHz Xeons/P4's, and at least one m/c to store user either user data on OR the applications i.e. seperate them to help avoid disk bottlenecks

Citrix/Terminal Server/Thin client resources (1)

skippy5066 (563917) | more than 11 years ago | (#5049512)

This is a common problem with both NT4.0 Terminal Servers and Terminal Services under Win2K. Many applications, often written for the desktop, just don't play well in a multi-user environment like this.

There are a lot of methods to calm down CPU-hogging apps. Some can be tamed by registry settings, others by utilities (like Tame), and others by server tuning apps like TScale, made by RTO Software [rtosoft.com] .

All of these things are discussed on TheThin.Net [thethin.net] website (and the associated mailing list), considered by many to be the best source of freely-available thin client computing info on the 'net. I suggest you check it out, and read the FAQs and archives.

-Jeff Gunn
Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...