# How to check Limits

**URL:** <https://drone.discourse.group/t/how-to-check-limits/10257>\
**Category:** Drone FAQ\
**Created:** [November 2, 2019, 5:29pm UTC](https://drone.discourse.group/t/how-to-check-limits/10257 "2019-11-02T17:29:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 2, 2019, 5:29pm UTC](https://drone.discourse.group/t/how-to-check-limits/10257/1 "2019-11-02T17:29:49Z")

</div>

This guide has been moved to  
[https://docs.drone.io/enterprise/usage/](https://docs.drone.io/enterprise/usage/)

* * *

This document describes how to check your user and repository count. This is helpful for companies that have purchased, or are interested in purchasing, a commercial license and want to evaluate their current usage.

## Verify Limits

If you have an existing commercial license, your user and repository limits are printed to the console when the server starts.

```diff
{
  "build.limit": 0,
  "expires": "0001-01-01T00:00:00Z",
  "kind": "standard",
  "level": "debug",
  "msg": "main: license loaded",
+ "repo.limit": 25,
  "time": "2019-11-02T10:43:11-07:00",
+ "user.limit": 25
}

```

## Finding Counts

You can find the total count of users and the total count of active repositories by visiting the `/metrics` endpoint in your browser. These are provided by the `drone_user_count` and `drone_repo_count` metrics, respectively. _Note that you must have the system admin role to visit this endpoint_.

```auto
# HELP drone_repo_count Total number of registered repositories.
# TYPE drone_repo_count gauge
drone_repo_count 54

# HELP drone_user_count Total number of active users.
# TYPE drone_user_count gauge
drone_user_count 24

```

You should compare your counts to your license limits.

## Listing Resources

You can get a list of all users from the database using the below query, or you can use the command line utility [1] to list all users.

```nohighlight
SELECT user_login FROM users

```

You can get a list of all active repositories from the database using the below query. _Note the user interface only show repositories for which you are a collaborator and is therefore not expected to show all repositories, even if you are a system admin._

```nohighlight
SELECT repo_slug FROM repos WHERE repo_active = true

```

## Removing Resources

You can de-activate a repository using the command line utility [2] or by navigating to the repository settings page in the user interface and clicking the _Disable_ button.

```nohighlight
drone repo rm octocat/hello-world

```

You can remove user accounts using the command line utility [3]. _Please note that if you remove a user account, and that user account activated a repository, it will need to be de-activated and then re-activated by another user._

```nohighlight
drone user rm octocat

```

[1] [https://docs.drone.io/cli/commands/user/drone-user-ls/](https://docs.drone.io/cli/commands/user/drone-user-ls/)  
[2] [https://docs.drone.io/cli/commands/repo/drone-repo-rm/](https://docs.drone.io/cli/commands/repo/drone-repo-rm/)  
[3] [https://docs.drone.io/cli/commands/user/drone-user-rm/](https://docs.drone.io/cli/commands/user/drone-user-rm/)

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 2, 2019, 5:29pm UTC](https://drone.discourse.group/t/how-to-check-limits/10257/2 "2019-11-02T17:29:53Z")

</div>


