cd /news/developer-tools/optimizing-a-blog-system-by-leveragi… · home › topics › developer-tools › article
[ARTICLE · art-181563] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Optimizing a blog system by leveraging free tier infrastructure

A developer running a cat-raising management system on free and hobby tiers documented how hitting quota limits on Vercel Hobby, MongoDB Atlas M0, and Upstash Redis forced targeted fixes. Misusing Next.js's cookies() on public pages turned static renders dynamic, and base64-embedded documents pushed Vercel Write Units to roughly 32,000 requests per day; moving files to AWS S3 with slim MongoDB projections and tuning BullMQ's drainDelay and stalledInterval cut Redis command usage that had exhausted Upstash's 500,000-command free limit.

recommendation

Audit for cookies() and headers() on pages meant to be static, and raise BullMQ drainDelay and stalledInterval so idle workers stop burning Redis commands.

more in playbook: Running AI in production
by read2 min views1 publishedDec 4, 2026

Running a personal system on free or hobby tiers offers significant cost savings, but it also pushes engineers into strict resource limitation challenges. The tech stack includes Next.js deployed on Vercel Hobby, a NestJS backend on Render Hobby, MongoDB Atlas M0 database, and Upstash Redis combined with BullMQ for background tasks.

Everything ran smoothly until the system started experiencing modest growth and free-tier quotas were reached. This article dives into the causes and solutions for each specific bottleneck.

The Next.js system is currently using Incremental Static Regeneration (ISR) with SSR. But the misuse of the cookies() function on pages that appear to be public effectively turns these requests into dynamic renders, forcing Vercel to perform constant recalculations.

Additionally, the habit of releasing code multiple times a day along with caching bloated objects due to directly embedding base64 data pushed Write Units to a peak of about 32,000 requests per day, exceeding the allowed Vercel Hobby limit.

cookies() at the render layer..gp and .pdf format documents from the main payload, store them directly on AWS S3, and return only the file path along with slim projection optimization from MongoDB. BullMQ defaults to continuous polling mechanisms in Redis to check for new jobs. With default configurations, workers maintain connections and constantly send commands even in an idle state.

As a result, the free limit of 500,000 commands on Upstash Redis was depleted in a short time, causing a series of background processing pipelines to grind to a halt.

flowchart LR
    A["NestJS Worker"] -->|"Polling 24/7 (Default)"| B["Upstash Redis"]
    B -->|"Reach 500k commands"| C["Rate Limit Exceeded"]
    C --> D["System Crash"]

Optimize BullMQ connection configurations by fine-tuning polling time parameters:

drainDelay and stalledInterval to reduce the frequency of workers pinging Redis when the queue is empty.

const queue = new Queue('pet-tasks', {
  connection: redisConnection,
  defaultJobOptions: {
    attempts: 3,
    backoff: {
      type: 'exponential',
      delay: 5000,
    },
  },
  settings: {
    drainDelay: 30,
    stalledInterval: 60000,
  },
});

Distilled from practical experience, here is a quick checklist to help maintain a stable system without spending money:

headers() in Next.js to avoid accidentally forcing static pages to become dynamic. Running a system on free/hobby tiers requires great care in architectural design and resource management. By refining the Next.js caching strategy and optimizing the BullMQ polling lifecycle, the cat-raising management system is running smoothly again [add result].

── more in #developer-tools 4 stories · sorted by recency
── more on @vercel 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/optimizing-a-blog-sy…] indexed:0 read:2min 2026-12-04 · —