Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalable domserver #130

Open
arasHi87 opened this issue Mar 31, 2022 · 4 comments
Open

Scalable domserver #130

arasHi87 opened this issue Mar 31, 2022 · 4 comments

Comments

@arasHi87
Copy link

Cause I deploy domserver in k8s, so I need to let domserver to be scaleable, but I can't find relevant information on the Internet, so I leave my solution here for someone who need this (all we need just to modify the official Dockerfile).

Install dependency

# Install required packages for running of domserver
RUN apt update \
    && apt install --no-install-recommends --no-install-suggests -y \
    acl curl zip unzip supervisor mariadb-client apache2-utils \
    nginx php-cli php-fpm php-zip \
    php-gd php-curl php-mysql php-json php-intl \
    php-gmp php-xml php-mbstring php-ldap php-pear php-dev \
    enscript lpr make libzstd-dev \
    ca-certificates python3-yaml \
    && rm -rf /var/lib/apt/lists/*

Install php-ext

RUN yes | pecl install zstd igbinary redis

Set php-ini

RUN sed -i 's/;session.save_path/session.save_path/g' /etc/php/7.4/fpm/php.ini && \
    sed -i 's/\/var\/lib\/php\/sessions/tcp:\/\/domjudge-redis:6379/g' /etc/php/7.4/fpm/php.ini && \ 
    sed -i 's/= files/= redis/g' /etc/php/7.4/fpm/php.ini && \
    sed -i '938i\extension=zsdt.so' /etc/php/7.4/fpm/php.ini && \
    sed -i '938i\extension=igbinary.so' /etc/php/7.4/fpm/php.ini && \
    sed -i '938i\extension=redis.so' /etc/php/7.4/fpm/php.ini && \
    service php7.4-fpm restart

Done

And remember to change the redis host to yourself, hope this can helps guy!

@nickygerritsen
Copy link
Member

In the past we have used the database to store sessions to achieve the same.
I remember talking about making this the default. @ubergeek42 do you remember why we didn’t do this? It would help these kinds of cases (and even help us at the world finals to actually have two active nodes)

@arasHi87
Copy link
Author

arasHi87 commented Apr 9, 2022

In the past we have used the database to store sessions to achieve the same.
I remember talking about making this the default. @ubergeek42 do you remember why we didn’t do this? It would help these kinds of cases (and even help us at the world finals to actually have two active nodes)

Is domjudge still support this feature? If so, is there any document? thx

@ubergeek42
Copy link
Member

I'm not sure why we didn't do it by default, I guess performance is probably better if you're on a single node and don't need to hit the database for sessions too. But that's probably a tiny impact.

We have a small wiki page which briefly discusses using the session based storage: https://github.com/DOMjudge/domjudge/wiki/Scaling-and-load-testing

But it's basically just follow the symfony docs:
https://symfony.com/doc/current/session/database.html

@nickygerritsen
Copy link
Member

I'm not sure why we didn't do it by default, I guess performance is probably better if you're on a single node and don't need to hit the database for sessions too. But that's probably a tiny impact.

Can we somehow measure this? If the impact is near-zero, I would propose to make it the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants