<p>Holding one connection per worker is highly inefficient and will cause a lot of traffic going through your network. The preferred way to do this is to condense all your work behind some proxy. You don't need to have only one proxy. Multiple proxies with dozens or hundreds of devices per proxy is fine too.</p>
<p>As for the diff, the proxy may set a high enough diff that you'll generate a few shares per minute in all machines, to reduce network traffic.</p>

CC BY-SA 4.0
2023-12-28T10:17:21.143Z
Like if I have 1000 workers, I make 10 proxies with 100 workers each ?

And these 10 proxies with one connection for each worker to the pool or only one for the proxy (100 workers) ? 

If single connection for one proxy how do I share the job to the workers ? Do I give each worker the job gived by the pool or I create sub job of my own ? 

Thanks you for your time I really apreciate it
ByFish
CC BY-SA 4.0
2023-12-28T19:55:35.460Z
`Like if I have 1000 workers, I make 10 proxies with 100 workers each ?` exactly. Ideally, you'd give different jobs to each worker. One way you can do that by assigning different extra-nonce spaces to each work. So you get a job from the pool with e.g. 32-bit extra-nonce space and you break that down into multiple, per proxy spaces.
Davidson Souza
CC BY-SA 4.0
2023-12-29T10:21:16.037Z
Thanks you for your precious advices, are you available somewhere I can contact you to go deeper in technical things? (@ByFishh on twitter)
ByFish
CC BY-SA 4.0
2023-12-27T18:11:10.403Z
2023-12-27T18:11:10.403Z
Davidson Souza
<p>I'm currently trying to code my own BTC proxy mining pool that need to handle at least 20k workers but I'm still in need of information to build it correctly.</p>
<p>My main inquiry is about the TCP connection between my proxy pool and the pool.</p>
<p><strong>Should I need to open a connection between the proxy and the pool for each worker or should I create a single connection for all worker in my proxy?</strong></p>
<p>I think the best option in my case is the second one (open 20k connections with the same ip may result as ban?) but it implies more work to do and understanding.</p>
<p><strong>In that case how should I manage the high difficulty of the pool and the vardiff?</strong></p>
<p>Thanks you for you answer and don't hesitate to share me all interesting links you have about it!</p>

<mining-pools><stratum><proxy>
Is it better to have multiple connections with stratum protocol or a single one for the entire proxy to the pool?
ByFish
# Is it better to have multiple connections with stratum protocol or a single one for the entire proxy to the pool?

(Asked by: username_0 on 2023-12-26)

I'm currently trying to code my own BTC proxy mining pool that need to handle at least 20k workers but I'm still in need of information to build it correctly.

My main inquiry is about the TCP connection between my proxy pool and the pool.

**Should I need to open a connection between the proxy and the pool for each worker or should I create a single connection for all worker in my proxy?**

I think the best option in my case is the second one (open 20k connections with the same ip may result as ban?) but it implies more work to do and understanding.

**In that case how should I manage the high difficulty of the pool and the vardiff?**

Thanks you for you answer and don't hesitate to share me all interesting links you have about it!

**Tags:** mining-pools, stratum, proxy


---

## 1 answers

### Answer by username_1 on 2023-12-27. Score: 2

Holding one connection per worker is highly inefficient and will cause a lot of traffic going through your network. The preferred way to do this is to condense all your work behind some proxy. You don't need to have only one proxy. Multiple proxies with dozens or hundreds of devices per proxy is fine too.

As for the diff, the proxy may set a high enough diff that you'll generate a few shares per minute in all machines, to reduce network traffic.

> **Comments:**
> **username_0**: Like if I have 1000 workers, I make 10 proxies with 100 workers each ?  And these 10 proxies with one connection for each worker to the pool or only one for the proxy (100 workers) ?   If single connection for one proxy how do I share the job to the workers ? Do I give each worker the job gived by the pool or I create sub job of my own ?   Thanks you for your time I really apreciate it  
> **username_1**: `Like if I have 1000 workers, I make 10 proxies with 100 workers each ?` exactly. Ideally, you'd give different jobs to each worker. One way you can do that by assigning different extra-nonce spaces to each work. So you get a job from the pool with e.g. 32-bit extra-nonce space and you break that down into multiple, per proxy spaces.  
> **username_0**: Thanks you for your precious advices, are you available somewhere I can contact you to go deeper in technical things? (@ByFishh on twitter)  

---

