Skip to content

Commit

Permalink
update outdated info (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
brody192 authored Jan 23, 2025
1 parent 86c8485 commit 9b8faf5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
39 changes: 18 additions & 21 deletions src/docs/guides/optimize-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,36 @@ Continue reading for information on how to configure these.

Scale horizontally by manually increasing the number of replicas for a service.

<Image src="https://res.cloudinary.com/railway/image/upload/v1684534939/docs/Export-replica_lrtrvs.png"
alt="Screenshot of replica setting"
layout="responsive"
width={800} height={317} quality={100} />
Railway's infrastructure spans multiple regions across the globe, and by default Railway deploys to `us-west1` located in Portland, Oregon.

<Image
src="https://res.cloudinary.com/railway/image/upload/v1733386054/multi-region-replicas_zov7rv.png"
alt="Multi-region replicas"
layout="responsive"
width={1370}
height={934}
/>

To change the number of replicas per deploy within your service, go to the service settings view and look for the "Replicas" field in the "Deploy" section. This will create multiple instances of your service and distribute traffic between them.

### Replica ID Environment Variable
To change the number of replicas per deploy within your service, go to the service settings view and look for the "Regions" field in the "Deploy" section. This will create multiple instances of your service and distribute traffic between them.

Each replica will be deployed with a Railway-provided environment variable named `RAILWAY_REPLICA_ID` which can be used for logging and monitoring, for example.
*Additional regions may be added in the future as Railway continues expanding its infrastructure footprint.*

### Load Balancing Between Replicas
### Replica ID Environment Variable

At the moment, Railway will randomly distribute requests to the replicas of your service. We plan to add more advanced load balancing strategies in the future. If you need more advanced load balancing, you can use an external load balancer such as Cloudflare to distribute traffic between your services.
Each replica will be deployed with a Railway-provided environment variable named `RAILWAY_REPLICA_ID` which can be used for logging and monitoring, for example.

**Note:** For now Railway does not support sticky sessions nor report the usage of the replicas within the metrics view.
### Replica Region Environment Variable

## Configure a Region
Each replica will be deployed with a Railway-provided environment variable named `RAILWAY_REPLICA_REGION` which can be used for logging and monitoring, for example.

Railway's infrastructure spans multiple regions across the globe, and by default Railway deploys to `us-west1` located in Portland, Oregon.
### Load Balancing Between Replicas

To choose a different region for your service, go to your service settings and select the desired region -
If you are using multi-region replicas, Railway will automatically route public traffic to the nearest region and then randomly distribute requests to the replicas within that region.

<Image
quality={100}
width={1359}
height={651}
src="https://res.cloudinary.com/railway/image/upload/v1695660846/docs/service_region_picker.png"
alt="Region Picker"
/>
If you are using a single region with multiple replicas, Railway will randomly distribute public traffic to the replicas of that region.

*Additional regions may be added in the future as Railway continues expanding its infrastructure footprint.*
**Note:** For now Railway does not support sticky sessions nor report the usage of the individual replicas within the metrics view, all metrics are aggregated across all replicas in all regions.

### Set a Default Region

Expand Down
2 changes: 1 addition & 1 deletion src/docs/reference/deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ In practice, this means that if you trigger a new deploy either [manually](/guid

Once the new deployment is online, the old deployment is sent a SIGTERM signal and given 3 seconds to gracefully shutdown before being forcefully stopped with a SIGKILL. We do not send any other signals under any circumstances.

The time given to gracefully shutdown can be controlled by setting a [`RAILWAY_DEPLOYMENT_OVERLAP_SECONDS`](/reference/variables#user-provided-configuration-variables) [service variable](/overview/the-basics#service-variables).
The time given to gracefully shutdown can be controlled by setting a [`RAILWAY_DEPLOYMENT_DRAINING_SECONDS`](/reference/variables#user-provided-configuration-variables) [service variable](/overview/the-basics#service-variables).

## Support

Expand Down
4 changes: 3 additions & 1 deletion src/docs/reference/scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ Creating, deleting, and re-assigning replicas will trigger a staged change which

#### Load Balancing Between Replicas

Railway will randomly distribute requests to the replicas of a service. If you need more advanced load balancing, you can use an external load balancer such as Cloudflare to distribute traffic between your services.
If you are using multi-region replicas, Railway will automatically route public traffic to the nearest region and then randomly distribute requests to the replicas within that region.

If you are using a single region with multiple replicas, Railway will randomly distribute public traffic to the replicas of that region.

We plan to add more advanced load balancing strategies in the future.

Expand Down

0 comments on commit 9b8faf5

Please sign in to comment.