Kbase P92353: How does CPU speed relate to values to set for -spin
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/17/2009 |
|
Status: Verified
GOAL:
How does CPU speed relate to values to set for -spin
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Product Family
FIX:
When discussing possible values to set for -spin there is always some relationship between how high -spin should be set and what speed of CPU's exist in the machine being used.
Furthermore, there are other factors which effect what value to set for -spin.
-spin is a database startup parameter which is available with Enterprise Database license.
Certain operations within Progress are very quick in duration. For many quick duration operations it is better to use an OS construct called a latch instead of the standard OS mechanism called a semaphore.
When Progress uses -spin, Progress asks the operating system for an available CPU to perform the small duration task.
Depending on the value of -spin we will keep asking for an available CPU upto the limit of -spin and then we will wait (nap) a certain number of milliseconds and repeat this loop until we get an available CPU to perform the work.
The speed of a CPU is measured in Megahertz or Gigahertz. Either millions or billions of operations per second.
-spin uses some fraction of those CPU clock cycles.
If the system is a 500 Mhz system then it can do 500 millions operations per second.
If the system is a 1 Ghz system then it can do 1 billion operations per second.
If Progress is set with a -spin of 2000 this indicates that when a task is requested we will ask the CPU upto 2000 times for an available CPU to perform some task. If the system doesn't have an available CPU to perform the task we will sleep at the end of the 2000 attempts and then wake up and repeat the cycle again.
2000 is a very small percentage of 500 million or 1 billion. This is so small as to be nearly meaningless to the CPU.
When considering a multiprocess environment, eg. many clients, each client performing operations will cumulatively add to the load of the system.
Therefore if 50 users are each working in the database and the database is set with -spin 5000, each of those users could request the CPU upto the limit of spin for certain operations.
This might use as much as 250000 clock cycles if none of the clients could get an available CPU until the end of their -spin counts.
If either the value for -spin were higher or the user count was higher this might lead to delays if the maximum capacity of the CPU availability for the machine were reached.
The -spin can be set on a single processor system but should only be set with a value of 1. This will allow the database to use the -spin algorithm and under some conditions can improve performance.
For systems with processors 200 Mhz or higher it is typically expected that a multiprocessor system should be able to handle a -spin value of 5000 per CPU.
There is no hard or fast rule for what to set -spin.
By reviewing Promon->R&D->Option 3->Option 1
Specifically the latch wait timeouts should be reviewed.
If there is available CPU on the system and the database was started with at least -spin 1 then -spin should be tuned up to decrease latch wait timeouts.
The CPU availability on the machine should be monitored closely during this tuning to make sure the available CPU doesn't drop below 3-5%. The machine should always have some available CPU. If the value of available CPU falls below the 3-5% threshold then -spin should be decreased.
promon->R&D->Option 4->Option 4 can be used to modify the value of -spin online, if it was previously set when the database was started multi-user.