# Unhealthy connection when querying

**URL:** <https://discuss.dgraph.io/t/unhealthy-connection-when-querying/19357>\
**Category:** Dgraph\
**Created:** [June 14, 2024, 5:52pm UTC](https://discuss.dgraph.io/t/unhealthy-connection-when-querying/19357 "2024-06-14T17:52:43Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![rebamun](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/rebamun/32/10378_2.png) [@rebamun](https://discuss.dgraph.io/u/rebamun)\
**Post date:** [July 26, 2024, 6:37pm UTC](https://discuss.dgraph.io/t/unhealthy-connection-when-querying/19357/10 "2024-07-26T18:37:37Z")

</div>

Thank you, Kevin!

Our self-managed production Dgraph cluster is running on six on-premises servers:

> [@Unable to reach leader in group 1 - dir structures help](https://discuss.hypermode.com/t/unable-to-reach-leader-in-group-1-dir-structures-help/18464/29):
>
> We’re running a RAID 5 (striped with 1 parity) and a hot spare with [SSD SAS Mix Use 12Gbps](https://www.serversupply.com/SSD%20W-TRAY/SAS-12GBPS/1.6TB/DELL/FDC8J_309232.htm) drives. The [RAM](https://www.dell.com/en-us/shop/dell-memory-upgrade-32gb-2rx4-ddr4-rdimm-2933mhz/apd/aa579531/memory) has the ECC data integrity checks. These are on 6x Dell R940s with an RPS. They’re supplied power through 2x UPSs.

Our current set up is a 9-node cluster: 3 Zeroes, 6 Alphas (two groups). Three machines run both a single Zero and a single Alpha, where as the other three run just a single Alpha. We have the latest version (`v24.0.0`) installed and running using Docker Swarm mode.

Our dataset is growing on the daily (although not as fast as we’d like it to with the amount of exceptions caused); but in our present `p` directories, there’s roughly 75GB in the Alpha Group #1 directories and 100GB in Alpha Group #2 directories.

We’re seeing the `Unhealthy connection` error in several different places. We see it most often (and very consistently) from our results service API, which uses dgraph4j to query Dgraph from our application. We’ve occasionally seen it from a separate client in our custom NiFi processor used to ingest the data, which also uses dgraph4j under the hood. However, as @rahst12 mentioned above, we also see this when cURLing directly using no client at all:

```auto
$ curl -H "Content-Type: application/dql" -X POST http://x.x.x.x:8080/query --data-binary '@query.json'

```

> [@rahst12](#):
>
> `{"errors":[{"message":": dispatchTaskOverNetwork: while retrieving connection.: Unhealthy connection","extensions":{"code":"ErrorInvalidRequest"}}],"data":null}`

I think that debugging over the phone next week could really help us out; but let us know if we can help with any more background information in the meantime!

---

_[View the full topic](https://discuss.dgraph.io/t/unhealthy-connection-when-querying/19357)._
