File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,19 @@ export function deployRedis(input: { environment: Environment }) {
28
28
memory : '100Mi' ,
29
29
cpu : '50m' ,
30
30
} ,
31
+ args : [
32
+ // When maxmemory is exceeded, the maxmemory-policy is applied.
33
+ // This maxmemory should be 60-70% of the available memory.
34
+ '--maxmemory' , input . environment . isProduction ? '2048mb' : '32m' ,
35
+ // This keeps the most recently used keys. AKA Act like a cache!
36
+ '--maxmemory-policy' , 'allkeys-lru' ,
37
+ // Lazy memory eviction is more performant, but could cause memory
38
+ // to exceed available space if not enough room is given. This is why
39
+ // the 60-70% is crucial.
40
+ '--lazyfree-lazy-eviction' , 'yes' ,
41
+ // This disables snapshotting to save cpu and reduce latency spikes
42
+ '--save' , '""' ,
43
+ ] ,
31
44
} ) ;
32
45
33
46
const host = serviceLocalHost ( redisApi . service ) ;
Original file line number Diff line number Diff line change 1
1
import * as k8s from '@pulumi/kubernetes' ;
2
2
import * as kx from '@pulumi/kubernetesx' ;
3
- import { Output } from '@pulumi/pulumi' ;
3
+ import { Output , Input } from '@pulumi/pulumi' ;
4
4
import { getLocalComposeConfig } from './local-config' ;
5
5
import { normalizeEnv , PodBuilder } from './pod-builder' ;
6
6
@@ -14,7 +14,7 @@ export class Redis {
14
14
} ,
15
15
) { }
16
16
17
- deploy ( { limits } : { limits : k8s . types . input . core . v1 . ResourceRequirements [ 'limits' ] } ) {
17
+ deploy ( { limits, args } : { limits : k8s . types . input . core . v1 . ResourceRequirements [ 'limits' ] , args ?: Input < Input < string > [ ] > } ) {
18
18
const redisService = getLocalComposeConfig ( ) . service ( 'redis' ) ;
19
19
const name = 'redis-store' ;
20
20
@@ -64,6 +64,7 @@ export class Redis {
64
64
{
65
65
name,
66
66
image : redisService . image ,
67
+ args,
67
68
env,
68
69
volumeMounts,
69
70
ports : [ { containerPort : PORT , protocol : 'TCP' } ] ,
You can’t perform that action at this time.
0 commit comments