Change Native App Compute Pool Size
Jump to navigation
Jump to search
By default, QPR ProcessAnalyzer Native App uses the CPU_X64_S size compute pool. The compute pool size can be changed (for example to CPU_X64_XS) using the following instructions.
The instructions use procedure public.set_compute_pool which is part of the Native App and it recreates application service in a specified compute pool. Application role ADMINISTRATOR is required to run the procedure. The procedure will drop and recreate the application service. Data in QPR ProcessAnalyzer database will be lost - use the snapshot to save and restore data.
-- stop application service
ALTER SERVICE QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE SUSPEND;
CALL QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE!SPCS_WAIT_FOR('SUSPENDED', 600);
-- take snapshot
CREATE SNAPSHOT QPRProcessAnalyzerBackups.Backups.MySnapshot
FROM SERVICE QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE
VOLUME "data"
INSTANCE 0;
-- create new compute pool for application
CREATE COMPUTE POOL QPR_PROCESSANALYZER_COMPUTE_POOL_S
FOR APPLICATION QPR_PROCESSANALYZER
MIN_NODES = 1
MAX_NODES = 1
INSTANCE_FAMILY = CPU_X64_S
AUTO_RESUME = true;
-- wait until compute pool is in status IDLE
-- grant permissions to application
GRANT USAGE ON COMPUTE POOL QPR_PROCESSANALYZER_COMPUTE_POOL_S TO APPLICATION QPR_PROCESSANALYZER;
-- call the procedure
CALL QPR_PROCESSANALYZER.PUBLIC.SET_COMPUTE_POOL('QPR_PROCESSANALYZER_COMPUTE_POOL_S');
-- now in Snowflake UI go to application and press 'Activate'
-- wait until activation finished
-- stop application service again to restore snapshot
ALTER SERVICE QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE SUSPEND;
CALL QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE!SPCS_WAIT_FOR('SUSPENDED', 600);
-- restore snapshot
ALTER SERVICE QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE RESTORE
VOLUME "data"
INSTANCES 0
FROM SNAPSHOT QPRProcessAnalyzerBackups.Backups.MySnapshot;
-- start service
ALTER SERVICE QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE RESUME;
CALL QPR_PROCESSANALYZER.METADATA.QPR_PROCESSANALYZER_SERVICE!SPCS_WAIT_FOR('RUNNING', 600);
-- remove old compute pool
GRANT OWNERSHIP ON COMPUTE POOL QPR_PROCESSANALYZER_COMPUTE_POOL TO ROLE ACCOUNTADMIN;
DROP COMPUTE POOL QPR_PROCESSANALYZER_COMPUTE_POOL;