# 502 bad gateway on specific searches

**URL:** https://meta.discourse.org/t/502-bad-gateway-on-specific-searches/104616
**Category:** Self-hosting
**Created:** [12월 19, 2018, 2:53오전 UTC](https://meta.discourse.org/t/502-bad-gateway-on-specific-searches/104616 "2018-12-19T02:53:06Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12월 19, 2018, 12:47오후 UTC](https://meta.discourse.org/t/502-bad-gateway-on-specific-searches/104616/5 "2018-12-19T12:47:59Z")

</div>

> [@CT075](#):
>
> I wonder if it was just postgres “warming up”.

Very likely, if for any reason a search takes longer than 30 seconds you will see this kind of timeout. The web worker gets killed and NGINX sends a 502.

- How many topics/posts are there on your forum?
- What are the specs of your server?
- If this is an import it may make sense to run a full vacuum [VACUUM FULL - PostgreSQL wiki](https://wiki.postgresql.org/wiki/VACUUM_FULL) `./launcher enter app` and then `sudo -u postgres psql discourse` …

---

_[View the full topic](https://meta.discourse.org/t/502-bad-gateway-on-specific-searches/104616)._
