Redis running on 64k pagesize (#12264)

This commit is contained in:
geekup-legodevops 2022-04-01 13:58:03 +07:00 committed by GitHub
parent 92cf99f025
commit c210857791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View File

@ -6,8 +6,8 @@ LABEL maintainer="tech@appsmith.com"
WORKDIR /opt/appsmith
# The env variables are needed for Appsmith server to correctly handle non-roman scripts like Arabic.
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Update APT packages - Base Layer
RUN apt-get update \
@ -27,7 +27,7 @@ RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
RUN echo "deb [ arch=amd64,arm64 ]http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
&& apt-get remove wget -y
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get -y install --no-install-recommends -y mongodb-org=4.4.6 nodejs redis \
&& apt-get -y install --no-install-recommends -y mongodb-org=4.4.6 nodejs redis build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@ -194,6 +194,26 @@ configure_supervisord() {
fi
}
# This is a workaround to get Redis working on diffent memory pagesize
# https://github.com/appsmithorg/appsmith/issues/11773
check_redis_compatible_page_size() {
local page_size
page_size="$(getconf PAGE_SIZE)"
if [[ $page_size -gt 4096 ]]; then
echo "Compile Redis stable with page size of $page_size"
echo "Downloading Redis source..."
curl https://download.redis.io/redis-stable.tar.gz -L | tar xvz
cd redis-stable/
echo "Compiling Redis from source..."
make && make install
echo "Cleaning up Redis source..."
cd ..
rm -rf redis-stable/
else
echo "Redis is compatible with page size of $page_size"
fi
}
# Main Section
init_env_file
unset_unused_variables
@ -204,6 +224,7 @@ if [[ -z "${DYNO}" ]]; then
init_replica_set
fi
mount_letsencrypt_directory
check_redis_compatible_page_size
# These functions are used to limit heap size for Backend process when deployed on Heroku
get_maximum_heap
setup_backend_heap_arg