Skip to content

Commit d09044a

Browse files
authored
Merge pull request #5174 from platformsh/5173-peersjson-file
Add info about the peers.json file
2 parents 6f5da49 + 3f20960 commit d09044a

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

sites/upsun/src/languages/elixir.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,5 @@ applications:
188188
deploy: |
189189
mix do ecto.setup
190190
```
191+
## View application instance details {#view-application-instance-details}
192+
{{% view-instance-details %}}

sites/upsun/src/manage-resources/adjust-resources.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,28 @@ title= From the Console
220220

221221
{{< /note >}}
222222

223+
## View application instance details {#view-application-instance-details}
224+
{{% vendor/name %}} maintains a real-time indexed list of an application's instances and their IP addresses in the project's `/run/peers.json` file. You might view this read-only file to gain insight into how your application instances are distributed. Upsun maintains this file whether you scale instances manually or have autoscaling enabled.
225+
226+
Distributed applications (for example, those running on Elixir and Erlang) and applications that can scale horizontally must be aware of all its instances in order to coordinate activities such as setting up clusters and handling application failures.
227+
228+
The number of instances in this file at any time matches the number of application instances shown on the Configure Resources page of the Console.
229+
230+
To view the contents of the file, run this command from the root of your project directory:
231+
232+
```sh
233+
cat /run/peers.json | jq
234+
```
235+
236+
The output is similar to this:
237+
```json
238+
{
239+
"hello_distributed.1": "123.456.789.10",
240+
"hello_distributed.3": "123.456.789.20",
241+
"hello_distributed.2": "123.456.789.30",
242+
"hello_distributed.0": "123.456.789.40"
243+
}
244+
```
223245

224246
## Advanced: Container profiles
225247

sites/upsun/src/manage-resources/autoscaling.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ When autoscaling is enabled, [manual instance count](/manage-resources/adjust-re
9595

9696
{{< /note >}}
9797

98+
### View instance details
99+
{{% view-instance-details %}}
100+
98101
#### Default behaviour (CPU example)
99102

100103
- If CPU stays at **80% or higher for 5 minutes**, autoscaling adds an instance.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- shortcode start {{ .Name }} -->
2+
To understand how an application's instances are distributed, you can view the
3+
instance details in the project's `/run/peers.json` file. To learn more, see [View application instance details](/manage-resources/adjust-resources.md#view-application-instance-details) in the "Resource configuration" topic.
4+
<!-- shortcode end {{ .Name }} -->

0 commit comments

Comments
 (0)