# Too many connections to DB, how to optimize

**URL:** <https://meta.discourse.org/t/too-many-connections-to-db-how-to-optimize/66395>\
**Category:** Product Support\
**Created:** [18 يوليو 2017، 3:40م UTC](https://meta.discourse.org/t/too-many-connections-to-db-how-to-optimize/66395 "2017-07-18T15:40:01Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![TomekB](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomekb/32/66593_2.png) [@TomekB](https://meta.discourse.org/u/TomekB)\
**Post date:** [19 يوليو 2017، 12:19م UTC](https://meta.discourse.org/t/too-many-connections-to-db-how-to-optimize/66395/15 "2017-07-19T12:19:41Z")

</div>

```
select pg_size_pretty(pg_database_size('discourse'));

```

returns 55 GB

The directory\_items table is 207 MB.

---

_[View the full topic](https://meta.discourse.org/t/too-many-connections-to-db-how-to-optimize/66395)._
