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

Cube Deployment extremely slow using Sample Production Docker Compose #8269

Closed
danfaro opened this issue May 16, 2024 · 2 comments
Closed

Cube Deployment extremely slow using Sample Production Docker Compose #8269

danfaro opened this issue May 16, 2024 · 2 comments
Labels
question The issue is a question. Please use Stack Overflow for questions.

Comments

@danfaro
Copy link

danfaro commented May 16, 2024

Problem

I'm testing out a local deployment of a production-ready stack https://cube.dev/docs/product/deployment/core#configuration.

As soon as I run docker compose up, the router and workers are all running at 100% CPU. When I try a basic query of a single measure in the playground, it takes about 10 seconds to get a result.

Previously, when using the basic dev mode docker compose https://cube.dev/docs/product/getting-started/core/create-a-project, everything ran very smoothly and query results comes back quickly.

Screenshot 2024-05-16 at 10 20 17 AM

The log also shows these errors repeated in big chunks from time to time, I'm not sure what the connection issue is or why it is dropping cache.

2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  | Error: connect ECONNREFUSED 172.27.0.2:3030
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     at QueryQueue.parseResult (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/QueryQueue.js:384:13)
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     at QueryQueue.executeInQueue (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/QueryQueue.js:226:19)
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     at runMicrotasks (<anonymous>)
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     at async Promise.all (index 0)
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  | Dropping Cache: scheduler-cbeb2091-5a21-4bfb-960f-00b75d1c8560 
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  | {
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |   "cacheKey": [
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     "SELECT FLOOR((UNIX_TIMESTAMP()) / 10) as refresh_key",
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |     []
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |   ],
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  |   "spanId": "111cbd834d7196c3f528084dbb3a94e0"
2024-05-15 17:01:19 faro-cube-cube_refresh_worker-1  | } 

My docker-compose.yml

version: "2.2"
 
services:
  cube_api:
    restart: always
    image: cubejs/cube:latest
    ports:
      - 4000:4000
    environment:
      - CUBEJS_DB_TYPE=postgres
      - CUBEJS_DB_HOST=host.docker.internal
      - CUBEJS_DB_PORT=****
      - CUBEJS_DB_NAME=****
      - CUBEJS_DB_USER=****
      - CUBEJS_DB_PASS=****
      - CUBEJS_CUBESTORE_HOST=cubestore_router
      - CUBEJS_API_SECRET=****
    volumes:
      - .:/cube/conf
    depends_on:
      - cube_refresh_worker
      - cubestore_router
      - cubestore_worker_1
      - cubestore_worker_2
 
  cube_refresh_worker:
    restart: always
    image: cubejs/cube:latest
    environment:
      - CUBEJS_DB_TYPE=postgres
      - CUBEJS_DB_HOST=host.docker.internal
      - CUBEJS_DB_PORT=****
      - CUBEJS_DB_NAME=****
      - CUBEJS_DB_USER=****
      - CUBEJS_DB_PASS=****
      - CUBEJS_CUBESTORE_HOST=cubestore_router
      - CUBEJS_API_SECRET=****
      - CUBEJS_REFRESH_WORKER=true
    volumes:
      - .:/cube/conf
 
  cubestore_router:
    restart: always
    image: cubejs/cubestore:latest
    environment:
      - CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
      - CUBESTORE_REMOTE_DIR=/cube/data
      - CUBESTORE_META_PORT=9999
      - CUBESTORE_SERVER_NAME=cubestore_router:9999
    volumes:
      - .cubestore:/cube/data
 
  cubestore_worker_1:
    restart: always
    image: cubejs/cubestore:latest
    environment:
      - CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
      - CUBESTORE_SERVER_NAME=cubestore_worker_1:10001
      - CUBESTORE_WORKER_PORT=10001
      - CUBESTORE_REMOTE_DIR=/cube/data
      - CUBESTORE_META_ADDR=cubestore_router:9999
    volumes:
      - .cubestore:/cube/data
    depends_on:
      - cubestore_router
 
  cubestore_worker_2:
    restart: always
    image: cubejs/cubestore:latest
    environment:
      - CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
      - CUBESTORE_SERVER_NAME=cubestore_worker_2:10002
      - CUBESTORE_WORKER_PORT=10002
      - CUBESTORE_REMOTE_DIR=/cube/data
      - CUBESTORE_META_ADDR=cubestore_router:9999
    volumes:
      - .cubestore:/cube/data
    depends_on:
      - cubestore_router

I'm trying to test the feasibility of running the necessary Cube services on one machine, locally first and on an Azure VM next. But it seems to be really struggling for no reason on my Macbook M2 Pro with 32 GB memory.

@danfaro danfaro added the question The issue is a question. Please use Stack Overflow for questions. label May 16, 2024
@ovr
Copy link
Member

ovr commented May 16, 2024

For Arm, we have a separate image tag for the Cube Store. Could you give a try with cubejs/cubestore:arm64v8?

@danfaro
Copy link
Author

danfaro commented May 16, 2024

Thank you that was the issue

@danfaro danfaro closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question. Please use Stack Overflow for questions.
Projects
None yet
Development

No branches or pull requests

2 participants