Configure the CPU virtual processor inside the Informix dynamic server

Source: Internet
Author: User
Tags informix require thread

In a dynamic server, CPUVP (CPU virtual processor) is a multiple-thread process that runs on the processor unless the following occurs:

1.CPUVP There is no task to do, such as a thread in the ready queue that does not wait for execution.

2. The operating system forces CPUVP to relinquish the CPU to other processes.

In order to optimize throughput considerations, you need to set Numcpuvps to the minimum number of tasks that can be handled properly, which should be less than or equal to the number of CPUs in the system, and it is recommended that you do not set the number of CPUVP larger than the number of available CPUs, if the number of CPUVP does not meet This means that you need to improve CPU performance to solve the problem. Only the presence of additional CPUs can be used to solve the problem by adding CPUVP. You can also improve performance by using other tasks in the stop system to free up CPU cycles for virtual processors.

Increasing the number of CPUVP without increasing the CPU will only make the problem more serious, resulting in more CPU competition, so that the operating system will do more to schedule the competition for these CPUs, resulting in a heavier burden on the CPUVP and increased context switching, which not only consumes time but also uses more CPUs.

Because the system is not only CPUVP, there are other processes to request CPU cycles, on some multiprocessor systems, NUMCPUVPS should be less than the total number of CPUs, for multiprocessor systems, we recommend the following set numcpuvps:numcpuvps= total CPU number-1

Check the Ready queue by command Onstat-grea to verify that the CPU is unable to assume the task. The clue to the ready queue is the clue that will be executed, and if the number of threads in the ready queue starts to grow faster, this is the table CPUVP has been unable to undertake such a heavy task. It is normal to see a few ready leads on the tuned system, or some leads to increase when the test begins. It is reasonable to have a ready clue on each CPUVP.

In addition, to see the use of CPUVP, such as CPUVP to keep up with the growth of the task, you will see the virtual processor is saturated, you can use the command Onstat-gglo monitor the use of virtual processors, if the system and CPUVP time and close to the test time spent, Then the CPUVP is saturated, if the Numcpuvps value is lower than the number of CPUs in the system, you can add a CPUVP, but do not exceed the total number of CPUs in the system.

Note: All available CPU time in a multiprocessor system equals the number of processors multiplied by the test time, a CPUVP cannot consume an extra processor at one time, so a CPUVP's total CPU ratio does not exceed 100% of the test time.

If the entire system is saturated with CPU resources, and no longer can reduce workloads or increase resources, you can improve performance by reducing Numcpuvps. But this change only works if the CPUVP is in dire need of other virtual processors or CPU resources for the process. Reduce one CPUVP at a time, and Numcpuvps must be set to a value greater than 0.

For developers: The system is at its best when the CPUVP is not plugged, is doing useful work, and is able to manage its clues well. For example, if a process needs to hibernate to wait for the I/O to complete or the lock to be freed, rather than scheduling other threads to run, it may require multiple CPUVP per CPU to achieve maximum throughput. However, using multiple CPUVP can reduce system efficiency, because the system not only costs a lot of time to deal with the context of the switch, but also for the growth of the processor fast cache competition pay the price. You should ensure that the thread that loops executes gives the CPU a clue to more work to do. Finally, to avoid direct use of operating system calls, such as using the number of CPUVP to determine the number of threads that are not CPU-responsible for activity, there are other problems. System administrator to monitor the system, if the CPU idle should increase the number of CPUVP.

Multi-clue background information

The two responsibilities of the operating system are to increase utilization of CPU resources and ensure that processes have equal access to resources. The operating system is different, but usually the process runs on the CPU until the following events occur.

1. End of process

2. Processes need to wait for certain events, such as the completion of one disk I/O

3. The process exceeds the time slice allocated to it, and there are other processes waiting to be executed

4. Higher priority processes require CPU use, requiring this process to immediately discard CPU occupancy

When one of these occurs, the operating system stops the process executing on the CPU, retains the important process state, and starts executing another process. This is known as context switching. The principle is that the CPU never sits idle when there is work. Multiple clues, whose concepts are basically the same, the main difference is that the work is divided into threads (sometimes called light processes), while virtual processors perform task switching between threads, such as when a thread needs to wait for a disk I/O to complete, CPUVP retains its context and picks a new thread from the ready queue to execute. The context in which this new clue is loaded, and the start of that clue from the newly programmed address, leads to a more efficient way of switching than the process context.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.