logo
Parslinks
Back to blog
Guides7 min read

Yalda night sales and Nowruz traffic: getting your site ready for the hour everyone shows up

Campaign traffic isn't a normal day with more visitors. Everyone arrives in the same minute, on the same page, with the same goal.

Alireza Tadi

Co-founder, Parslinks · Team, marketing & infrastructure

December 21st, 8:55pm. Marketing has scheduled the Yalda night sale SMS to two hundred thousand people. (Yalda, the longest night of the year, is one of the biggest shopping evenings in Iran.) At 9:00 the messages go out, and in under three minutes the "Yalda deals" page gets more visits than the whole previous day. At 9:04 the first 502 appears: the database has hit its connection limit. By 9:20, when it's fixed, much of that traffic is gone and not coming back.

The Yalda sale, pre-Nowruz discounts, Black Friday (now a fixture in Iran too), or even one post from an influencer: they all share a pattern. Traffic doesn't climb gradually; it arrives all at once. And arriving all at once breaks things that were never a problem on a normal day.

What breaks first?

From what we've seen in Iranian shops' campaigns, the order is almost always the same:

  1. Database connections. Each app instance holds a pool of connections. Scale out for the campaign and the total exceeds the database's limit, and requests queue at the door.
  2. Queries without indexes. The "discounted items only" filter that ran instantly on ten thousand rows bends the database under a hundred concurrent requests.
  3. Pages that could have been cached but weren't. The campaign page is identical for everyone, yet it's rebuilt on every visit.
  4. External services. Order-confirmation SMS, warehouse stock checks, the payment gateway itself; each has its own limits.

Servers and CPU are usually the last to break, which is why adding instances alone doesn't help, and sometimes makes the first problem worse.

Load testing: measure, don't guess

Two weeks before the campaign, load-test a preview (against a database with production-sized data). Target: three times the highest traffic you saw last campaign. k6 is simple and free:

load-test.js
import http from "k6/http";
import { check, sleep } from "k6";

export const options = {
  stages: [
    { duration: "1m", target: 50 },   // warm-up
    { duration: "30s", target: 600 }, // the moment the SMS lands
    { duration: "5m", target: 600 },
    { duration: "1m", target: 0 },
  ],
  thresholds: { http_req_failed: ["rate<0.01"], http_req_duration: ["p(95)<1500"] },
};

export default function () {
  const res = http.get("https://preview.example.ir/yalda");
  check(res, { "status 200": (r) => r.status === 200 });
  sleep(Math.random() * 3);
}
js18 lines

The key part of this script is the second stage: going from 50 to 600 users in thirty seconds. That's what traffic really looks like after an SMS blast. A test that ramps up gently never sees that moment.

Test the checkout path too, but not against the real gateway; use the gateway's test mode or a simulated response.

The plan, from two weeks out to the morning after

Sales campaign preparation plan from two weeks before to the morning after

Caching: the cheapest capacity

The campaign page, the discounted-products list and product pages are the same for every user, so they don't need a database read per visit. In Next.js, build them with periodic regeneration (say every 60 seconds). Only read stock and the final price from the database at add-to-cart time.

A 60-second cache means the page is built once a minute, whether ten people visit or ten thousand.

Queues: take non-urgent work off the user's path

When a user hits pay, only two things must happen: the order is saved and they go to the gateway. Confirmation SMS, invoice email, stock updates and sales reports can all wait in a queue and run a few seconds later.

The day before: deploy freeze

The simple rule with the biggest impact: from 24 hours before the campaign, no new code ships unless it fixes something critical. And if something does ship, rolling back must take seconds, not a rebuild.

Symptom on campaign nightLikely causeImmediate action
Sudden 502s and 504sDatabase connection limitShrink each instance's pool or enable a pooler
Campaign page slow, rest fastThe page isn't cachedTurn on periodic regeneration for that page
Payments return but orders aren't savedTimeout on the gateway callbackCheck callback logs and raise that route's timeout
Confirmation SMS arriving lateSMS provider rate limitSend through a queue at a controlled rate

Several parts of this plan are simpler on a platform: you run load tests against the branch preview, not production; you raise the instance count for campaign night and lower it the next morning; and if a deploy that day causes trouble, you roll back to the previous version without rebuilding.

One habit for next time

After every campaign, write down three numbers: peak requests per minute, p95 latency at the peak, and the first thing that errored. Those three numbers are the starting point for the next campaign's plan. A team with these notes walks into Nowruz with data, not guesses.

Frequently asked questions

Join the discussion

No comments yet. Be the first to share your thoughts.