Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

turbokrist stops mining after encountering a 429 Too Many Requests error. #20

Open
CompaqDisc opened this issue Apr 1, 2017 · 2 comments

Comments

@CompaqDisc
Copy link

CompaqDisc commented Apr 1, 2017

Description

Turbokrist stops mining if it has submitted too many rejected solutions too quickly, encountering an HTTP 429: Too Many Requests

Expected Behavior

After encountering the HTTP error, Turbokrist should have either waited for the Retry-After response header's duration and keep mining or fully crash so that a script may restart it.

Steps to reproduce

  1. Let Turbokrist run for a while
  2. Turbokrist starts submitting many rejected solutions
  3. krist.ceriat.net returns an HTTP 429: Too Many Requests
  4. Turbokrist encounters an error, and stops mining without fully crashing

Other Information

Ubuntu 16.04.2 64-bit, GeForce GTX 950M: Driver 378.13

I discovered that krist.ceriat.net returns a pair of headers, X-Ratelimit-Remaining and X-Ratelimit-Limit, that can be used to check rates and halt requests in a timeout period. Rates seem to be per minute.

Error Report / Screenshot / Other Media

turbokrist.2017-04-01.00:02:51.snip.log

@CompaqDisc
Copy link
Author

CompaqDisc commented Apr 1, 2017

An extra look at the headers.

HTTP/1.1 429 Too Many Requests
Content-Type: text/html; charset=utf-8
Date: Sat, 01 Apr 2017 14:40:37 GMT
Server: Caddy
Vary: Accept
X-Ratelimit-Limit: 320
X-Ratelimit-Remaining: 0

And the normal ones.

HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET, POST, PUT, UPDATE, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Content-Length: 5911
Content-Type: text/html; charset=utf-8
Date: Sat, 01 Apr 2017 14:39:31 GMT
Server: Caddy
X-Ratelimit-Limit: 320
X-Ratelimit-Remaining: 67
X-Robots-Tag: none

@Lemmmy
Copy link
Collaborator

Lemmmy commented Apr 1, 2017

the limit is 320 requests in a 60 second window. after 240 requests in the window, your delays are delayed by 5n ms where n is the request number - 240

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants