Giter VIP home page Giter VIP logo

ua-loadtest's Introduction

Ukraine National Load-Testing

Nest Logo Nest Logo

Forks Last commit (master) Repo Stars License Issues

๐Ÿ˜Ž Overview

  • The repo contains Nest.JS application, which uses russian proxies and do load testing of web resources using API.
  • โš  The app uses a proxy, but be careful, it is desirable to use a VPN.

Wait, another one?

Yep, here are some reasons to use this app:

  • ๐Ÿ™Œ App works fully unattended
  • โ˜๏ธ Default configuration works perfectly on the cheapest $6/mo DigitalOcean instance:
    • 1 vCPU
    • 1 Gb RAM
  • ๐Ÿง  App consumes always near the same amount of resources, no matter doing load-testing of 5 sites or 50`000
  • ๐Ÿ”„ URLs and Proxies will be automatically updated in a runtime
  • ๐Ÿ‹๏ธ Designed with Docker and Clouds in mind
  • ๐Ÿ’ข๏ธ Coded with pure anger
  • ๐Ÿ Eco-friendly
  • ๐Ÿฅฆ Gluten-free

๐Ÿš€ Quick start

Docker

  • Install Docker

  • Download docker image:

    docker pull ghcr.io/alexander-danilenko/ua-loadtest:latest
  • Run the container: (docs)

    docker run --rm -d ghcr.io/alexander-danilenko/ua-loadtest:latest
  • List running containers: (docs)

  • Stop running container: (docs)

  • See logs for running container: (docs)

See .env file for the available environment variables. All these values could be adjusted for the container.

For overriding environment variables in the container started with docker run command, modify command for having variables in the following format:

docker run --rm -d -e 'NO_COLOR=1' -e 'LOG_SUMMARY_TABLE=true' ghcr.io/alexander-danilenko/ua-loadtest:latest

Docker Compose

docker-compose allows you to easily run containers in parallel without having to keep multiple terminals opened. To run on servers - perfect choice.

version: '3'
services:
  # To run several containers in parallel use scale argument:
  # docker-compose up --build --scale app=5
  app:
    image: ghcr.io/alexander-danilenko/ua-loadtest:latest
    restart: unless-stopped # Re-run after system reboot or docker daemon restart.
    environment:
      NO_COLOR: 'true' # Disables colored output for better logs in clouds.
      ## Defines amount of concurrent requests per second.
      #REQUESTS_CONCURRENCY: 500 # Adjust only if needed. Recommended: 500 * {RAM GB}
      # Print summary table with results.
      LOG_SUMMARY_TABLE: 'false'
      # Log response status codes to console during load testings.
      LOG_RESPONSE_SUCCESS: 'false'
      LOG_RESPONSE_TIMEOUT: 'false'
      LOG_RESPONSE_ERROR: 'false'
      # UAShield settings.
      UASHIELD_USE_PROXY: 'true'
      ## Override target URLs. Needs to be valid JSON array with URLs.
      #UASHIELD_TARGETS: '["https://kremlin.ru", "https://www.sberbank.ru"]'
      UASHIELD_URLS: 'https://raw.githubusercontent.com/opengs/uashieldtargets/v2/sites.json'
      UASHIELD_PROXIES: 'https://raw.githubusercontent.com/opengs/uashieldtargets/v2/proxy.json'

โš ๏ธ NOTE: in docker-compose.yml file all the true and false values needs to be passed as lowercase strings (using quotes) like following: VARIABLE_NAME: 'true'

Node.JS

  • Install Node v16: https://nodejs.org/en/download/

  • Clone repository:

    git clone https://github.com/alexander-danilenko/ua-loadtest
  • Install all the required dependencies:

    yarn install
  • Build the app:

    yarn build
  • Run the app in production mode:

    yarn start:prod

โš™๏ธ Runtime config recommendations

Run container using docker-compose or use --restart unless-stopped docker parameter. Just in case.

DigitalOcean

โค๏ธ The following scripts are tested and primarely used by maintainers.

Use the following User data scripts for automated initialization of droplet considering its resources:

ua-loadtest's People

Contributors

alexander-danilenko avatar

Watchers

 avatar

Forkers

crazyklug

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.