How migoxlab/lmeterx works
Project type and purpose
• LMeterX is a full-stack, microservices-based performance testing platform for large language models.
• It provides a React/TypeScript web UI, a FastAPI backend, a Locust-based load-testing engine, and a MySQL database.
• Users create test tasks via the UI; the system runs high-concurrency requests against LLM inference endpoints (self-hosted frameworks or cloud APIs) and stores results for analysis.
File structure
Top-level:
• docker-compose.yml / docker-compose.dev.yml / quick-start.sh – compose scripts for orchestration.
• mysql/ – custom MySQL Dockerfile.
• init_db.sql – initial schema.
• backend/ – FastAPI service:
• api/ – route handlers (task, upload, analysis, logs, system)
• service/ – business logic
• db/ – SQLAlchemy setup and raw SQL
• middleware/, utils/, model/, tests/
• st_engine/ – load-testing engine service:
• engine/ – core Locust extensions, runner, processor, monitor
• service/ – task poller & result service
• db/ – database client (same MySQL)
• config/, utils/, data/ (prompts, datasets), tests/
• frontend/ – React + TypeScript + Ant Design UI:
• src/api – HTTP client & service definitions
• src/pages, components, hooks, utils, contexts, i18n
• Dockerfile, nginx.conf, env files for deployment
README for architecture insights
• Called out 4 core components:
1. Frontend Interface (React)
2. Backend Service (FastAPI + SQLAlchemy)
3. Load Testing Engine (Locust + custom extensions)
4. MySQL Database
• Mentions reverse proxy (Nginx) and external dependencies (LLM inference frameworks and cloud APIs).
• Web UI (Frontend)
• API Gateway / Reverse Proxy (Nginx)
• Backend Service (FastAPI)
• Load Testing Engine (st_engine)
• MySQL Database
• External LLM Inference Services (self-hosted frameworks & cloud providers)
1. User → Browser → HTTP(S) → Nginx → Frontend (Static files)
2. Frontend → HTTP(S) → Nginx → Backend API (task creation, status, logs, results)
3. Backend ↔ MySQL (read/write task metadata, mapping configurations, logs)
4. st_engine polls Backend API or directly reads DB for pending tasks → schedules Locust workers
5. Locust workers → HTTP(S) → External LLM endpoints → collect latency/throughput data
6. st_engine writes results back to MySQL (via its DB client) or calls Backend API to store results
7. Frontend fetches live logs & final reports from Backend API
c. Architectural patterns & design principles:
• Microservices: backend and engine are separate services, independently scalable.
• Clean layering in each service: API → Service → Model → DB
• Event-driven or poller pattern: st_engine polls for tasks, processes, then updates results.
• Infrastructure as code: Dockerfiles for each service, Docker Compose for orchestration, Kubernetes manifests optional.
d. Key technologies & frameworks:
• Frontend: React, TypeScript, Ant Design, Vite, i18n
• Backend: Python, FastAPI, SQLAlchemy, Pydantic, MySQL
• Engine: Python, Locust, multiprocess support, custom Locust runner/monitor
• Deployment: Docker, Docker Compose, Nginx, optional Kubernetes