What can I do to improve jobs running time?

I’m building a Next.js (JavaScript Stack based on React library) application and deploying it over Firebase functions & hosting using Gitlab job runners, but the building/deploying process is getting too much time to be processed. More than in my local machine.

What can I do to improve jobs running time?

1 Like

@francis.rod01I’m not sure what your .gitlab-ci.yml file looks like, but have you considered:

1 Like

Are you using gitlab.com’s shared runners or your own runners?
GitLab ones are pretty weak: https://docs.gitlab.com/ce/user/gitlab_com/index.html#shared-runners

All your CI/CD jobs run on n1-standard-1 instances with 3.75GB of RAM, CoreOS and the latest Docker Engine installed. Instances provide 1 vCPU and 25GB of HDD disk space.

I already have a npm cache dependencies.

My gitlab-runner specifications:

Specific
Property Name	Value
Active	Yes
Protected	No
Can run untagged jobs	Yes
Locked to this project	Yes
Tags	
Name	gitlab-runner
Version	12.5.0
IP Address	xxxxxxxxxxxx
Revision	xxxxxxxxd
Platform	linux
Architecture	amd64
Description	docker-runner travel-website
Maximum job timeout	
Last contact	12 minutes ago

Here’s my gitlab-ci.yml file:

image: node:8.16.2

cache:
  key: cache_npm
  paths:
  - .cache_npm

stages:
  - install
  - build
  - deploy

install_client:
  stage: install
  only:
    - staging
    - production
  script:
    - npm i --cache ../.cache_npm
  artifacts:
    paths:
      - node_modules

build_client_staging:
  stage: build
  only:
    - staging
  script:
    - npm run build
  environment:
    name: staging
  dependencies:
    - install_client
  artifacts:
    paths:
      - dist

build_client_production:
  stage: build
  only:
    - production
  script:
    - npm run build
  environment:
    name: production
  dependencies:
    - install_client
  artifacts:
    paths:
      - dist

deploy_all_staging:
  stage: deploy
  only:
    - staging
  script:
    - npm i -g firebase-tools --cache ../.cache_npm
    - npm run deploy
  environment:
    name: staging
  dependencies:
    - install_client
    - build_client_staging

deploy_all_production:
  stage: deploy
  only:
    - production
  script:
    - npm i -g firebase-tools --cache ../.cache_npm
    - npm run deploy
  environment:
    name: production
  dependencies:
    - install_client
    - build_client_production