|
| 1 | +--- |
| 2 | +title: Separate Ingest Box |
| 3 | +sidebar_title: Separate Ingest Box |
| 4 | +sidebar_order: 2 |
| 5 | +--- |
| 6 | + |
| 7 | +Other than having a [separate domain](/self-hosted/experimental/reverse-proxy/#expose-only-ingest-endpoint-publicly) to view the web UI and ingest data, you can also put a separate box (or server) for ingesting data, and have it relay data to the main box. This setup is recommended for high-traffic installations, and environment where you have multiple data centers. |
| 8 | + |
| 9 | +Using this setup also prevents DDOS attacks, since we assume your main box can only be accessed using some kind of VPN. If there are any invalid payload being sent to your Relay instance, it will be dropped immediately. If your main box is not reachable, your Relay will keep retrying to send the data. |
| 10 | + |
| 11 | +Please note that you don't need to have multiple data centers in different countries/regions. The region naming on the diagram is to make it easier to understand. |
| 12 | + |
| 13 | +```mermaid |
| 14 | +graph TB |
| 15 | + subgraph main [Main Sentry Server] |
| 16 | + direction TB |
| 17 | + nginx[External Nginx] |
| 18 | + sentry[Self-Hosted Sentry] |
| 19 | +
|
| 20 | + nginx --> sentry |
| 21 | + end |
| 22 | +
|
| 23 | + subgraph "US Ingest Server" |
| 24 | + direction TB |
| 25 | + internet1[Public Internet] |
| 26 | + relay1[Sentry Relay] |
| 27 | + end |
| 28 | +
|
| 29 | +
|
| 30 | + subgraph "Asia Ingest Server" |
| 31 | + direction TB |
| 32 | + internet2[Public Internet] |
| 33 | + relay2[Sentry Relay] |
| 34 | + end |
| 35 | +
|
| 36 | + subgraph "Europe Ingest Server" |
| 37 | + direction TB |
| 38 | + internet3[Public Internet] |
| 39 | + relay3[Sentry Relay] |
| 40 | + end |
| 41 | +
|
| 42 | + internet1 --> relay1 -- Through VPN tunnel --> main |
| 43 | + internet2 --> relay2 -- Through VPN tunnel --> main |
| 44 | + internet3 --> relay3 -- Through VPN tunnel --> main |
| 45 | +``` |
| 46 | + |
| 47 | +To configure the relay, you can install Sentry Relay on your machine through the [Relay Getting Started Guide](https://docs.sentry.io/product/relay/getting-started/). You should configure the Relay to run on `proxy` mode, and point it to the main Sentry server. You can also configure it to use a different port, or a different protocol (HTTP or HTTPS). |
| 48 | + |
| 49 | +A simple configuration for the relay would be: |
| 50 | + |
| 51 | +```yaml |
| 52 | +# Please see the relevant documentation. |
| 53 | +# Performance tuning: https://docs.sentry.io/product/relay/operating-guidelines/ |
| 54 | +# All config options: https://docs.sentry.io/product/relay/options/ |
| 55 | +relay: |
| 56 | + mode: proxy |
| 57 | + instance: default |
| 58 | + upstream: https://sentry.yourcompany.com/ |
| 59 | + host: 0.0.0.0 |
| 60 | + port: 3000 |
| 61 | + |
| 62 | +limits: |
| 63 | + max_concurrent_requests: 20 |
| 64 | + |
| 65 | +# To avoid having Out Of Memory issues, |
| 66 | +# it's recommended to enable the envelope spooler. |
| 67 | +spool: |
| 68 | + envelopes: |
| 69 | + path: /var/lib/sentry-relay/spool.db # make sure this path exists |
| 70 | + max_memory_size: 200MB |
| 71 | + max_disk_size: 1000MB |
| 72 | + |
| 73 | +# metrics: |
| 74 | +# statsd: "100.100.123.123:8125" |
| 75 | + |
| 76 | +sentry: |
| 77 | + enabled: true |
| 78 | + dsn: "https://[email protected]/1" |
| 79 | +``` |
| 80 | +
|
| 81 | +
|
| 82 | +<Alert level="info" title="Fun Fact"> |
| 83 | + Sentry SaaS use this similar setup for their ingestion servers, behind Google Anycast IP address. |
| 84 | +</Alert> |
0 commit comments