Skip to content

Commit

Permalink
Update postgresql tunning
Browse files Browse the repository at this point in the history
  • Loading branch information
minhhoangkms committed Oct 26, 2020
1 parent 2a87cdd commit 5437cfa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 2 additions & 4 deletions manifests/saleor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ spec:
- image: hnminh/saleor-api:kms
name: saleor-api
imagePullPolicy: Always
command: ['uwsgi']
args: ["--enable-threads", "--reload-on-rss", "1536", "--vacuum", "--harakiri","120","--max-requests","1000", "--ini", "/app/saleor/wsgi/uwsgi.ini"]
ports:
- containerPort: 8000
name: api
Expand Down Expand Up @@ -68,10 +66,10 @@ spec:
resources:
limits:
cpu: '500m'
memory: '2Gi'
memory: '1Gi'
requests:
cpu: '500m'
memory: '2Gi'
memory: '1Gi'
volumeMounts:
- mountPath: /app/media
name: media-storage
Expand Down
6 changes: 6 additions & 0 deletions manifests/saleor/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ metadata:
nginx.ingress.kubernetes.io/proxy-connect-timeout: '120'
nginx.ingress.kubernetes.io/proxy-send-timeout: '120'
nginx.ingress.kubernetes.io/proxy-read-timeout: '120'
nginx.ingress.kubernetes.io/proxy-buffering: 'on'
nginx.ingress.kubernetes.io/proxy-buffers-number: '8'
nginx.ingress.kubernetes.io/proxy-buffer-size: '128k'
nginx.ingress.kubernetes.io/client-body-buffer-size: '1M'
nginx.ingress.kubernetes.io/proxy-max-temp-file-size: '100m'
nginx.ingress.kubernetes.io/proxy-body-size: '10m'
labels:
app: '{{.Release.Name}}-saleor-api'
service: '{{.Release.Name}}-saleor-ingress'
Expand Down
2 changes: 1 addition & 1 deletion scenario-tests/search-and-buy-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var select = require('../services/select-items/index.js');
var account = require('../services/create-accounts/index.js');

var ITERATION = 2;
var VUs = 20;
var VUs = 100;
var thresholdConfig = {
'Content OK': ['rate > 0.95'],
// scenario 1
Expand Down
4 changes: 2 additions & 2 deletions services/search-items/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var searchAction = function (
);
metrics.addTimmingTrend(response, trend, actionName);
sleep(sleepTime);
if (response.status != 502)
if (response.status === 200 || response.status === 204)
return jsonpath.query(response.json(), '$[0].data.products.edges[0].node.id')[0];
return undefined;
};
Expand All @@ -76,7 +76,7 @@ var selectSearchAction = function (
);
metrics.addTimmingTrend(response, trend, actionName);
sleep(sleepTime);
if (response.status != 502)
if (response.status === 200 || response.status === 204)
return jsonpath.query(response.json(), '$[0].data.product.variants[0].id')[0];
return undefined;
};
Expand Down

0 comments on commit 5437cfa

Please sign in to comment.