Java
- HTTP request analysis
- Respond request
- Data transmission
- Log in
- Log up
Based on the meta-functions above, this simple HttpServer can achieve some basic http request such as transmit picture, transmit music file, support download, log in, register account and so on.
I made a simple webpage to test whether HttpServer is available. The simple webpage illustrated follow.
1. Register account
Before registering, the account record of server background.
Register account: tangmoon and password: 888888
Then it will jump to another page and notice whether successful.
If successd, the server background will add an account record.
2. Play music
Press the botton of play, normally the music will load successfully and play.
3. Download something
We can download some resource such the music above. Click the download botton.
The next step is evaluating the throughput level. I used WSL (a Linux sub-system based on Windows) and Siege (a high-performance http stress testing tool) to test this HttpServer. Here are my testing results.
The configuration of machine which used for testing.
1. 200 concurrency, 100 requests per sec, test 5 minutes
HttpServer configuration: FixedThreadPool, 8 threads
2. 400 concurrency, 100 requests per sec, test 10 seconds
HttpServer configuration: FixedThreadPool, 8 threads
3. 1000 concurrency, 100 requests per sec, test 10 seconds
HttpServer configuration: FixedThreadPool, 32 threads