handshake-org / hs-miner

Mining infrastructure for handshake
Other
74 stars 19 forks source link

Requests time out when CPU is used #17

Open rhn opened 4 years ago

rhn commented 4 years ago

Every request done after the work had started when using the CPU backend times out.

I'm not sure about the proper solution, but when I limited the number of CPUs used:

for (let i = 0; i < this.count - 1; i++) {

the requests don't time out any more.

pinheadmz commented 4 years ago

Hm. What kind of computer are you using? Hardware/ CPU count / OS ?

If you run bin/hs-bench --backend=simple what kind of stats do you get? Does the threads value match the number of CPUs you have?

Also worth noting, Handshake mainnet difficulty is way beyond the reach of CPU mining, so I hope you're just testing...

rhn commented 4 years ago

That's a Linux 8 thread machine. I suspect this is something related to running out of worker threads.

I was testing the viability of CPU mining :)

rhn commented 4 years ago
bin/hs-bench --backend=simple
Backend: simple, Device: -1
Ops: 1000000, Threads: 8, Grids: 0, Blocks: 0, Iterations: 10

Thread count matches the CPU.

pinheadmz commented 4 years ago

Hm well you can run hs-miner with --threads=7. We have similar issues with GPUs and block / thread size. The miner does not automatically tune to the hardware, at this point it requires some manual tweaking. On my computer (with 4 CPUs) it runs fine and I can even get > 4 threads (for some reason...?).

rhn commented 4 years ago

That counts as a workaround, but there's a clear deadlock in there somewhere related (probably) to the async event loop, which is what I'm really reporting.

rhn commented 4 years ago

It's possible that this is what's going on here: https://news.ycombinator.com/item?id=22514388