Slowness while opening Workflow Designer
Symptoms
The Workflow Designer tab opens slowly. In addition, there is slowness related to any manipulations with bot tasks in Workflow Designer, such as:
- Creating a new Bot Task
- Saving a newly created Bot Task
- Searching for available Bot Tasks in the right panel
- Updating an existent task
These symptoms along with the analysis of thread dumps gathered during the opening of the Workflow Designer tab may indicate that such performance degradation is caused by a big number of machine configs on the environment.
Resolution
The overgrowth of Bot Configs can be caused by the development practice when new versions of Bot Configs are often deployed in the environment. In this case, when a new version of the Business Process is created, there are new versions of Bot Configs. At the same time, the old ones become obsolete since they are only used in the old run and cannot be executed once more.
A workaround is to find the obsolete configs that are no longer associated with any non-deleted runs and soft delete them.
Perform the following steps against the MSSQL database.
Execute the following script to create a stored procedure.
create procedure ct.purge_old_obsolete_bot_configs_sp as begin set xact_abort on; set nocount on; declare @cm_rows int , @c_rows int , @mc_rows int select mc1.id into #machine_configs from ct.machine_config mc1 left join ct.campaign c1 on c1.machineconfigid = mc1.id left join ct.campaignmap cm1 on cm1.campaign = c1.id left join ct.run rr1 on rr1.campaign_id = cm1.parent where mc1.deleted = 0 group by mc1.id having sum(case when rr1.status <> 'DELETED' then 1 else 0 end) = 0; begin transaction; update cm set cm.deleted = 1 from #machine_configs mcid join ct.campaign c on c.machineconfigid = mcid.id join ct.campaignmap cm on cm.campaign = c.id; set @cm_rows = @@rowcount update c set c.status = 'DELETED' from #machine_configs mcid join ct.campaign c on c.machineconfigid = mcid.id; set @c_rows = @@rowcount update mc set mc.deleted = 1 from #machine_configs mcid join ct.machine_config mc on mc.id = mcid.id; set @mc_rows = @@rowcount commit; print formatmessage('Deleted in ct.campaignmap: %i row(s);', @cm_rows); print formatmessage('Deleted in ct.campaign: %i row(s);', @c_rows); print formatmessage('Deleted in ct.machine_config: %i row(s);', @mc_rows); end; goEnsure that the WorkFusion service on the APP server is stopped.
wfmanager stop workfusionExecute the procedure:
exec ct.purge_old_obsolete_bot_configs_spIf the procedure finishes without issues, you will get statistics of the rows affected.
Deleted in ct.campaignmap: 11 row(s); Deleted in ct.campaign: 23 row(s); Deleted in ct.machine_config: 83 row(s);Start WorkFusion again.
wfmanager start workfusion