Skip to content

BoyceFong/Simple-HttpServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-HttpServer

Java

Implemented meta-functions

  • 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.

Test functions

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.

Test throughput level

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

About

A simple java HttpServer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published