Hi. I've noticed that signing in always takes around 5 seconds. Initially, I thought it was caused b...
m
Hi. I've noticed that signing in always takes around 5 seconds. Initially, I thought it was caused by the time it took to hash the password. However, changing the hashing algorithm+configuration doesn't make a difference (I created a new user every time to ensure the new configuration would be applied). The calibration tool even suggested higher configuration values than the ones I'm using. I'm starting to think that the delay is not caused by the algorithm. Perhaps it's actually a feature 🤷 . Any thoughts on what the cause could be?
r
hey @michael_pxr this is not a feature. How are you running the core? On your local machine or some cloud provider?
m
on my local machine in docker-compose
Copy code
yaml
    supertokens:
        image: registry.supertokens.io/supertokens/supertokens-mysql:7.0
        container_name: supertokens
        ports:
            - '3567:3567'
        networks:
            - publishing
        environment:
            # Database credentials
            # See https://supertokens.com/docs/emailpassword/pre-built-ui/setup/database-setup/mysql
            MYSQL_DATABASE_NAME: 'supertokens'
            MYSQL_HOST: '${DEV_MYSQL_HOST}'
            MYSQL_PASSWORD: '${DEV_MYSQL_PASSWORD}'
            MYSQL_PORT: '3306'
            MYSQL_USER: '${DEV_MYSQL_USERNAME}'
            # Token validity
            # See https://supertokens.com/docs/emailpassword/common-customizations/sessions/change-session-timeout
            ACCESS_TOKEN_VALIDITY: '${SUPER_TOKENS_ACCESS_TOKEN_VALIDITY:-3600}' # 1 hour in seconds
            REFRESH_TOKEN_VALIDITY: '${SUPER_TOKENS_REFRESH_TOKEN_VALIDITY:-10080}' # 7 days in minutes
            # Password hashing configuration
            # See https://supertokens.com/docs/emailpassword/common-customizations/password-hashing/argon2
            # See https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id
            PASSWORD_HASHING_ALG: 'ARGON2'
            ARGON2_ITERATIONS: '2'
            ARGON2_MEMORY_KB: '19456' # 19 MB
            ARGON2_PARALLELISM: '1'
            ARGON2_HASHING_POOL_SIZE: '1'
        healthcheck:
            # Based on https://supertokens.com/docs/passwordless/pre-built-ui/setup/core/with-docker#docker-compose-file
            test: >
                bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
            interval: 10s
            timeout: 5s
            retries: 5
r
try running it on an ec2 instance or something.. the resources required are not much (500 mb ram), so a t2.micro ec2 should be just fine. However, on local, there could be other factors that affect performance.
like if you use a m2 mac..
m
I'm on an m3 mac. which are the factors that could affect the performance?
r
performance of docker in m3 mac
generally it's never an issue when running on cloud
m
ok