[Systems] Discovery_One Was a.sl.o migration.

Bernie Innocenti bernie at codewiz.org
Wed Nov 11 14:26:54 EST 2009


El Wed, 11-11-2009 a las 14:17 -0500, Bernie Innocenti escribió:
> El Thu, 05-11-2009 a las 10:25 +0100, Sascha Silbe escribió:
> 
> > > I _think_ that our current bottle neck is our Apache server.  Because
> > > we are running many services, we have several Apache mod_* enabled.
> > > This gives us heavy  Apache processes.
> > In theory, Linux is supposed to create COW (Copy-on-write) mappings on 
> > fork(), i.e. only memory that gets modified by the child process will be 
> > newly allocated.
> > How well that works in practice with Apache I don't know, but maybe 
> > bernie does.
> 
> Apache modules are like shared libraries. The overhead of each library
> you load is 4 more VMA (virtual memory areas) in the process address
> space: code, read-only data, data and bss. On fork, there may be a tiny
> overhead to increment and decrement their use-count.
> 
> Our Apache instance has 648 maps, many of which come from locale files
> and non-optional libraries. A minimal Apache instance on Karmic has 200
> maps. On Rawhide, 334 maps.
> 
> That said, I think this overhead is really negligible compared to all
> the work required to serve a request. I'd be more concerned for the cost
> of each virtual host as well as global rewrite rules, aliases and
> filetypes. Each request has to be matched against a a long series of
> patterns before being dispatched to the proper handler.
> 
> The above overhead may sound huge--and it probably is for serving static
> content. However, it's unmeasurable noise compared with the 20-30ms
> required to process a PHP page of a non-trivial application like Remora
> or Mediawiki. And PHP is still the most efficient server-side language
> you could use.

And here are some numbers to back up my guesses. The first Apachebench
run is on the main page of Remora, the second is on a static html page.
In both cases, I did 1000 requests with a parallelism of 4.


Summary:
 * Remora main page: 4 requests/sec (245ms/req!!!)
 * Static html page: 3000 requests/sec (0.3ms/req)

My original estimate was wrong, by an order of magnitude. Executing
Remora is 10 times slower than I thought.

The number of modules and regular expressions you have really doesn't
matter at all. The only thing that matters is how much PHP you have to
execute in order to answer a request.

----------8<----------8<----------8<----------8<----------8<----------

22!sunjammer:~# ab -n 1000 -c 4
http://activities.sugarlabs.org/en-US/sugar/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking activities.sugarlabs.org (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
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.2.11
Server Hostname:        activities.sugarlabs.org
Server Port:            80

Document Path:          /en-US/sugar/
Document Length:        38403 bytes

Concurrency Level:      4
Time taken for tests:   245.647 seconds
Complete requests:      1000
Failed requests:        998
   (Connect: 0, Receive: 0, Length: 998, Exceptions: 0)
Write errors:           0
Total transferred:      38426819 bytes
HTML transferred:       38071819 bytes
Requests per second:    4.07 [#/sec] (mean)
Time per request:       982.590 [ms] (mean)
Time per request:       245.647 [ms] (mean, across all concurrent
requests)
Transfer rate:          152.76 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   2.5      0      75
Processing:   323  981 314.1    939    2295
Waiting:      313  945 302.1    899    2198
Total:        323  981 314.2    939    2295

Percentage of the requests served within a certain time (ms)
  50%    939
  66%   1070
  75%   1163
  80%   1218
  90%   1397
  95%   1542
  98%   1811
  99%   2013
 100%   2295 (longest request)

----------8<----------8<----------8<----------8<----------8<----------

sunjammer:~# ab -n 1000 -c 4 http://sunjammer.sugarlabs.org/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking sunjammer.sugarlabs.org (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
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.2.11
Server Hostname:        sunjammer.sugarlabs.org
Server Port:            80

Document Path:          /
Document Length:        732 bytes

Concurrency Level:      4
Time taken for tests:   0.323 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      1135134 bytes
HTML transferred:       732732 bytes
Requests per second:    3096.39 [#/sec] (mean)
Time per request:       1.292 [ms] (mean)
Time per request:       0.323 [ms] (mean, across all concurrent requests)
Transfer rate:          3432.44 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       8
Processing:     0    1   0.5      1       8
Waiting:        0    1   0.4      1       3
Total:          0    1   0.6      1       9

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

----------8<----------8<----------8<----------8<----------8<----------

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/



More information about the Systems mailing list