Load tests development for website (Artillery)

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Load Testing Development for Websites (Artillery)

Artillery is a Node.js load testing tool with YAML/JSON configuration. Supports HTTP and WebSocket, easily integrates into CI/CD, has extensions for custom JS scenarios.

Installation

npm install -g artillery

Basic Scenario

# tests/load/basic.yml
config:
  target: "https://staging.example.com"
  phases:
    - duration: 60
      arrivalRate: 5     # 5 new users per second
      name: Warm up
    - duration: 120
      arrivalRate: 20
      name: Ramp up load
    - duration: 300
      arrivalRate: 50
      name: Sustained load
    - duration: 60
      arrivalRate: 100
      name: Stress test

  defaults:
    headers:
      Accept: "application/json"
      Content-Type: "application/json"

  ensure:
    p99: 1000     # 99th percentile < 1000ms
    p95: 500
    maxErrorRate: 1  # less than 1% errors

scenarios:
  - name: Browse catalog
    weight: 60      # 60% of traffic
    flow:
      - get:
          url: "/api/products"
          expect:
            - statusCode: 200
            - hasProperty: "data"
      - think: 2
      - get:
          url: "/api/products/{{ $randomNumber(1, 100) }}"

  - name: Search
    weight: 30
    flow:
      - get:
          url: "/api/search?q={{ $randomString() }}"
          expect:
            - statusCode: [200, 404]

  - name: Contact form
    weight: 10
    flow:
      - post:
          url: "/api/contact"
          json:
            name: "Test User"
            email: "[email protected]"
            message: "Load test message"
          expect:
            - statusCode: 201

Scenario with Authorization

# tests/load/authenticated.yml
config:
  target: "https://staging.example.com"
  phases:
    - duration: 300
      arrivalRate: 20
  variables:
    users:
      - email: "[email protected]"
        password: "pass123"
      - email: "[email protected]"
        password: "pass456"

scenarios:
  - name: Authenticated user flow
    flow:
      - post:
          url: "/api/auth/login"
          json:
            email: "{{ users[0].email }}"
            password: "{{ users[0].password }}"
          capture:
            - json: "$.access_token"
              as: "token"
          expect:
            - statusCode: 200

      - get:
          url: "/api/user/profile"
          headers:
            Authorization: "Bearer {{ token }}"
          expect:
            - statusCode: 200

      - post:
          url: "/api/orders"
          headers:
            Authorization: "Bearer {{ token }}"
          json:
            product_id: 1
            quantity: 1
          expect:
            - statusCode: 201
          capture:
            - json: "$.id"
              as: "orderId"

      - get:
          url: "/api/orders/{{ orderId }}"
          headers:
            Authorization: "Bearer {{ token }}"
          expect:
            - statusCode: 200

Custom JS Processor

# tests/load/custom.yml
config:
  processor: "./processor.js"

scenarios:
  - name: Dynamic flow
    flow:
      - function: "generateDynamicPayload"
      - post:
          url: "/api/data"
          json: "{{ payload }}"
// processor.js
module.exports = { generateDynamicPayload };

function generateDynamicPayload(context, events, done) {
    context.vars.payload = {
        id: Math.floor(Math.random() * 10000),
        timestamp: new Date().toISOString(),
        data: Array.from({ length: 10 }, (_, i) => ({ key: `item_${i}`, value: Math.random() })),
    };
    return done();
}

Running and Reports

# Basic run
artillery run tests/load/basic.yml

# JSON report
artillery run --output report.json tests/load/basic.yml
artillery report report.json  # generates HTML

# Run with environment variables
artillery run \
    --target https://staging.example.com \
    --overrides '{"config": {"phases": [{"duration": 60, "arrivalRate": 10}]}}' \
    tests/load/basic.yml

GitHub Actions

- name: Load Test
  run: |
    artillery run --output results.json tests/load/basic.yml
    artillery report --output load-report.html results.json

- name: Check SLA
  run: |
    ERRORS=$(cat results.json | jq '.aggregate.counters["http.codes.5xx"] // 0')
    P99=$(cat results.json | jq '.aggregate.latency.p99')
    if [ "$ERRORS" -gt "10" ] || [ "$(echo "$P99 > 2000" | bc)" = "1" ]; then
      echo "Load test failed: too many errors or high latency"
      exit 1
    fi

Implementation Timeline

Writing 3–5 load testing scenarios with Artillery: 2–3 days.