Question about CPUAFFINITYMODE and CPUAFFINITYSET

lybhrwn742lybhrwn742 Vertica Customer

Hi,
Suppose I have two different resource pools with CPUAFFINITYSET=80% in shared mode.
What will happen to the second resource pool if the first one reaches to 80% CPU usage? will the second pool's queries be queued or will the server reach 100% CPU?

Thank you !

Answers

  • HibikiHibiki Vertica Employee Employee

    That percentage is used to define which CPU will be used by the Resource Pool. For example, Vertica database is running on the server that has 4 CPUs and it creates 2 Resource Pools with CPUAFFINITYSET parameter as below:

    CREATE RESOURCE POOL rp1 CPUAFFINITYMODE SHARED CPUAFFINITYSET '80%';
    CREATE RESOURCE POOL rp2 CPUAFFINITYMODE SHARED CPUAFFINITYSET '80%';
    

    We can see the information of the assigned CPUs used by each Resource Pool in resource_pool_status:

    => SELECT pool_name, cpu_affinity_mode, cpu_affinity_set, TO_BITSTRING(cpu_affinity_mask::VARBINARY) cpu_affinity_mask FROM resource_pool_status WHERE pool_name LIKE 'rp%' ORDER BY 1;
    
     pool_name | cpu_affinity_mode | cpu_affinity_set | cpu_affinity_mask
    -----------+-------------------+------------------+-------------------
     rp1       | SHARED            | 80%              | 00110111
     rp2       | SHARED            | 80%              | 00110111
    

    In this case, both Resource Pool use CPU 0, 1, 2.

    You can see another example in the product documentation as below:
    https://www.vertica.com/docs/12.0.x/HTML/Content/Authoring/SQLReferenceManual/SystemTables/MONITOR/RESOURCE_POOL_STATUS.htm#Examples

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file