Skip to content

danigallegdup/SENG468_Project

Repository files navigation

Stock Trading App – Scalable Distributed System

A containerized stock trading platform built to endure high-throughput, real-world simulation; sustaining over 17,000 concurrent users under load. The system executes market and limit orders via a custom FIFO matching engine, ensures atomic transaction integrity, and scales through Docker-managed microservices.

Performance bottlenecks were addressed through targeted JMeter stress testing, Redis-based concurrency control, and HAProxy-NGINX experimentation. Complexities like VM crashes, mutex race conditions, and HTTP timeouts were resolved through iterative refactoring and architecture rollback strategies.

Simulated Users Error Rate
1,000 0.00%
10,000 3.94%
12,000 6.07%
15,000 8.70%
17,000 14.04%

Dockerized JMeter Tested Scalability-Optimized JWT Auth Redis Caching Custom Matching Engine Microservices Architecture High Availability

Results

Result for 17k Users: PIE chart Result for 17k Users: 14.04% Error

: PIE chart Result for 15k Users: 8.70% Error

: PIE chart Result for 15k Users: 6.07% Error

Performance Testing Workflow

Port: 4000

1. Clone the Repo

git clone https://github.com/danigallegdup/Stock_Trading_App
cd Stock_Trading_App

2. Build and Start the Services

docker compose up -d --build

3. System Initialization

cd TestRun3
nano Config/stockIds.csv
# Ensure it's empty
# CTRL+O to save, CTRL+X to exit

Then initialize baseline stocks:

jmeter -n -t ./InitialSetup.jmx

🔍 Verify Config/stockIds.csv has no extra lines before proceeding.


4. Simulate 17k+ Concurrent Users

HEAP="-Xms1g -Xmx4g -XX:MaxMetaspaceSize=256m" \
jmeter -n -t test17k.jmx -l 17k_results.log -e -o 17k_results

View detailed test results:

17k_results/index.html

5. Clean Shutdown

docker compose down -v

About

End-to-end development of a scalable day trading system for SENG 468

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5