Discussion:
haproxy support for stratum protocol ?
j***@protonmail.com
2018-10-09 13:04:10 UTC
Permalink
Hello,

Please CC me as I'm not subscribed on the list.
Does haproxy will consider support for the stratum protocol ?

Thanks,
Julien
j***@protonmail.com
2018-10-09 16:15:10 UTC
Permalink
Yes, that's it. I was not aware of this spec.

My use case is to try to set up a mining farm based on Raspberry-Pis. I did a study showing that it's much more efficient for the same price or power user as a PC :

https://www.linkedin.com/pulse/more-efficient-mining-raspberry-pi-julien-delorme/

The problem is that some pools will ban my IP address if I create too many parallel connections, so it makes sense to use an agregating proxy to do this :

=>
30*RPi => haproxy => pool (1 single connection)
=>

And since haproxy is already used a lot and recommanded for this use case (principally to give active-backup fonction between pools), I think it will interest many of users to be able to improve their capacity and reduce the risk to be banned.

So do you think it is something possible ?

J.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Hi.
Post by j***@protonmail.com
Hello,
Please CC me as I'm not subscribed on the list.
Does haproxy will consider support for the stratum protocol ?
Do you mean this?
http://stratumprotocol.org/
Post by j***@protonmail.com
Thanks,
Julien
Regards
Aleks
Willy Tarreau
2018-10-09 16:32:10 UTC
Permalink
Post by j***@protonmail.com
Yes, that's it. I was not aware of this spec.
My use case is to try to set up a mining farm based on Raspberry-Pis. I did a
study showing that it's much more efficient for the same price or power user
https://www.linkedin.com/pulse/more-efficient-mining-raspberry-pi-julien-delorme/
Fun project there reminding me the build farm. I've left a comment with
some links to much better hardware than RPis :-)
Post by j***@protonmail.com
And since haproxy is already used a lot and recommanded for this use case
(principally to give active-backup fonction between pools), I think it will
interest many of users to be able to improve their capacity and reduce the
risk to be banned.
I was not aware of this. Do you have any link ?
Post by j***@protonmail.com
So do you think it is something possible ?
Well, a quick look at the spec suggests HTTP for old versions and TCP for
new ones if I understand correctly. HTTP could theorically be merged using
"http-reuse" and "maxconn 1" on the server. However you will not get any
pipelining, I don't know if that's important or not (if the server takes
a long time to respond, your clients will have to wait for other responses
first). For the TCP one, I'm pretty certain that for now it's not supported,
and I don't really have an idea about what would be needed to support this,
very likely implementing multiplexed transactions, which would be more or
less as complicated as HTTP pipelining.

However the protocol looks easy enough to parse (JSON?) so I wouldn't be
surprised if you could implement it entirely using Lua.

Regards,
Willy
j***@protonmail.com
2018-10-09 16:58:37 UTC
Permalink
Post by Willy Tarreau
Post by j***@protonmail.com
My use case is to try to set up a mining farm based on Raspberry-Pis. I did a
study showing that it's much more efficient for the same price or power user
https://www.linkedin.com/pulse/more-efficient-mining-raspberry-pi-julien-delorme/
Fun project there reminding me the build farm. I've left a comment with
some links to much better hardware than RPis :-)
Oh thanks, I will check there!
Post by Willy Tarreau
Post by j***@protonmail.com
And since haproxy is already used a lot and recommanded for this use case
(principally to give active-backup fonction between pools), I think it will
interest many of users to be able to improve their capacity and reduce the
risk to be banned.
I was not aware of this. Do you have any link ?
My pleasure!
https://www.reddit.com/r/Monero/comments/5io4u3/simple_mining_proxy_setup_using_haproxy_or_who/
https://github.com/xmrig/xmrig-proxy/wiki/TLS
https://imgur.com/a/wrPw6
https://github.com/turtlecoin/turtlecoin/wiki/TurtleCoind-behind-HAProxy

As you can see its pretty common. People use it for automatic fail-over to cover maintenance windows, so its placed on the client side, which is not very common I think.
Post by Willy Tarreau
However the protocol looks easy enough to parse (JSON?) so I wouldn't be
surprised if you could implement it entirely using Lua.
I don't have much knowledge there so I'll possibly have to wait for someone else to have this idea ^^

Thanks,
J.
Willy Tarreau
2018-10-09 17:08:33 UTC
Permalink
Post by j***@protonmail.com
Post by Willy Tarreau
Post by j***@protonmail.com
My use case is to try to set up a mining farm based on Raspberry-Pis. I did a
study showing that it's much more efficient for the same price or power user
https://www.linkedin.com/pulse/more-efficient-mining-raspberry-pi-julien-delorme/
Fun project there reminding me the build farm. I've left a comment with
some links to much better hardware than RPis :-)
Oh thanks, I will check there!
No, thanks to you, I've just found in your patch here an example of how
to use ARMv8's CRC32 instruction (which is trivial by the way) and which
has been staying on my todo list for ages :

https://github.com/tpruvot/cpuminer-multi/pull/29

We use CRC32 in libslz for the gzip compression, I should give it a try,
it could bring gzip performance closer to deflate on ARM64, which could
be nice for those running hosting services on cheap ARM servers.
Post by j***@protonmail.com
Post by Willy Tarreau
Post by j***@protonmail.com
And since haproxy is already used a lot and recommanded for this use case
(principally to give active-backup fonction between pools), I think it will
interest many of users to be able to improve their capacity and reduce the
risk to be banned.
I was not aware of this. Do you have any link ?
My pleasure!
https://www.reddit.com/r/Monero/comments/5io4u3/simple_mining_proxy_setup_using_haproxy_or_who/
https://github.com/xmrig/xmrig-proxy/wiki/TLS
https://imgur.com/a/wrPw6
https://github.com/turtlecoin/turtlecoin/wiki/TurtleCoind-behind-HAProxy
As you can see its pretty common. People use it for automatic fail-over to
cover maintenance windows, so its placed on the client side, which is not
very common I think.
I see, that probably makes sense, indeed. We're used to say that haproxy
is a Swiss-army-knife anyway :-)

Willy

Loading...