Opened 4 years ago

Closed 4 years ago

#19452 closed enhancement (wontfix)

Make single request for Onionoo details document

Reported by: phw Owned by: irl
Priority: Medium Milestone:
Component: Metrics/Relay Search Version:
Severity: Normal Keywords: onionoo
Cc: irl, karsten Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


This ticket came out of the discussion over at #15395. Quoting Karsten:

Rather than making 1 request for an Onionoo summary document and then n requests for full Onionoo details documents, let's make a single request for 1 Onionoo details document. Exact parameters are subject to further discussion but would include limit=51 (50 results max and 1 to see if there are even more), fields=... (all fields we'd like to display in the results table), search=... (whatever we pass to the summary request right now), and maybe more.

Child Tickets

Attachments (2)

varnish_cache-year.png (22.2 KB) - added by irl 4 years ago.
varnish_cache-day.png (17.5 KB) - added by irl 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago by irl

Do we still need a limit if we're only doing one request?

comment:2 Changed 4 years ago by irl

Owner: changed from phw to irl
Status: newaccepted

comment:3 Changed 4 years ago by karsten

Replying to irl:

Do we still need a limit if we're only doing one request?

I'd say yes. Onionoo currently knows about 13k relays and bridges that are either running or have been running in the past week. Displaying them all in a table won't go so well. And putting together such a response requires some effort on the server, too.

In the future, we could easily add an offset parameter to implement pagination. For example, displaying 50 results per page and showing page 2 with results 51 to 100: offset=50&limit=51, where the 51st result would again be to learn if there's a page 3; and oh dear, your next question will be how to find out how many hits there are in total... How about we move that to a separate issue after this one is implemented? :)

comment:4 Changed 4 years ago by karsten

Please disregard my comment above starting with "In the future", which really belongs in another ticket, like #17938. Let's focus on reducing the number of requests from Onionoo internally while keeping functionality unchanged.

Here's an example for requests made by Atlas to Onionoo for displaying "Top 10 Relays by Consensus Weight". Atlas first asks for the first 10 running relays by consensus weight in decreasing order:


The result of that request is this list of relays:

"relays_published":"2017-01-09 08:00:00",
"bridges_published":"2017-01-09 06:41:04",

Now it goes to fetch details documents for all contained fingerprints:

What Atlas should really do is make one request that doesn't return summary documents but instead details documents, and with just the fields that will be displayed in the results table or used internally otherwise:


I didn't look at the code which fields are used, though that shouldn't be hard to figure out. Also note that "Top 10 Relays by Consensus Weight" is just one type of request and that the search by user-provided search term is probably found somewhere else in the code. Basically, Atlas should not request /summary from Onionoo anymore but instead request /details directly.

comment:5 Changed 4 years ago by irl

Status: acceptednew

Setting back to new, to give someone else a chance at this in case they have time before I do.

Changed 4 years ago by irl

Attachment: varnish_cache-year.png added

Changed 4 years ago by irl

Attachment: varnish_cache-day.png added

comment:6 Changed 4 years ago by irl

Resolution: wontfix
Status: newclosed

Given the high cache hit rate on Onionoo, as illustrated in the graphs above, we've decided to not fix this for now as it may actually cause a decrease in performance.

Note: See TracTickets for help on using tickets.