This project is a hands-on demonstration of different Java server concurrency models using sockets:
- ✅ Single-threaded Server
- ❌ Multi-threaded Server
- ✅ Thread Pool Server
All implementations were tested using Apache JMeter under high request loads (up to 10,000 requests per minute). Performance results are included with screenshots.
- Java 8+
- Apache JMeter
- Java Networking (Sockets)
- Java Concurrency (Threads, ExecutorService)
- Handles one client at a time
- Good for simple or controlled environments
- Efficient at low traffic
✅ Test Result:
- Able to handle 10,000 requests/min successfully.
Screen.Recording.2025-06-09.142723.mp4
- Spawns a new thread for each client connection
- Under high load, system runs out of resources
❌ Test Result:
- Fails completely at 10,000 RPM
- No successful requests
Screen.Recording.2025-06-09.144742.mp4
- Uses
Executors.newFixedThreadPool() - Limits the number of threads
- Handles high load efficiently and safely
✅ Test Result:
- Smooth performance under high load
- 100% success rate with 10,000+ RPM
Untitled.video.-.Made.with.Clipchamp.mp4
Test Config:
- 10,000 requests per minute
- 100 concurrent threads
- 1-minute ramp-up
Metrics Tracked:
- % Success
- Avg. Response Time
| Server Type | Success Rate | Notes |
|---|---|---|
| Single Thread | ✅ 100% | Processes one request at a time |
| Multi Thread | ❌ 0% | Crashed due to thread exhaustion |
| Thread Pool (10) | ✅ 100% | Efficient concurrency + resource control |
javac Server.java Client.java
🧵 Run Single Thread Server
cd single_thread
java Server
🔁 Run Multi Thread Server
cd multi_thread
java Server
🧠 Run Thread Pool Server
cd thread_pool
java Server


