Skip to content
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

[BUG] Requests sometimes take 20 seconds? #270

Open
bchu1 opened this issue Oct 29, 2024 · 2 comments
Open

[BUG] Requests sometimes take 20 seconds? #270

bchu1 opened this issue Oct 29, 2024 · 2 comments
Labels
bug Something is not working as defined

Comments

@bchu1
Copy link

bchu1 commented Oct 29, 2024

Version
v1

Describe the bug
Seems like the first request I make (https://api.ror.org/organizations?query=a for example) takes 20 seconds, while subsequent requests (even for the same query) are pretty fast. Tried across browsers, incognito, and different apps, was only able to see it happen the first time. Others on our team were also able to reproduce the 20 second initial delay.

To Reproduce
Steps to reproduce the behavior:

  1. Make an initial request to https://api.ror.org/organizations?query=a
  2. Notice 20 second delay.
  3. Make another request, no delay.

Expected behavior
No delay.

Screenshots
N/A

Device information:

  • Device type: desktop
  • OS: macOS
  • Browser: Chrome, Firefox
  • Version: Tried both Chrome and Firefox.

Additional context
N/A

@bchu1 bchu1 added the bug Something is not working as defined label Oct 29, 2024
@lizkrznarich
Copy link
Contributor

lizkrznarich commented Oct 29, 2024

Hi @bchu1 looking at our ElasticSearch and load balancer metrics, I don't see any unusual latency in the past week. Load balancer response time over the past week is stable at around 2 sec.

Running your example query in Firefox and Chrome this afternoon, I got about 8 sec and 1 sec total response time respectively (this is different from the load balancer response time bc it includes time that the browser spends doing other parts of the process). I also got a response time of ~1 sec in the command line via cURL using curl -s -o /dev/null -w "%{time_starttransfer}\n" 'https://api.ror.org/organizations?query=a'.

I'm a little stumped as to why you're seeing this behavior. Browser caching would explain the quick response to subsequent queries that are the same, but it wouldn't explain the very long initial response time. Is it possible that your organization has network or endpoint security monitoring that inspects inbound and/or outbound requests?

Otherwise, it would be helpful if you could pop open your Developer Tools and take a screenshot of the network request and response, like the ones I've attached below. In Chrome, this is under View > Developer > Developer Tools and in Firefox, it's under Tools > Web Developer > Network.

Also, what's shown in the "time_taken" field in the query response in the case where it takes a long time? This is the number of milliseconds ElasticSearch spent processing the query, which is different from how long it took for the response to get to you, but it's helpful to know regardless.

Screen Shot 2024-10-29 at 1 12 15 PM Screen Shot 2024-10-29 at 1 13 43 PM

@bchu1
Copy link
Author

bchu1 commented Nov 27, 2024

Hi @lizkrznarich sorry for the late response! I'm not aware of any special network monitoring on our devices.

I was just able to reproduce another 20 second response after making a bunch of other queries (so that disproves that it's only on the "first" request as I had written earlier)

image

Here's the timing tab

image

And here's the response (looks like time_taken was only 7!)

{
    "number_of_results": 31,
    "time_taken": 7,
    "items": [
        ...
        ]
    }
}

@bchu1 bchu1 changed the title [BUG] First request takes 20 seconds? [BUG] Requests sometimes take 20 seconds? Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as defined
Projects
None yet
Development

No branches or pull requests

2 participants