Sign inSign up

makiato1999/dynamic-thread-pool

By makiato1999

•Updated over 1 year ago

Image
0

327

makiato1999/dynamic-thread-pool repository overview

⁠Dynamic Thread Pool Deployment Guide

The source code for this project is available on my GitHub:
Dynamic Thread Pool Repository⁠

This document provides step-by-step instructions to deploy and run the Dynamic Thread Pool system using prebuilt Docker images.

⁠Prerequisites

Before proceeding, ensure you have the following installed on your system:

  1. Docker

  2. Docker Compose

    • Verify Docker Compose installation:
      docker-compose --version
      

⁠Pulling Docker Images

Pull the required Docker images from Docker Hub:

docker pull makiato1999/dynamic-thread-pool:dev-ops-admin
docker pull makiato1999/dynamic-thread-pool:dev-ops-test
docker pull makiato1999/dynamic-thread-pool:redis
docker pull makiato1999/dynamic-thread-pool:redis-commander

⁠Running the Application

⁠Step 1: Create a docker-compose.yml

Create a docker-compose.yml file with the following content:

version: '3.9'
services:
  redis:
    image: makiato1999/dynamic-thread-pool:redis
    container_name: redis
    restart: always
    hostname: redis
    ports:
      - 16379:6379
    networks:
      - my-network

  redis-admin:
    image: makiato1999/dynamic-thread-pool:redis-commander
    container_name: redis-admin
    hostname: redis-commander
    restart: always
    ports:
      - 8081:8081
    environment:
      - REDIS_HOSTS=local:redis:6379
    networks:
      - my-network

  admin:
    image: makiato1999/dynamic-thread-pool:dev-ops-admin
    container_name: admin
    restart: always
    ports:
      - 8090:8090
    environment:
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
    networks:
      - my-network

  test:
    image: makiato1999/dynamic-thread-pool:dev-ops-test
    container_name: test
    restart: always
    ports:
      - 8080:8080
    environment:
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      ADMIN_HOST: admin
      ADMIN_PORT: 8090
    networks:
      - my-network

networks:
  my-network:
    driver: bridge

⁠Step 2: Start the Application

Run the following command to start all services:

docker-compose up -d

This will start the following services:

  • Redis: A caching and message broker service (port 16379).
  • Redis Commander: A UI for managing Redis data (port 8081).
  • Backend Admin Service: The API backend for the thread pool management system (port 8090).
  • Test Service: Used for API testing (port 8080).

⁠Accessing the Application

⁠Redis Admin Interface

Access the Redis administration interface at: http://localhost:8081⁠ Use this tool to monitor and manage Redis data.

⁠Backend Admin API

Base URL: http://localhost:8090/api/v1/dynamic/thread/pool/⁠ Available Endpoints: Query Thread Pools: Retrieve a list of thread pools.

GET /query_thread_pool_list

Query Thread Pool Config: Retrieve the configuration of a specific thread pool.

GET /query_thread_pool_config?appName=<app_name>&threadPoolName=<pool_name>

Update Thread Pool Config: Update the configuration of a thread pool.

POST /update_thread_pool_config
⁠Frontend Dashboard

The frontend dashboard is available in the docs/front directory of the repository. Serve it locally using any HTTP server. For example:

cd /path/to/docs/front
python3 -m http.server 8082

Access the frontend at: http://localhost:8082⁠

⁠Stopping the Application

To stop all running containers:

docker-compose down

⁠Cleaning Up Docker Images

If you need to remove local Docker images:

List all images:

docker images

Remove specific images:

docker image rm <image_name>

Tag summary

Content type

Image

Digest

sha256:8e32502b5…

Size

42.3 MB

Last updated

over 1 year ago

docker pull makiato1999/dynamic-thread-pool:redis-commander