Cut Processing time

  • Thread starter Thread starter Tlink
  • Start date Start date
T

Tlink

We have a number of vb services and programmes running on our windows 2003
server, the problem is that the server runs at 98-100% processing . Is it
possible to set the programs to not use this much processing time, any
advise or help would be appreciated as we have managed to "stop" a number of
systems.

We have tried to move individual programs to separate systems but usage is
the same, is it possible to do anything ?
 
Tlink,

I assume that there is an procedure in it, that is endless. That one has to
start at an event, not endless. And if that is not possible with a timer
that checks ever x timeunits.

I hope this helps,

Cor
 
Tlink said:
We have a number of vb services and programmes running on our windows 2003
server, the problem is that the server runs at 98-100% processing . Is it
possible to set the programs to not use this much processing time, any
advise or help would be appreciated as we have managed to "stop" a number
of systems.

You could assign a lower priority to the process in Windows explorer, for
example. However, I am curious what your service is actually doing that
causes the high processor usage.
 
The processors are adding,deleting and changing current data in a MS SQL
database, with information being update consistently, so
what I want to do is control CPU usage via the programs.
 
Hi Tlink,

A simple while loop in the program will eat all the CPU time.
e.g.
While Ture
.....
Wend

Windows schedule the threads based on the priority(Normal/High...) you will
find that in the Task Manager if no process is running, the Idel process
will occupy the almost 100% CPU, this is tell you that current the CPU is
idle. Once another process with higher priority want CPU time, the idle
process's CPU time will decrease.

So commonly it is not proper to run a loop all the time without any thread
sleep, because that is tell the CPU you want the CPU time all the time, so
that CPU will be occupied by your process if there is no other higher
priority process want it.

I think you may try Cor's suggestion, or check every 1 second or more. Or
When you code is modifying the database, try to fire event to tell
something had happened.
e.g.
While True
checkdatabase()
Thread.Sleep(1000)
Wend


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
I don't see how that's possible. When sending commands to a database
the current thread will remain in a wait state until the database
responds. If the application really is doing a lot of work against the
database then I would expect far lower CPU usage.

Have you profiled the application to see what it's doing?

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top