---
title: "Quotas"
url: https://develop.sentry.dev/backend/application-domains/quotas/
---

# Quotas

With the way Sentry works you may find yourself in a situation where you’ll see too much inbound traffic without a good way to drop excess messages. There’s a few solutions to this, and you’ll likely want to employ them all if you are faced with this problem.

## [Event Quotas](https://develop.sentry.dev/backend/application-domains/quotas.md#event-quotas)

One of the primary mechanisms for throttling workloads in Sentry involves setting up event quotas. These can be configured per project as well as system wide and will allow you to limit the maximum number of events accepted within a 60 second period of time.

### [Configuration](https://develop.sentry.dev/backend/application-domains/quotas.md#configuration)

The primary implementation uses Redis, and simply requires you to configure the connection information:

```python
SENTRY_QUOTAS = 'sentry.quotas.redis.RedisQuota'
```

By default, this will use the `default` named Redis cluster. To use a different cluster, provide the `cluster` option, as such:

```python
SENTRY_QUOTA_OPTIONS = {
    'cluster': 'quota',
}
```

If you have additional needs, you’re freely available to extend the base Quota class just as the Redis implementation does.

### [System-wide Rate Limiting](https://develop.sentry.dev/backend/application-domains/quotas.md#system-wide-rate-limiting)

You can configure the system-wide maximum per-minute rate limit:

```yaml
system.rate-limit: 500
```

For example, in your project's `sentry.conf.py`, you can do something like this:

```python
from sentry.conf.server import SENTRY_OPTIONS


SENTRY_OPTIONS['system.rate-limit'] = 500
```

Alternatively, if you navigate to `/manage/settings/` you will find an admin panel with an option for setting `Rate Limit`, which gets stored in your quota implementation described above.

### [User-based Rate Limiting](https://develop.sentry.dev/backend/application-domains/quotas.md#user-based-rate-limiting)

You can configure the user-based maximum per-minute rate limit:

```yaml
auth.user-rate-limit: 100
auth.ip-rate-limit: 100
```

### [Project-based Rate Limiting](https://develop.sentry.dev/backend/application-domains/quotas.md#project-based-rate-limiting)

For doing project-based rate limiting, click on a project's `Settings`. Under the `Client Keys (DSN)` tab, find the key that you'd like to rate-limit, and click the corresponding `Configure` button. That should bring up key/project-specific rate-limiting settings.

## [Notification Rate Limits](https://develop.sentry.dev/backend/application-domains/quotas.md#notification-rate-limits)

In some cases there may be concerns about limiting things such as outbound email notifications. To address this Sentry provides a rate limits subsystem which supports arbitrary rate limits.

### [Configuration](https://develop.sentry.dev/backend/application-domains/quotas.md#configuration-1)

Like event quotas, the primary implementation uses Redis:

```python
SENTRY_RATELIMITER = 'sentry.ratelimits.redis.RedisRateLimiter'
```

By default, this will use the `default` named Redis cluster. To use a different cluster, provide the `cluster` option, as such:

```python
SENTRY_RATELIMITER_OPTIONS = {
    'cluster': 'ratelimiter',
}
```
