onmode and p arguments: Add or remove virtual processors (SQL administration API)

Use the onmode and p arguments with the admin() or task() function to dynamically add or remove virtual processors for the current database server session. This function does not update the onconfig file.


Read syntax diagramSkip visual syntax diagram
>>-EXECUTE FUNCTION--+-admin-+--(--"onmode"-- , -"p"--,--------->

   |              +-"bts"-----+        |         
   |              +-"cpu"-----+        |         
   |              +-"encrypt"-+        |         
   |              +-"jvp"-----+        |         
   |              +-"lio"-----+        |         
   |              +-"po"------+        |         
   |              +-"shm"-----+        |         
   |              +-"soc"-----+        |         
   |              +-"tli"-----+        |         
   |              '-"vpclass"-'        |         
   |  (1)                              |         

  1. UNIX only
Element Description Key Considerations
number The number of virtual processors to add or to remove. A positive number adds virtual processors. The maximum number of virtual processors you can add depends on the operating system.

UNIX: A negative number removes virtual processors. The number of virtual processors to drop cannot exceed the actual number of processors of the specified type.

vpclass The name of a user-defined virtual processor class.

Windows: The number argument must be set to 1 because you can only create one instance of a user-defined virtual processor.


You can use this function only when the database server is in online mode.

The number of CPU VPs should not exceed the number of physical processors on your system, but no error is issued if they do. The database server uses the number of CPU VPs to allocate resources for parallel database queries (PDQ). If you drop CPU VPs, your queries might run significantly slower. After you change the number of CPU VPs, the Reinit field in the output from the onstat -g mgm command shows how many queries are waiting for other queries to complete.

See the HCL Informix® Performance Guide for more information about performance implications of the CPU VP class.

For a description of each virtual processor class, see the IBM Informix Administrator's Guide.

This function is equivalent to the onmode -p command.


The following example adds one CPU virtual processor:
EXECUTE FUNCTION task("onmode","p","1","cpu");
The following example removes one Java™ virtual processor:
EXECUTE FUNCTION task("onmode","p","-1","jvp");

Copyright© 2018 HCL Technologies Limited