Okay. I've been running a miner for somewhat a week now and recently have set up the
flexible mining proxy, found on this forum. As i had some problems with that and wanted to understand, what's going on behind the curtain, i extended the codebase by some logging and a console window. By doing that and observing the output of the communication client<->proxy, i noticed a strange behaviour of the mining clients, that i do not understand:
The worker logs in to the proxy, new work is requested and forwarded to the client. The client starts processing.
So now, after 45-50 seconds the client logs in again and requests new work again, no matter if it has returned a result for the work it has previously requested or not.
It can happen multiple times in a row, that it re-requests new work, without returning something.
On the other hand it can happen, that the client is able to provide, say, 2-3 solutions within that said 45-50 second time frame.
So everything from 0-X results may get returned by the client between those calls to fetch new work - i supposed this is bases solely on luck.
Thing is, if it will not return something, the ratio requested:returned will go down, which, sounds bad and as a side-effect, it got me banned on BitcoinPool.com.
I tried a lot to figure out, why there is this re-request every 45-50 seconds and how to change it.
I even tried to implement a very basic throttle, that will keep track of the number of work units the client is currently working on and which blocks all further requests, until solutions for the these units are returned by the client. The throttling did not work as expected: the miner went somewhat crazy by not getting new work. The miner even ran out of work and stalled, when it was working on a work unit and for some reason kind of discarded it, without returning a solution for it, which would have freed up the slot for a new request.
tl;drThe client requests new work every ~45-50 seconds, no matter if it has returned a result for the previous work or not. This decreases request:returned ratio.
Why is that happening? Can this be prevented? Is there a good explanation about the techniques behind all this around? All i could find was some basic blah blah. :|
( A side question would be: what exactly does the client get from the pool? If mining solo, i work on a whole block, but what am i mining on when mining for a pool, exactly?
)
Here's a sample of my log:
[ 19.06.2011 13:56:10 ] [3] Polling BitcoinPool
[ 19.06.2011 13:56:11 ] [3] BitcoinPool responded.
[ 19.06.2011 13:56:11 ] [3]
Processing work for BitcoinPool (09fb56385d5851ce7533d20134635832)
-------------------------------------------------------------------------
[ 19.06.2011 13:56:33 ] [3] Worker returned work for BitcoinPool (09fb56385d5851ce7533d20134635832)
[ 19.06.2011 13:56:33 ] [3] Sending work to BitcoinPool ......
success!
[ 19.06.2011 13:56:34 ] [3] Work unit is:
valid-------------------------------------------------------------------------
[ 19.06.2011 13:56:55 ] [3] Worker returned work for BitcoinPool (09fb56385d5851ce7533d20134635832)
[ 19.06.2011 13:56:55 ] [3] Sending work to BitcoinPool ......
success!
[ 19.06.2011 13:56:56 ] [3] Work unit is:
valid-------------------------------------------------------------------------
[ 19.06.2011 13:57:01 ] [3] Polling BitcoinPool
[ 19.06.2011 13:57:02 ] [3] BitcoinPool responded.
[ 19.06.2011 13:57:02 ] [3]
Processing work for BitcoinPool (09bde84558a701a39f07224b3bc9c83c)
-------------------------------------------------------------------------
[ 19.06.2011 13:57:53 ] [3] Polling BitcoinPool
[ 19.06.2011 13:57:54 ] [3] BitcoinPool responded.
[ 19.06.2011 13:57:54 ] [3]
Processing work for BitcoinPool (5e779c1f2a8227810ccc1785f5835cd5)
-------------------------------------------------------------------------
Here you can see the first work request. Soon two solutions are found and returned for that work. After 51 seconds, new work is requested. After another 52 seconds, again, new work is requested and no result has been found in the meanwhile., efficiency goes down. *rinse-repeat*
Thank you for reading and for clearing things up for me!
krom