# Advanced customizations (Helm)

{% hint style="info" %}
This documentation only applies to **advanced Orchestrated container deployments** using **Kubernetes** and **Helm**
{% endhint %}

* [Custom Analytics Toolbox location](#custom-analytics-toolbox-location)
* [Allow embedding CARTO into an iframe](#allow-embedding-carto-into-an-iframe)
* [Enabling/Disabling TrackJS](#enabling-disabling-trackjs)
* [Customizable values for NGINX router](#marked-customizable-values-for-nginx-router)
* [External Data warehouse tuning](#external-data-warehouse-tuning)

### Custom Analytics Toolbox location

The default location of the Analytics Toolbox can be customized for all connections in your CARTO Self-Hosted installation. If you edit this value, each new connection will have the AT location configured in the specified location:

Update your config in the <mark style="color:orange;">customizations.yaml</mark> file:

```yaml
appConfigValues:
  defaultAtLocation:
    bigquery: "carto-un.carto"
    snowflake: "CARTO.CARTO"
    redshift: "carto"
    databricks: "carto"
    postgres: "carto"
```

### Allow embedding CARTO into an iframe

CARTO Self-Hosted is prepared to be allowed into an iframe when needed. This way, custom applications using CARTO can work without any issue from an iframe. In order to allow your application using the platform through an iframe, you'll have to configure the allowed domains that can embed CARTO:

Update your <mark style="color:orange;">customizations.yaml</mark> file:

```
router:
  extraEnvVars:
    - name: IFRAME_ALLOWED_DOMAINS
      value: "https://mydomain1.com https://mydomain2.com:8080"
```

### Enabling/Disabling TrackJS

TrackJS is a useful tool as it provides valuable insights into the performance and errors occurring within the CARTO platform.

TrackJS is enabled by default in the frontend components, but you can disable adding the following config in the <mark style="color:orange;">customizations.yaml</mark> file:

```yaml
appConfigValues:
    enableTrackJS: false
```

### Customizable values for NGINX router <a href="#marked-customizable-values-for-nginx-router" id="marked-customizable-values-for-nginx-router"></a>

The CARTO Self-Hosted deployment exposes the 443 port through a component called `router`, which is running a NGINX service under the hood. The following customization options are available for this service:

```yaml
router:
  extraEnvVars:
    - name: NGINX_CLIENT_MAX_BODY_SIZE
      value: "10M"
    - name: NGINX_GZIP_MIN_LENGTH
      value: "1100"
    - name: NGINX_GZIP_BUFFERS
      value: "16 8k"
    - name: NGINX_PROXY_BUFFERS
      value: "16 8k"
    - name: NGINX_PROXY_BUFFER_SIZE
      value: "8k"
    - name: NGINX_PROXY_BUSY_BUFFERS_SIZE
      value: "8k"
```

### External Data warehouse tuning

CARTO Self-Hosted connects to your data warehouse to perform different operations with your data. When connecting it with Postgres or Redshift, it's important to understand how the connection pool works.

Each node will have a connection pool controlled by the environment variables `MAPS_API_V3_POSTGRES_POOL_SIZE` and `MAPS_API_V3_REDSHIFT_POOL_SIZE`. The pool is per connection created from CARTO Self Hosted. If each user creates a different connection, each one will have its own pool. The maximum connections can be calculated with the following formula:

```
max_connections = pool_size * number_connections * number_nodes;
```

When a request is sent to an external data warehouse, we're applying some limits on the amount of time that a query can take to finish. If you'd like to customize the timeout applied to the queries executed against your data warehouse, you'll have to edit the following environment variables:

```
MAPS_API_V3_DYNAMIC_TILES_QUERY_TIMEOUT_POSTGRES_MS=20000
MAPS_API_V3_DYNAMIC_TILES_QUERY_TIMEOUT_REDSHIFT_MS=20000
MAPS_API_V3_DYNAMIC_TILES_QUERY_TIMEOUT_SNOWFLAKE_MS=20000
MAPS_API_V3_DYNAMIC_TILES_QUERY_TIMEOUT_BIGQUERY_MS=20000
MAPS_API_V3_DYNAMIC_TILES_QUERY_TIMEOUT_DATABRICKS_MS=20000
```

Their default value is set to 20 seconds. Please take into account that the updated value should be specified in milliseconds.
