On Linux/x86_64 I have several Db2 database instances and most of them have one database per instance.
Today I have had one "run away instance" that consumed most of the CPU resources of whole hardware server.
Is there any simple way to limit CPU resources by Db2 instance. Like setting max 20% CPU usage per instance?
Regards
1 Answer 1
If you enable the WLM Dispatcher for each Db2 instance, you can set WLM_CPU_LIMIT for each database to limit how much of the system’s CPU resources each database can consume. This works across instances, so you could limit DB1 in Instance1 to 50% and DB2 in Instance2 to 50% of the system’s CPU resources.
However, be careful when doing this. WLM_CPU_LIMIT is a hard limit, so even if there’s no other work going on in other databases or instances, you may be slowing down the work in that one database by preventing it from consuming more CPU resources.
-
I have set:
update dbm cfg using wlm_dispatcher yes
andupdate db cfg for test1 using wlm_cpu_limit 20
and then run some aggressive SQL and CPU gets more then 50% consumption. It looks like it does not work to limit to 20%. WLM DBM settigs: WLM_DISPATCHER=YES WLM_DISP_CONCUR=COMPUTED WLM_DISP_CPU_SHARES=NO WLM_DISP_MIN_UTIL=5 WLM DB settings: WLM_COLLECT_INT=0 WLM_AGENT_LOAD_TRGT=AUTOMATIC(11) WLM_ADMISSION_CTRL=NO WLM_CPU_SHARES=1000 WLM_CPU_SHARE_MODE=HARD WLM_CPU_LIMIT=20folow– folow2022年10月11日 07:56:52 +00:00Commented Oct 11, 2022 at 7:56 -
Did you restart the instance after setting wlm_dispatcher - it can’t be set dynamically. You can set wlm_cpu_limit dynamically, but the syntax you used won’t do that.Ian Bjorhovde– Ian Bjorhovde2022年10月11日 22:18:56 +00:00Commented Oct 11, 2022 at 22:18
-
Yes, I have restarted the Db2 instance. I check CPU consumption in top Linux command and press I letter to get total percentage for all of the CPU cores.folow– folow2022年10月12日 09:40:55 +00:00Commented Oct 12, 2022 at 9:40