

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# unicorn 屬性
<a name="attributes-recipes-unicorn"></a>

**重要**  
 AWS OpsWorks Stacks 此服務已於 2024 年 5 月 26 日終止，並已針對新客戶和現有客戶停用。我們強烈建議客戶盡快將其工作負載遷移至其他解決方案。如果您對遷移有任何疑問，請透過 [AWS re：Post](https://repost.aws/) 或透過 [AWS Premium Support](https://aws.amazon.com/support) 聯絡 AWS 支援 團隊。

**注意**  
這些屬性僅適用於 Linux 堆疊。

[`unicorn` 屬性](https://github.com/aws/opsworks-cookbooks/blob/release-chef-11.10/unicorn/attributes/default.rb)指定 [Unicorn](http://unicorn.bogomips.org/) 組態。如需詳細資訊，請參閱 [Unicorn::Configurator](http://unicorn.bogomips.org/Unicorn/Configurator.html)。如需如何覆寫內建屬性以指定自訂值的詳細資訊，請參閱[覆寫屬性](workingcookbook-attributes.md)。


****  

|  |  |  | 
| --- |--- |--- |
| [accept\$1filter](#attributes-recipes-unicorn-accept) | [backlog](#attributes-recipes-unicorn-backlog) | [延遲](#attributes-recipes-unicorn-delay) | 
| [tcp\$1nodelay](#attributes-recipes-unicorn-nodelay) | [tcp\$1nopush](#attributes-recipes-unicorn-nopush) | [preload\$1app](#attributes-recipes-unicorn-preload) | 
| [timeout](#attributes-recipes-unicorn-timeout) | [tries](#attributes-recipes-unicorn-tries) | [version](#attributes-recipes-unicorn-version) | 
| [worker\$1processes](#attributes-recipes-unicorn-worker) |  |  | 

**accept\$1filter**  <a name="attributes-recipes-unicorn-accept"></a>
接受篩選條件 `'httpready'` 或 `'dataready'` (字串)。預設值為 `'httpready'`。  

```
node[:unicorn][:accept_filter]
```

**backlog**  <a name="attributes-recipes-unicorn-backlog"></a>
佇列可保留的請求數目上限 (數值)。預設值為 `1024`。  

```
node[:unicorn][:backlog]
```

**延遲**  <a name="attributes-recipes-unicorn-delay"></a>
等待重試繫結通訊端的時間，以秒為單位 (數值)。預設值為 `0.5`。  

```
node[:unicorn][:delay]
```

**preload\$1app**  <a name="attributes-recipes-unicorn-preload"></a>
是否預先載入應用程式，再分支處理工作者處理序 (布林值)。預設值為 `true`。  

```
node[:unicorn][:preload_app]
```

**tcp\$1nodelay**  <a name="attributes-recipes-unicorn-nodelay"></a>
是否停用 TCP 通訊端的 Nagle 演算法 (布林值)。預設值為 `true`。  

```
node[:unicorn][:tcp_nodelay]
```

**tcp\$1nopush**  <a name="attributes-recipes-unicorn-nopush"></a>
是否啟用 TCP\$1CORK (布林值)。預設值為 `false`。  

```
node[:unicorn][:tcp_nopush]
```

**timeout**  <a name="attributes-recipes-unicorn-timeout"></a>
工作者可用於每個請求的時間上限，以秒為單位 (數值)。超過逾時值的工作者會終止。預設值為 `60`。  

```
node[:unicorn][:timeout]
```

**tries**  <a name="attributes-recipes-unicorn-tries"></a>
重試繫結至通訊端的次數上限 (數值)。預設值為 `5`。  

```
node[:unicorn][:tries]
```

**version**  <a name="attributes-recipes-unicorn-version"></a>
Unicorn 版本 (字串)。預設值為 `'4.7.0'`。  

```
node[:unicorn][:version]
```

**worker\$1processes**  <a name="attributes-recipes-unicorn-worker"></a>
工作者處理序數目 (數值)。如果存在，預設值為 `max_pool_size`；否則為 `4`。  

```
node[:unicorn][:worker_processes]
```