You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I want to submit a patch to improve performance when backend is down,but maybe not be promitted. #1241
[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 .
From 78dcc57f232808d7e26a23d38b80088fee35c9b2 Mon Sep 17 00:00:00 2001
From: lishenyang lishenyang@hisense.com
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.
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
Activity
lsy1990 commentedon Nov 20, 2020
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 .
lsy1990 commentedon Nov 20, 2020
eloycoto commentedon Nov 20, 2020
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.
lsy1990 commentedon Feb 2, 2021
lsy1990 commentedon Feb 3, 2021
Hi @eloycoto Are there some update for this optimization?
eloycoto commentedon Feb 3, 2021
Hi,
sorry the change make sense to me, if you want to make a PR I'm more than happy to merge it.
lsy1990 commentedon Feb 3, 2021
Got it. I will submit a patch for the change.
lsy1990 commentedon Feb 4, 2021
lsy1990 commentedon Feb 4, 2021
From 78dcc57f232808d7e26a23d38b80088fee35c9b2 Mon Sep 17 00:00:00 2001
From: lishenyang lishenyang@hisense.com
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)
else
-- The caching policy does not store the rejection reason, so we can only
-- return a generic error.
--
2.26.1.windows.1
thomasmaas commentedon Feb 5, 2021
@lsy1990 https://github.com/3scale/APIcast/blob/master/.github/CONTRIBUTING.md
eloycoto commentedon Feb 9, 2021
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