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

reduce request limit for resource intensive api calls #121

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

alexskr
Copy link
Member

@alexskr alexskr commented Aug 9, 2023

/annotator and /recommender API calls are one of the most resource intensive calls. A single user hitting those API at the current limit of 15 request per second can create a significant strain on the backend. This change reduces request limit on those calls from 15 request per second per ip address to 1/5 of that.

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2023

Codecov Report

Merging #121 (92cd3f7) into develop (7c2ad53) will increase coverage by 0.03%.
Report is 5 commits behind head on develop.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop     #121      +/-   ##
===========================================
+ Coverage    71.84%   71.88%   +0.03%     
===========================================
  Files           52       52              
  Lines         2845     2849       +4     
===========================================
+ Hits          2044     2048       +4     
  Misses         801      801              
Flag Coverage Δ
unittests 71.88% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

@alexskr alexskr marked this pull request as ready for review August 9, 2023 21:32
@alexskr alexskr merged commit f39bb01 into develop Aug 15, 2023
2 of 4 checks passed
syphax-bouazzouni referenced this pull request in ontoportal/ontologies_api Jan 16, 2024
…onward (#4)

* fix get a submission metrics

* Auto stash before merge of "upstream" and "upstream/master"

* add the slice get endpoint

* add the slices create endpoint

* add the slices delete endpoint

* add the slices update endpoint

* Add caching for analytics for 24 hours.

* Fix for #97. Check for ontology existence before brining attributes

* Handle edge case for submission downloads which do not have UploadFilePath set

Fixes #98

* Gemfile.lock update

* Add GH workflow for capistrano deployments

* Update Gemfile.lock

* fix ability to run deployment manually

* Fix for deprecation notice of Rack::Attack.throttled_response

Update configuration to closely match rack attack documentation in order
to address deprecation notice:
[DEPRECATION] Rack::Attack.throttled_response is deprecated. Please use Rack::Attack.throttled_responder instead

* Update version of actions/checkout to address deprecation notices

* Fix: Documentation rendering  (#107)

* Auto stash before merge of "upstream" and "upstream/master"

* fix haml gem version

* Update Gemfile

* Restore branch specifier to master

* Update capistrano sample config to include setting which branch to deploy from

* Gemfile.lock update

* Gemfile.lock update

* Gemfile.lock update

* Gemfile.lock update

* Make sure ontology is present when accessing submissions.

Fixes an internal server error when accessing submission for non-existent/deleted ontology

* Remove owlapi_wrapper.jar file.  It is included elsewhere

* Add health checks for docker services and add more config file options

* Remove wait-for-it

* Add health check to AG service

* Add GH workflow for publishing docker images

* Add missing redis port number

* Restore branch specifier to develop

* Set mgrep port to 55556

* add arm64 platform

* bump up version of solr-ut

* Fix ncbo#116

- pinned redis-store to 1.9.1 until #358 gets resolved
- fixed deprecation notices "warning: calling URI.open via Kernel#open
  is deprecated, call URI.open directly or use URI#open"

* Restore branch specifier to master

* fix for wrongly replaced string

* Delete fix_purls.rb

fix_purls.rb moved to a rake task under ncbo_cron project

* Remove google analytics depenencies since those needed only in ncbo_cron

* bump up major version of oj and faraday

* remove search_index.rb script

* lock gem rack-cache to 1.13.0

see ncbo#118

* remove depenency on redis-activesupport

rack-attack can work with redis directly so there is no need to use
redis-activesupport which is no longer being actively developed

* unpin redis-store

solves:
ncbo#105
ncbo#106

* use redis-store from forked repo containing redis 5 compat fixes

this should be reverted back to original after redis 5
copatibilty issues are resolved

* use patched version of agraph v7.3.1

* unpin faraday gem

* Gemfile.lock update

* fixed an issue with the GA4 Analytics migration

* fixed an issue with the GA4 Analytics migration

* reduce request limit for resource intensive api calls (#121)

* Announce deployments in NewRelic  (#124)

* Record deployments to NewRelic

https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/record-deployments-ruby-agent/

* add newrelic to deployment group

github actions deployment doesn't install default group so
capistrano fails to find newrelic recepies unless we add it
to the deployment group

* add rubocop

* Gemfile update, goo version including goo#138 and goo#139

* Gemfile.lock update

* Gemfile.lock update

* Gemfile.lock update

* update slice write operation to check if user is admin

* Gemfile.lock update

* fixed an accidental commit of docker compose file

* fixed Gemfile after merging from master

* Gemfile.lock update

* update Gemfile.lock

* Gemfile.lock update

* redis-store gem with redis 5 compatibility fix

* Gemfile.lock update

* make the check_access helper use filter_access if the object is a list

* add test for submissions access check with two ontologies private and pubic

* check access of ontologies in /ontologies/:acronym/submissions endpoint

* Set gem branch specifier to develop

* reset branch specifier to master

* add the slice get endpoint

* add the slices create endpoint

* add the slices delete endpoint

* add the slices update endpoint

* update slice write operation to check if user is admin

* add slices creation & deletion unit tests

* Gemfile.lock update

* Gemfile.lock update

* Merged #87 from master

* fixed Gemfile after merge

* Gemfile.lock update

* update Gemfile.lock

* Add configurable option for github org where code is deployed from

* Gemfile update

* Gemfile update

* check existance of acroym before fetching details

fixes #129

* extract slice tests helper to the parent class for reusability

* add a test for the creation of an admin user

* enforce the security of admin user creation

* enforce user deletion security to be admin only

* Gemfile.lock update

* update Gemfile.lock

* Gemfile update

* implemented the first pass at bmir-radx/radx-project#37

* set bundler version to be comptatible with ruby 2.7

* Gemfile.lock update

* implemented #127 - Add API call to trigger ontology pull from remote location

* Gemfile.lock

* implemented a test for #127 - Add API call to trigger ontology pull from remote location

* Gemfile.lock update

* implemented a test for #127 - Add API call to trigger ontology pull from remote location

* implemented a test for #127 - Add API call to trigger ontology pull from remote location

* Gemfile.lock update

* use agraph v8.0.0

* Gemfile.lock update

* Gemfile.lock update

---------

Co-authored-by: Alex Skrenchuk <alexskr@stanford.edu>
Co-authored-by: mdorf <mdorf@stanford.edu>
Co-authored-by: Jennifer Vendetti <vendetti@stanford.edu>
@alexskr alexskr deleted the adjust_request_limiting_for_heavy_requests branch February 9, 2024 00:21
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

Successfully merging this pull request may close these issues.

2 participants