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

Delay fetching notes via API #589

Closed
sciurius opened this issue Aug 22, 2020 · 7 comments
Closed

Delay fetching notes via API #589

sciurius opened this issue Aug 22, 2020 · 7 comments

Comments

@sciurius
Copy link

Describe the bug
When I fetch a note (or note information) using the API, there seems to be a 2-3 second delay. This is consistent, independent of server load, so it may indicate some internal time-out

To Reproduce
Steps to reproduce the behavior:

  1. Use curl to fetch note info, e.g. `curl -u "user:password" https://cloud.squirrel.nl/index.php/apps/notes/api/v1/notes/141980
  2. Response after 3 seconds.

Expected behavior
Output within a reasonable amount of time. Since this is a lightly loaded server on a local LAN I'd expect a response in milliseconds.

Server (please complete the following information):

  • Notes app version: 3.6.2
  • Nextcloud version: 19.0.1
  • OS: Raspbian
  • Web server: nginx
  • PHP version: 7.3
  • Database: PostgreSQL

Client (please complete the following information):

  • Browser (incl. version): curl 7.66.0
  • OS: Fedora 31

Log files
A message similar to this is written to the NC log for each request:

{"reqId":"c4dvydfNm08qhTtBCKb2","level":3,"time":"2020-08-22T18:35:38+00:00","remoteAddr":"192.168.1.251","user":"--","app":"PHP","method":"GET","url":"/index.php/apps/notes/api/v1/notes?exclude=content","message":"session_start(): A session had already been started - ignoring at /var/www/nextcloud/lib/private/Session/Internal.php#209","userAgent":"curl/7.66.0","version":"19.0.1.1"}
@korelstar
Copy link
Member

I can confirm this. However, I don't know when this was introduced. Recently, I did some work in order to improve the speed, see #525 (Notes app 3.5.0). I remember, that I measured a time of around 200ms for API requests. However, I don't remember the exact Nextcloud server version. I think it was something in 18. Now, with Nextcloud server 19 and Notes 3.6.3, I get something around 2.200 ms.

Hence, we have to investigate in which version of Nextcloud server or the Notes app the slowness was introduced.

I did a quick test on this using Nextcloud's docker images, but I couldn't find any difference between versions. Any help is appreciated, since it seems to be a time consuming investigation.

@korelstar
Copy link
Member

Oh, and you can safely ignore the session error message. It's a bug in Nextcloud server (see nextcloud/server#20490) which was fixed in nextcloud/server#22243 (will be part of 19.0.2).

@sciurius
Copy link
Author

There are similar delays when using webdav so the problem may be more general.

@korelstar
Copy link
Member

Interestingly, I can't see a delay anymore, when using the Android App. However, when doing a request using curl, it still takes about 2 seconds (even in my test account with very few notes).

Does the problem still occurs to you with the latest server version?

@stefan-niedermann

This comment has been minimized.

@korelstar

This comment has been minimized.

@korelstar
Copy link
Member

In practice, I can't see any delay since a long time. I'll close this issue for now. If it will happen again, we can re-open it.

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

No branches or pull requests

3 participants