Skip to content

Commit 35c3dde

Browse files
authored
Enable dynamic ratelimiting / adjust clamav resource limits (#8213)
* increase resource limits for clamav * enable dynamic rate limiting and disable static one * use v0.32.2 * revert unrelated change * get rid of warnings about invalid media type * formatting
1 parent 7cb883b commit 35c3dde

File tree

3 files changed

+65
-65
lines changed

3 files changed

+65
-65
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG SERVER_VERSION=v0.32.1
2-
ARG SERVER_VERSION_STRING=v0.32.1
1+
ARG SERVER_VERSION=v0.32.2
2+
ARG SERVER_VERSION_STRING=v0.32.2
33

44
# Builder image to compile the website
55
FROM ubuntu:24.04 AS builder

charts/openvsx/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ clamav:
121121
pullPolicy: Always
122122
resources:
123123
requests:
124-
cpu: 2
124+
cpu: 4
125125
memory: 4Gi
126126
limits:
127-
cpu: 4
127+
cpu: 6
128128
memory: 6Gi
129129
service:
130130
port: 9000
@@ -134,7 +134,7 @@ clamav:
134134
MAX_FILE_COUNT: 100000
135135
MAX_SINGLE_FILE_MB: 256
136136
MAX_RECURSION: 16
137-
MAX_THREADS: 4
137+
MAX_THREADS: 10
138138
SCAN_TIMEOUT_MINUTES: 5
139139

140140
yara:

configuration/application.yml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
logging:
77
level:
88
root: "info"
9+
# avoid log messages like: Received invalid Accept header. Assuming all media types are accepted
10+
org.springframework.boot.autoconfigure.web.servlet.WelcomePageHandlerMapping: "error"
911

1012
server:
1113
address: 0.0.0.0
@@ -103,60 +105,60 @@ org:
103105
miscellaneous:
104106
allow-anonymous-data-usage: false
105107
bucket4j:
106-
enabled: true
107-
cache-to-use: redis-cluster-jedis
108-
filters:
109-
- cache-name: buckets
110-
url: '/api/-/(namespace/create|publish)'
111-
http-response-headers:
112-
Access-Control-Allow-Origin: '*'
113-
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
114-
rate-limits:
115-
- cache-key: getParameter("token")
116-
bandwidths:
117-
- capacity: 15
118-
time: 1
119-
unit: seconds
120-
- cache-name: buckets
121-
url: '/vscode/asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default'
122-
http-response-headers:
123-
Access-Control-Allow-Origin: '*'
124-
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
125-
rate-limits:
126-
- cache-key: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
127-
bandwidths:
128-
- capacity: 75
129-
time: 1
130-
unit: seconds
131-
- cache-name: buckets
132-
url: '/vscode/(?!asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default).*'
133-
http-response-headers:
134-
Access-Control-Allow-Origin: '*'
135-
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
136-
rate-limits:
137-
- cache-key: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
138-
bandwidths:
139-
- capacity: 75
140-
time: 1
141-
unit: seconds
142-
- cache-name: buckets
143-
url: '/api/(?!(.*/.*/review(/delete)?)|(-/(namespace/create|publish))).*'
144-
http-response-headers:
145-
Access-Control-Allow-Origin: '*'
146-
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
147-
rate-limits:
148-
- execute-condition: getParameter("token") != null
149-
cache-key: getParameter("token")
150-
bandwidths:
151-
- capacity: 15
152-
time: 1
153-
unit: seconds
154-
- execute-condition: getParameter("token") == null
155-
cache-key: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
156-
bandwidths:
157-
- capacity: 15
158-
time: 1
159-
unit: seconds
108+
enabled: false
109+
# cache-to-use: redis-cluster-jedis
110+
# filters:
111+
# - cache-name: buckets
112+
# url: '/api/-/(namespace/create|publish)'
113+
# http-response-headers:
114+
# Access-Control-Allow-Origin: '*'
115+
# Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
116+
# rate-limits:
117+
# - cache-key: getParameter("token")
118+
# bandwidths:
119+
# - capacity: 15
120+
# time: 1
121+
# unit: seconds
122+
# - cache-name: buckets
123+
# url: '/vscode/asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default'
124+
# http-response-headers:
125+
# Access-Control-Allow-Origin: '*'
126+
# Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
127+
# rate-limits:
128+
# - cache-key: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
129+
# bandwidths:
130+
# - capacity: 75
131+
# time: 1
132+
# unit: seconds
133+
# - cache-name: buckets
134+
# url: '/vscode/(?!asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default).*'
135+
# http-response-headers:
136+
# Access-Control-Allow-Origin: '*'
137+
# Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
138+
# rate-limits:
139+
# - cache-key: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
140+
# bandwidths:
141+
# - capacity: 75
142+
# time: 1
143+
# unit: seconds
144+
# - cache-name: buckets
145+
# url: '/api/(?!(.*/.*/review(/delete)?)|(-/(namespace/create|publish))).*'
146+
# http-response-headers:
147+
# Access-Control-Allow-Origin: '*'
148+
# Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
149+
# rate-limits:
150+
# - execute-condition: getParameter("token") != null
151+
# cache-key: getParameter("token")
152+
# bandwidths:
153+
# - capacity: 15
154+
# time: 1
155+
# unit: seconds
156+
# - execute-condition: getParameter("token") == null
157+
# cache-key: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
158+
# bandwidths:
159+
# - capacity: 15
160+
# time: 1
161+
# unit: seconds
160162
ovsx:
161163
token-prefix: ovsxat_
162164
storage:
@@ -211,7 +213,7 @@ ovsx:
211213
namespace-details-json:
212214
ttl: PT1H
213215
database-search:
214-
ttl:PT1H
216+
ttl: PT1H
215217
extension-json:
216218
ttl: PT1H
217219
latest-extension-version:
@@ -233,17 +235,15 @@ ovsx:
233235
subject: 'Open VSX Access Tokens Revoked'
234236
template: 'revoked-access-tokens.html'
235237

236-
# tier-based rate limiting configuration
238+
# dynamic tier-based rate limiting configuration
237239
rate-limit:
238-
enabled: false
240+
enabled: true
239241
ip-address-function: '(getHeader("X-Forwarded-For")?: getRemoteAddr()).split(",")[0].trim()'
240-
usage-stats:
241-
job-schedule: '*/30 * * * *'
242242
filters:
243243
- url: '/(api|vscode)/.*'
244244
http-response-headers:
245245
Access-Control-Allow-Origin: '*'
246-
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
246+
Access-Control-Expose-Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
247247
default-http-content-type: application/json
248248
default-http-response-body: >
249249
{

0 commit comments

Comments
 (0)