You are viewing william_os4y

Tue, Apr. 15th, 2008, 01:32 pm
fapws2 with libevent-1.4.3-stable

I've just tried compiling fapws2 with the brand new libevent library. With all the changes that they have made inside libevent, I was suprised that fapws2 is running without major changes ;).

Patch for libevent-1.4:
Remove "static" for the procedure called "evhttp_handle_request" in http.c.
FAPWS2 over-writte this procedure, thus it cannot be static ;(.
I've provided my evhttp_handle_request (with backward compatibility), but the libevent development team has not include it ;(.




On the most important feature of fapws2: performance, and based on my simple "hello world" sample, I see a small improvement: 6%. (633#/sec with libevent-1.4.3 against 594#/sec with libevent-1.3e).

Additional tests must be made with this new library but the starting point is promising ;).

William

git repository
Tar file here


Annexe


Patch on the libevent-1.4.3 sources
[libevent]$ diff http.c http_orig.c
1936c1936
< void
---
> static void



with fapws2 based on libevent-1.4.3
[fapws2]# ab -n 1000 -c10 http://127.0.0.1:8080/hello
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        fapws2/0.3
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /hello
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   1.579206 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      105000 bytes
HTML transferred:       13000 bytes
Requests per second:    633.23 [#/sec] (mean)
Time per request:       15.792 [ms] (mean)
Time per request:       1.579 [ms] (mean, across all concurrent requests)
Transfer rate:          64.59 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       3
Processing:     1   15   9.5     12      48
Waiting:        0   14   9.4     12      48
Total:          3   15   9.5     12      48

Percentage of the requests served within a certain time (ms)
  50%     12
  66%     13
  75%     14
  80%     15
  90%     38
  95%     42
  98%     45
  99%     46
 100%     48 (longest request)

with fapws2 based on libevent-1.3e
[root@myhost fapws2]# ab -n 1000 -c10 http://127.0.0.1:8080/hello
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        fapws2/0.2
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /hello
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   1.683275 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      105000 bytes
HTML transferred:       13000 bytes
Requests per second:    594.08 [#/sec] (mean)
Time per request:       16.833 [ms] (mean)
Time per request:       1.683 [ms] (mean, across all concurrent requests)
Transfer rate:          60.60 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1   16   9.5     13      58
Waiting:        0   15   9.4     13      55
Total:          3   16   9.5     13      58

Percentage of the requests served within a certain time (ms)
  50%     13
  66%     14
  75%     16
  80%     19
  90%     29
  95%     42
  98%     44
  99%     48
 100%     58 (longest request)