Skip to content

Commit

Permalink
Enable jemalloc2 for our pods (hcengineering#6823)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo authored Oct 7, 2024
1 parent db9af92 commit f929acf
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 8 deletions.
1 change: 1 addition & 0 deletions pods/account/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mong

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
Expand Down
8 changes: 8 additions & 0 deletions pods/backup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ FROM node:20
WORKDIR /usr/src/app

RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 3000
Expand Down
1 change: 1 addition & 0 deletions pods/collaborator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mong

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
Expand Down
1 change: 1 addition & 0 deletions pods/front/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN npm install --ignore-scripts=false --verbose [email protected] bufferutil utf-8-

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
Expand Down
1 change: 1 addition & 0 deletions pods/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mong

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
Expand Down
1 change: 1 addition & 0 deletions pods/workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mong

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
Expand Down
9 changes: 8 additions & 1 deletion server/collaborator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@

FROM node:20-alpine
FROM node:20

WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 3078
Expand Down
7 changes: 7 additions & 0 deletions services/ai-bot/pod-ai-bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ FROM node:20
WORKDIR /usr/src/app
RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./
COPY assets/avatar.png ./

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ FROM node:20
WORKDIR /usr/src/app
RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 4007
Expand Down
9 changes: 8 additions & 1 deletion services/calendar/pod-calendar/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@

FROM node:20-alpine
FROM node:20

WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 8095
Expand Down
1 change: 1 addition & 0 deletions services/github/pod-github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mong

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
Expand Down
9 changes: 8 additions & 1 deletion services/gmail/pod-gmail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@

FROM node:20-alpine
FROM node:20

WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 8087
Expand Down
7 changes: 7 additions & 0 deletions services/love/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ FROM node:20
WORKDIR /usr/src/app
RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 8096
Expand Down
13 changes: 11 additions & 2 deletions services/rekoni/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM node:20-alpine AS runtime
FROM node:20 AS runtime

RUN apk upgrade --update && apk add \
RUN apt-get update
RUN apt-get install -y \
coreutils \
antiword \
poppler-utils \
Expand All @@ -9,6 +10,14 @@ RUN apk upgrade --update && apk add \
ENV NODE_ENV=production
WORKDIR /usr/src/app
RUN npm install --ignore-scripts=false --verbose [email protected] [email protected] --unsafe-perm

RUN apt-get update
RUN apt-get install -y libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./
EXPOSE 4004
CMD [ "node", "./bundle.js" ]
9 changes: 8 additions & 1 deletion services/ses/pod-ses/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM node:20-alpine
FROM node:20

WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 8089
Expand Down
7 changes: 7 additions & 0 deletions services/sign/pod-sign/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ WORKDIR /usr/src/app

RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

CMD [ "dumb-init", "node", "bundle.js" ]
9 changes: 8 additions & 1 deletion services/telegram-bot/pod-telegram-bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM node:20-alpine
FROM node:20

WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 4020
Expand Down
9 changes: 8 additions & 1 deletion services/telegram/pod-telegram/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@

FROM node:20-alpine
FROM node:20

WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install libjemalloc2
RUN apt-get clean

ENV LD_PRELOAD=libjemalloc.so.2
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

COPY bundle/bundle.js ./

EXPOSE 8086
Expand Down

0 comments on commit f929acf

Please sign in to comment.