tmorgan497
tmorgan497
Explore posts from servers
NNuxt
Created by tmorgan497 on 12/22/2024 in #❓・help
Sudden uptick of 503 errors on Cloudflare pages for exceeded cpu time
For the last 24hrs, I've been getting 503 errors on my Nuxt app deployed to cloudflare pages. The app is a very small blog app with only 2 articles. I'm on the free tier and my worker usages are nowhere near the free tier limits. The last update that I made to my app was in September of this year, so I haven't changed anything and it's been working fine since then. Any suggestions on where to look? There's no suspicious traffic that I can tell. I have a WAF rule for US-only traffic and banning all other. I don't really see much of a traffic spike in the analytics. DDoS protection is on too. I'm averaging like less than 1400 visitors a day, so that should be well within the limits. My nuxt app is set to SSR, but it's extremely minimal (it's a nuxt-content app) and only has 2 articles. I use NuxtImg, but my images are using cloudflare image transforms to optimize them. I have not tried to just use the <img> tag by itself instead of <NuxtImg>, but I will try that later
5 replies
CDCloudflare Developers
Created by tmorgan497 on 12/21/2024 in #workers-help
Suddenly getting 503 errors due to exceededCpu
For the last 24hrs, I've been getting 503 errors on my Nuxt app deployed to cloudflare pages. The app is a very small blog app with only 2 articles. I'm on the free tier and my worker usages are nowhere near the free tier limits. The last update that I made to my app was in September of this year, so I haven't changed anything and it's been working fine since then. Any suggestions on where to look? There's no suspicious traffic that I can tell. I have a WAF rule for US-only traffic and banning all other. I don't really see much of a traffic spike in the analytics. DDoS protection is on too. I'm averaging like less than 1400 visitors a day, so that should be well within the limits. My nuxt app is set to SSR, but it's extremely minimal (it's a nuxt-content app) and only has 2 articles. I use NuxtImg, but my images are using cloudflare image transforms to optimize them. I have not tried to just use the <img> tag by itself instead of <NuxtImg>, but I will try that later
1 replies
NNuxt
Created by tmorgan497 on 6/13/2024 in #❓・help
High CPU Usage in Docker when running Nuxt in dev
When I run nuxt with yarn run dev in my docker container, the CPU usage of the container is high. Also, every few seconds, the logs output this:
frontend-container | [nitro-runtime] request: 0.04ms
frontend-container | [nitro-runtime] render:html: 0.058ms
frontend-container | [nitro-runtime] render:response: 0.009ms
frontend-container | [nitro-runtime] beforeResponse: 0.006ms
frontend-container | [nitro-runtime] dev:ssr-logs: 0.007ms
frontend-container | [nitro-runtime] afterResponse: 0.306ms
frontend-container | [nitro-runtime] request: 0.039ms
frontend-container | [nitro-runtime] request: 0.04ms
frontend-container | [nitro-runtime] render:html: 0.058ms
frontend-container | [nitro-runtime] render:response: 0.009ms
frontend-container | [nitro-runtime] beforeResponse: 0.006ms
frontend-container | [nitro-runtime] dev:ssr-logs: 0.007ms
frontend-container | [nitro-runtime] afterResponse: 0.306ms
frontend-container | [nitro-runtime] request: 0.039ms
I don't know if that is expected behavior, but when I run yarn run dev outside of the container, the CPU usage is a lot lower and the nitro-runtime logs don't occur. Here's my Dockerfile:
# frontend/frontend.Dockerfile
FROM node:20.10.0-alpine AS dev
ENV HOST 0.0.0.0
WORKDIR /code/frontend
RUN apk --no-cache add curl
COPY package.json ./
RUN yarn cache clean && yarn install
COPY . .
# frontend/frontend.Dockerfile
FROM node:20.10.0-alpine AS dev
ENV HOST 0.0.0.0
WORKDIR /code/frontend
RUN apk --no-cache add curl
COPY package.json ./
RUN yarn cache clean && yarn install
COPY . .
and my compose file for the frontend container:
frontend:
env_file:
- ./.env
environment:
- BASE_URL=${BASE_URL}
working_dir: /code/frontend
container_name: ${FRONTEND_CONTAINER_NAME:-frontend}
build:
context: ./frontend
dockerfile: ./frontend.Dockerfile
target: ${STAGE:-dev}
ports:
- ${FRONTEND_9000_PORT:-9000}:9000
- ${FRONTEND_8080_PORT:-8080}:8080
- 3000:3000
volumes:
- ./frontend:/code/frontend:rw
- frontend_node_modules:/code/frontend/node_modules
tmpfs: /tmp
command: /bin/sh -c "cd /code/frontend && yarn run dev --host"
frontend:
env_file:
- ./.env
environment:
- BASE_URL=${BASE_URL}
working_dir: /code/frontend
container_name: ${FRONTEND_CONTAINER_NAME:-frontend}
build:
context: ./frontend
dockerfile: ./frontend.Dockerfile
target: ${STAGE:-dev}
ports:
- ${FRONTEND_9000_PORT:-9000}:9000
- ${FRONTEND_8080_PORT:-8080}:8080
- 3000:3000
volumes:
- ./frontend:/code/frontend:rw
- frontend_node_modules:/code/frontend/node_modules
tmpfs: /tmp
command: /bin/sh -c "cd /code/frontend && yarn run dev --host"
6 replies