#2905: Performance improvements

Type: FeatureItem Feature:   Tags: serpro
ScheduledFor: 0.45.1 Assigned to: VictorCosta Sites:  
Priority: 0 Status: Done  

Performance improvements in Application Controller.

This Action Item were focused on the issues described below.

Change the way as the view path of plugins are loaded.

Results and instructions on how to reproduce.

ab -c 20 -n 100 $NOOSFERO/account/login

  Requests per second Time per request (ms)
before 9.67 2069.301
after 26.37 758.532


ab -c 10 -n 50 $NOOSFERO/profile/i-like-organic-food

  Requests per second Time per request (ms)
before 6.66 1501.503
after 10.96 912.153

Avoid multiplication of filters defined by plugins

Steps to reproduce:

1. Enable a plugin that adds a filter (eg. Work Assignment Plugin);

2. Access a controller url that has the filter added;

3. A new filter method will be added to the controller on each request.

Run this command to see the response time of requests increasing over time:

ab -c 1 -n 1000 $NOOSFERO/joao-abreu/debian-day

  First response time (ms) Last response time (ms)
before 250 1670
after 154 138


The code is here:

https://gitlab.com/noosfero/noosfero/merge_requests/45

-- VictorCosta - 18 Nov 2013

Hey Victor!

This is an amazing catch! I don't know if this is going to solve all of our leakage problems, but it sure shows a great improvement. I generated a package of the current stable branch with your merge-request and tested it out on our alpha server and I also got nice results. Here they are:

Before
This is ApacheBench, Version 2.3 <$Revision: 1.7 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking alpha.colivre.coop.br (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:        thin
Server Hostname:        alpha.colivre.coop.br
Server Port:            80

Document Path:          /ze/blog/teste-bli
Document Length:        38834 bytes

Concurrency Level:      1
Time taken for tests:   1263.418 seconds
Complete requests:      1000
Failed requests:        113
   (Connect: 0, Receive: 0, Length: 113, Exceptions: 0)
Write errors:           0
Total transferred:      39438605 bytes
HTML transferred:       38834113 bytes
Requests per second:    0.79 [#/sec] (mean)
Time per request:       1263.418 [ms] (mean)
Time per request:       1263.418 [ms] (mean, across all concurrent requests)
Transfer rate:          30.48 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       25   31  26.6     27     299
Processing:   638 1232 561.3   1191   15463
Waiting:      550 1043 327.9   1034    7819
Total:        669 1263 572.9   1217   15490

Percentage of the requests served within a certain time (ms)
  50%   1217
  66%   1348
  75%   1426
  80%   1451
  90%   1517
  95%   1561
  98%   2039
  99%   3259
 100%  15490 (longest request)

The standard deviation, failed requests and longest request speak for themselves.

After
This is ApacheBench, Version 2.3 <$Revision: 1.7 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking alpha.colivre.coop.br (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:        thin
Server Hostname:        alpha.colivre.coop.br
Server Port:            80

Document Path:          /ze/blog/teste-bli
Document Length:        38896 bytes

Concurrency Level:      1
Time taken for tests:   496.974 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      39500000 bytes
HTML transferred:       38896000 bytes
Requests per second:    2.01 [#/sec] (mean)
Time per request:       496.974 [ms] (mean)
Time per request:       496.974 [ms] (mean, across all concurrent requests)
Transfer rate:          77.62 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       24   28   5.0     27     123
Processing:   414  469  39.5    453     819
Waiting:      326  381  36.6    366     729
Total:        441  497  40.9    480     941

Percentage of the requests served within a certain time (ms)
  50%    480
  66%    494
  75%    531
  80%    539
  90%    549
  95%    559
  98%    594
  99%    634
 100%    941 (longest request)

A standard deviation of 41ms, that's what we want.

PS: note that for terms of proper testing I needed to include a session cookie so that the connections were done as a logged user and varnish as bypassed. For that use the -C option of ab.

-- RodrigoSouto - 06 Jan 2014
Add comment
You need to login to be able to comment.
 

ActionItemForm edit

Title Performance improvements
ActionItemType FeatureItem
Priority Low
Tags serpro
Feature
Plugin
ResponsibleDevelopers VictorCosta
ScheduledFor 0.45.1
AffectsVersion
Status Done
Ticket SAC:
who cares RodrigoSouto
Topic revision: r7 - 07 Jan 2014, RodrigoSouto

irc Talk with Devs Now!

 
Translations: English
Search on Docs:
   
ActionItem Search:

Copyright © 2007-2018 by the Noosfero contributors
Colivre - Cooperativa de Tecnologias Livres