Closed alexskr closed 1 day ago
BioPortal has 17K users so getting all users to change a single user is not ideal.
/users API call sends about 20Mb response back to the client; I'm not sure how big that object would be, but it might not get cached on the UI side since memcached is currently configured to cache objects with a size up to 5Mb.
ontologies_api_ruby_client
optimizations might be beneficial in dealing with this issue.
https://github.com/ontoportal-lirmm/ontologies_api_ruby_client/pull/14
This stack trace originates from the get_username
method:
[db770e67-86f6-4472-a985-be5efd0dee56] app/helpers/application_helper.rb:41:in `get_username'
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:57
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:44:in `each'
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:44
This method is invoked within a loop when rendering notes for a class or ontology. Each time, it issued a separate find
call to the ontologies_api_client library to retrieve the author name for each note. However, the find
method in the library was inefficient—it fetched all users and then filtered through them to find the requested user.
In version 2.4.0 of the library, this has been refactored to improve performance.
Additionally, the get_username
method was updated in this commit to eliminate the unnecessary REST calls.
A similar stack trace occurred when users attempted to update their account settings. This is mitigated by the above mentioned performance improvements in the ontologies_api_client
library, and a change to the UsersController
to disable a full cache refresh when updating a single user.
We are seeing intermittent server errors when updating user account settings in the UI.
https://bioportal.bioontology.org/accounts/username/edit
UI logs show:
It appears that UI errors out when API responds with
304
for/users?include=all
call:and UI doesn't error out when API responds with
200