Coder Social home page Coder Social logo

http-server's Introduction

http-server

A fast http server written in C.

Usage

$ ./http-server

Requirements

Installation

$ mkdir build && cd build && cmake .. && make

Benchmark

$ ab -k -c 10 -n 10000 http://127.0.0.1:7000/

Linux(Xeon 1.80GHz)

Server Software:
Server Hostname:        127.0.0.1
Server Port:            7000

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      100
Time taken for tests:   3.981 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    100000
Total transferred:      10002540 bytes
HTML transferred:       1200252 bytes
Requests per second:    25121.37 [#/sec] (mean)
Time per request:       3.981 [ms] (mean)
Time per request:       0.040 [ms] (mean, across all concurrent requests)
Transfer rate:          2453.88 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       7
Processing:     2    4   0.5      4       7
Waiting:        2    3   0.6      3       6
Total:          3    4   0.6      4      10

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      4
  90%      4
  95%      6
  98%      6
  99%      6
 100%     10 (longest request)

Windows(Intel Core i5/3Hz)

Server Software:
Server Hostname:        localhost
Server Port:            7000

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      40
Time taken for tests:   5.130513 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    100000
Total transferred:      10001004 bytes
HTML transferred:       1200036 bytes
Requests per second:    19491.23 [#/sec] (mean)
Time per request:       2.052 [ms] (mean)
Time per request:       0.051 [ms] (mean, across all concurrent requests)
Transfer rate:          1903.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     1    2   0.3      2      11
Waiting:        0    1   0.7      1      11
Total:          1    2   0.3      2      12

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      2
  90%      2
  95%      3
  98%      3
  99%      3
 100%     12 (longest request)

Linux(Intel Core i5/3Hz)

Server Software:        
Server Hostname:        127.0.0.1
Server Port:            7000

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      10
Time taken for tests:   0.310 seconds
Complete requests:      10000
Failed requests:        0
Keep-Alive requests:    10000
Total transferred:      1000000 bytes
HTML transferred:       120000 bytes
Requests per second:    32291.29 [#/sec] (mean)
Time per request:       0.310 [ms] (mean)
Time per request:       0.031 [ms] (mean, across all concurrent requests)
Transfer rate:          3153.45 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    0   0.2      0       5
Waiting:        0    0   0.1      0       5
Total:          0    0   0.2      0       5

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      0
  95%      0
  98%      1
  99%      1
 100%      5 (longest request)

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

http-server's People

Contributors

i5ting avatar mattn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.