# UBA分散ビルドにおける分散先PCの使用コアを制限する

**URL:** <https://forums.unrealengine.com/t/uba-pc/2182736>\
**Category:** 日本語 (Japanese)\
**Tags:** unreal-engine, CPP\
**Created:** [December 8, 2024, 7:01am UTC](https://forums.unrealengine.com/t/uba-pc/2182736 "2024-12-08T07:01:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ken.Kuwano](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ken.Kuwano](https://forums.unrealengine.com/u/Ken.Kuwano)\
**Post date:** [December 8, 2024, 7:01am UTC](https://forums.unrealengine.com/t/uba-pc/2182736/1 "2024-12-08T07:01:59Z")

</div>

前提：UE5.5 以降で利用可能です。

# 1. 分散ビルドと並行して開発を行う際の問題

UBAを使用して分散ビルドを行う際、デフォルトでは登録したエージェント（Horde Agentをインストールされた、分散ビルドのビルドタスクを手助けするPC）のCPUコアをフルに使用してビルドが実行されます。これは発生した分散ビルドに対して、他のPCのCPUをフルに稼働して最短でビルドを完了させることができます。これは夜間などの、作業者が開発PCを使用していない状況においては有用ですが、日中など開発中のPCを稼働している状況においては、分散ビルドにCPUの作業を取られてしまうので、並行して作業を行うことが難しくなります。このような課題を設定によって調整が可能です。

# 2. 解決策

この課題は、分散先のPCで使用するCPUコア数を制限することによって対応が可能です。以下のappsettings.json ファイルを開いて、以下のような設定を追加することができます（以下のどちらかの値だけでも利用が可能です）。 **CpuCount** は、私用するCPUコア数を直接指定することができます。以下の設定値では “1コア” を分散ビルドに利用します。 **CpuMultiplier** は使用可能なコア数に対して、実際に使用するコア数の割合（32コア使用可能な際は16コアを上限に利用）を指定することができます。この設定を、エージェント登録するPCに適用することで、PCによっても分散ビルドに参加させるコア数を調整することが可能となります。

```auto
	"Horde":
	{
		"CpuCount": 1
		"CpuMultiplier": 0.5
	},

```

**C:\Program Files\Epic Games\Horde\Agent\appsettings.json**

 ![2024-12-08_15h35_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/6/5/e657f1a868dc906672d48e5ac00a6a881e0b0cc0.png)

上記の設定を行ったら、Horde Agentを再起動することで反映することができます。Horde Serverに登録された Agent をダッシュボードから選択して 「Request Restart」を選択することで再起動することができます。

 ![2024-12-08_15h36_10](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/a/d0a0f6ac7b2b79714d31d7a8c13ceffbed6eba00.png)

以下は分散PCで “CpuCount”: 1 を設定した際のモニターの表示で、12コア利用可能なPCに対しては1コアのみが分散ビルドに利用していることが確認できます。

 ![2024-12-08_15h21_48](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/7/2c78cb850c754c4c53e9ee1fa7ab201bbd63abe8.png)

---

<div class="post-metadata">

**Author:** ![wingedrobin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wingedrobin](https://forums.unrealengine.com/u/wingedrobin)\
**Post date:** [January 24, 2025, 3:44am UTC](https://forums.unrealengine.com/t/uba-pc/2182736/2 "2025-01-24T03:44:11Z")

</div>

Kuwanoさん こんにちは

I follow your instructions to modify the appsettings.json.  
But even using CpuCount as 1 or CpuMultiplier as 0.5 both not work.  
All my CPUs (or threads) are still been used to handle the compilation.  
Did I miss something?  
(I did do “Request Restart” after modified the appsettings.json)

UE ver: 5.5.1  
horde agent ver: 5.5.0-37571337

---

<div class="post-metadata">

**Author:** ![Ken.Kuwano](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ken.Kuwano](https://forums.unrealengine.com/u/Ken.Kuwano)\
**Post date:** [January 27, 2025, 2:21am UTC](https://forums.unrealengine.com/t/uba-pc/2182736/3 "2025-01-27T02:21:37Z")

</div>

Hi @wingedrobin,  
I have checked this with ue5-main stream and I believe it will actually be introduced in ue5.6. It is also possible to cherry-pick this.

[https://github.com/EpicGames/UnrealEngine/commit/37fd878d376457449e73ef08201e1ab70f83db30](https://github.com/EpicGames/UnrealEngine/commit/37fd878d376457449e73ef08201e1ab70f83db30)

Thanks

---

<div class="post-metadata">

**Author:** ![wingedrobin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wingedrobin](https://forums.unrealengine.com/u/wingedrobin)\
**Post date:** [January 28, 2025, 4:35am UTC](https://forums.unrealengine.com/t/uba-pc/2182736/4 "2025-01-28T04:35:02Z")

</div>

Kuwanoさん ありがとうございました

I’ll give it a try when the lunar new year finishes.
