Skip to content

Commit 0c33af4

Browse files
dsboulderchombium
authored andcommitted
Make memory_limit_bytes available as optional bosh property
The code allows both a configurable % and byte limit for memory. Specifically the byte limit makes sense when you want to run log-cache on a really large VM, colocated with other things, but you don't want it to take up too much of the VM's memory. This optional property will do nothing until set, at which point it will override the memory % limit, as documented.
1 parent 3a4113e commit 0c33af4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

jobs/log-cache/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ properties:
4343
description: "Percentage of system memory to use for the cache. Must be an integer."
4444
default: 50
4545

46+
memory_limit_bytes:
47+
description: "Overrides memory_limit_percent with a specific size cache in bytes."
48+
4649
max_per_source:
4750
description: "The maximum number of items stored in LogCache per source."
4851
default: 100000

jobs/log-cache/templates/bpm.yml.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ processes:
2525
env:
2626
ADDR: "<%= ":#{p('port')}" %>"
2727
MEMORY_LIMIT_PERCENT: "<%= p('memory_limit_percent') %>"
28+
<%- if_p('memory_limit_bytes') do |memory_limit_bytes| %>
29+
MEMORY_LIMIT_BYTES: "<%= memory_limit_bytes %>"
30+
<% end -%>
2831
MAX_PER_SOURCE: "<%= p('max_per_source') %>"
2932
INGRESS_BUFFER_SIZE: "<%= p('ingress_buffer_size') %>"
3033
INGRESS_BUFFER_READ_BATCH_SIZE: "<%= p('ingress_buffer_read_batch_size') %>"

0 commit comments

Comments
 (0)