Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • mike hajj 1 post 71 karma points
    Jul 01, 2022 @ 06:59
    mike hajj
    0

    umbraco 9 on docker swarm using linux image is not persisting logged in user session.

    We're attempting to run umbraco on docker in swarm mode and deploy several replicas to host the back office.

    here's a copy of our docker-compose.yml file

    version: '3.2'
    
    networks:
      net:
        driver: overlay
        attachable: true
    
    
    services:
      umbraco:
        networks:
          - net
        image: mcr.microsoft.com/dotnet/sdk:5.0
        deploy:
          mode: replicated
          replicas: 2 
          restart_policy:
            condition: on-failure
            delay: 5s
            max_attempts: 3
            window: 120s
        volumes:
          - type: bind
            source: /opt/umbraco
            target: /opt/umbraco
        ports:
          - '61714:61714'
        working_dir: /opt/umbraco/publish/
        command:
          - /bin/bash
          - -c
          - 'dotnet headless9.dll'
    

    before creating the docker service, I ran dotnet publish -c Release -o publish

    then I copied the publish folder and placed it in /opt/umbraco/publish

    finally, I ran the docker-compose file using docker stack

    docker stack deploy -c umbraco.yml my_namespace
    

    3 things to note:

    1. all containers use the shared volume /opt/umbraco which contains all the code, the data folders, the logs ... everything.
    2. when i try to log in, i noticed that the first container process my login, then i get kicked out as if the second container didn't notice that i am logged in and as if my session does not persist between containers.
    3. the containers start but the CPU and memory consumption is insanely high and stays like that for some time ( check below )

    does anyone know why this happens and what i can do to solve the problem ?

    top - 06:54:52 up 2 days, 19:43,  1 user,  load average: 5.34, 4.04, 2.81
    Tasks: 198 total,   1 running, 197 sleeping,   0 stopped,   0 zombie
    %Cpu(s): 34.4 us,  0.7 sy,  0.0 ni, 59.9 id,  5.0 wa,  0.0 hi,  0.0 si,  0.0 st
    MiB Mem :  32108.2 total,  15229.0 free,  16464.5 used,    414.8 buff/cache
    MiB Swap:      0.0 total,      0.0 free,      0.0 used.  15250.5 avail Mem 
    
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                       
    
    
    236326 root      20   0   26.2g  15.2g  29184 S 277.7  48.3   6:54.24 dotnet  
    
Please Sign in or register to post replies

Write your reply to:

Draft