I want to submit a patch to improve performance when backend is down,but maybe not be promitted.
[provide a description of the issue]
Version
[provide output of the nginx -V or openresty -V command from openshift/local terminal]
[provide timestamp of the docker image from docker inspect --format='{{.Created}}' quay.io/3scale/apicast:master ]
Steps To Reproduce
- [step 1 (json configuration file, if applies)]
- [step 2 (curl commands to reproduce, if applies)]
- [step 3]
Current Result
Expected Result
Additional Information
- [Gist with minimal reproducible configuration, see guidelines for contributing for details]
- [Gist with nginx log output]
ERROR: Permission to 3scale/APIcast.git denied to lsy1990. fatal: Could not read from remote repository.
Please make sure you have the correct access rights
To improve the performance when the backend is down. problem: when backend is down and batcher's cache is expired,every request will pass to backend and wait to timeout ,and then make use of the caching policy's data. This will cause that the business's tps become slow. solution: make use of the caching's data to update bacher's cache,to avoid every request need to check .

Hi @lsy1990
Thanks for your issue, make sense what you're reporting, but I need to verify a few thing before submit it.
Let me have a look, and I'll come back to you in the next couple of days.
Regards.

Hi @eloycoto Are there some update for this optimization?
Hi,
sorry the change make sense to me, if you want to make a PR I'm more than happy to merge it.
Got it. I will submit a patch for the change.

From 78dcc57f232808d7e26a23d38b80088fee35c9b2 Mon Sep 17 00:00:00 2001 From: lishenyang [email protected] Date: Thu, 4 Feb 2021 09:01:12 +0800 Subject: [PATCH] update batcher's auth cache based on Authcaching data when batcher ttl >0 and backend server is down,the tps will be reduced a litte, better than old policy.
gateway/src/apicast/policy/3scale_batcher/3scale_batcher.lua | 1 + 1 file changed, 1 insertion(+)
diff --git a/gateway/src/apicast/policy/3scale_batcher/3scale_batcher.lua b/gateway/src/apicast/policy/3scale_batcher/3scale_batcher.lua index 917d7d4f..ab85fbe6 100644 --- a/gateway/src/apicast/policy/3scale_batcher/3scale_batcher.lua +++ b/gateway/src/apicast/policy/3scale_batcher/3scale_batcher.lua @@ -152,6 +152,7 @@ local function handle_backend_error(self, service, transaction, cache_handler)
if cached == 200 then self.reports_batcher:add(transaction)
- self.auths_cache:set(transaction, 200) else -- The caching policy does not store the rejection reason, so we can only -- return a generic error. -- 2.26.1.windows.1
@lsy1990 https://github.com/3scale/APIcast/blob/master/.github/CONTRIBUTING.md
Hi @lsy1990
don't worry, I'll try to do the PR and the integration test later this week, I'll ping you as reviewer