-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/api/v2/update consistently times out #154
Comments
Sounds like the database is finally too large! This was definitely something I wanted to keep simple until we hit scaling issues, so I guess now is that time. Feel free to revise any architecture decisions. :-) |
I did some experimenting with increasing the timeout on my workstation and here are the results: 15 second timeout: First call to /api/v2/update succeeds in loading all 51,718 HSTS entries into the database. Subsequent requests still time out.
If I reduce the 60 seconds to 59 seconds, that error goes away. That error appears to come from https://github.com/golang/appengine/blob/master/internal/metadata.go#L35; I haven't tracked down why that gets called from appengine.Main() in server.go. I also think that's a red herring for the problem here. I find it hard to believe that this failure is just because of the size of the database. It takes about 1 second to fetch and parse the JSON file from chromium source, which contains the entire contents of the database (when running the server locally). Even |
I added some logging to PutStates and statesForQuery (the latter included a trial code change to use |
Are you testing using the local emulator or a prod/test environment connecting to GCE? The local emulator is written in Java, and I would caution against using it for any real benchmarks. |
That was testing with the local emulator. I’m thinking of next testing deploying to a test appengine instance and datastore. It should be easy enough to create a new project and deploy to that instead of the production project. |
Okay, this works for me:
hstspreload.org/database/database.go Line 14 in a7b7953
You can then try:
There's only one Lines 45 to 49 in a7b7953
However, it shouldn't be too hard to make a copy of the real prod environment using this setup that you can test using local code. |
(And you should also be able to deploy to your test App Engine using |
This is a stop-gap measure to help with issue #154 until a more scalable solution is designed. The logging in /api/v2/update times how long it takes to fetch the preload list from Chromium and how long it takes to load preloaded domains from the database. The latter currently takes around 15 seconds for approximately 50,000 entries.
Today, I had 5 unsuccessful attempts (4 500 errors, 1 502 nginx error) loading /api/v2/update before it succeeded. The successful run took 38.4s. |
This happens both on the production site and when running locally (e.g. via
make serve
).For the local reproduction, the reproduction steps are:
make serve
http://localhost:8080/api/v2/update
. About 40,000 entries will be loaded into the local database before the last datastore update fails:(rpc error: code = DeadlineExceeded desc = retry failed with context deadline exceeded; last error: context deadline exceeded)
http://localhost:8080/api/v2/update
. This times out:Internal error: could not retrieve domain names previously marked as preloaded. (rpc error: code = DeadlineExceeded desc = retry failed with context deadline exceeded; last error: context deadline exceeded)
When reproducing locally, it not only reproduces on master (a7b7953), but also on previous revisions such as 246e763 and f0da6bf.
The text was updated successfully, but these errors were encountered: