1 blogger4832 Oct 11, 2006 03:11
3 mrdav Oct 14, 2006 19:05
The plugin has not been enabled.
You need at least version 2.0 of the PECL memcache extension.
4 blueyed Oct 14, 2006 19:10
Yes, the plugin requires the PHP extension memcache.
See http://pecl.php.net/package/memcache/ (currently times out)
5 mrdav Oct 14, 2006 21:07
Thanks...now if I can get the host to install it.
Maybe it will be included in the next php version...
6 blueyed Oct 14, 2006 21:55
It won't be included in PHP itself, but from PECL (PHP Extension Community Library). Your host needs to separately install it.
7 rhs98 Mar 27, 2007 12:25
Sorry to drag this back up...but I downloaded, and installed it - it doesn't work "out of the box" on 1.8.6, or at least not for me and my version of PHP (5.2.0).
Anyway - a quick fix - insert this just above "function PluginInit" (though tbh, anywhere sensible in that class will do):
function __construct() {
$this->is_memcache_recent_enough();
}
The problem is the memcache (EvoMemcache) object never gets instantiated, this solves it.
Its probably not to standards, or ideal but it works :D
Some basic performance stats....
Without plugin:
Requests per second: 9.13 [#/sec] (mean)
ukd1:~# ab -n 1000 -c 10 http://www.hughsandeman.co.uk/
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 www.hughsandeman.co.uk (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: lighttpd/1.4.13
Server Hostname: www.hughsandeman.co.uk
Server Port: 80
Document Path: /
Document Length: 25653 bytes
Concurrency Level: 10
Time taken for tests: 109.480858 seconds
Complete requests: 1000
Failed requests: 992
(Connect: 0, Length: 992, Exceptions: 0)
Write errors: 0
Total transferred: 26096895 bytes
HTML transferred: 25654895 bytes
Requests per second: 9.13 [#/sec] (mean)
Time per request: 1094.809 [ms] (mean)
Time per request: 109.481 [ms] (mean, across all concurrent requests)
Transfer rate: 232.78 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 359 1089 281.1 1087 3874
Waiting: 353 1086 280.3 1082 3874
Total: 359 1089 281.1 1087 3874
Percentage of the requests served within a certain time (ms)
50% 1087
66% 1157
75% 1208
80% 1236
90% 1298
95% 1414
98% 1747
99% 2315
100% 3874 (longest request)
With
Requests per second: 10.37 [#/sec] (mean)
ukd1:~# ab -n 1000 -c 10 http://www.hughsandeman.co.uk/
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 www.hughsandeman.co.uk (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: lighttpd/1.4.13
Server Hostname: www.hughsandeman.co.uk
Server Port: 80
Document Path: /
Document Length: 25096 bytes
Concurrency Level: 10
Time taken for tests: 96.394607 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 25471000 bytes
HTML transferred: 25096000 bytes
Requests per second: 10.37 [#/sec] (mean)
Time per request: 963.946 [ms] (mean)
Time per request: 96.395 [ms] (mean, across all concurrent requests)
Transfer rate: 258.04 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 298 959 308.8 932 2989
Waiting: 297 956 309.7 928 2989
Total: 298 959 308.8 932 2989
Percentage of the requests served within a certain time (ms)
50% 932
66% 1014
75% 1066
80% 1102
90% 1188
95% 1326
98% 2134
99% 2509
100% 2989 (longest request)
Which, tbh - is pretty crap improvement.
Is anyone working on this plugin at the moment?
I will probably modify it, and try and work out where its slow - performance should be -much- better than this imho.
Comparison (another, non b2 site with memcaching - same server):
Off
Requests per second: 63.14 [#/sec] (mean)
ukd1:~# ab -n 1000 -c 10 http://www.isitaboat.co.uk/
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 www.isitaboat.co.uk (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: lighttpd/1.4.13
Server Hostname: www.isitaboat.co.uk
Server Port: 80
Document Path: /
Document Length: 13817 bytes
Concurrency Level: 10
Time taken for tests: 15.838788 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 14037816 bytes
HTML transferred: 13817000 bytes
Requests per second: 63.14 [#/sec] (mean)
Time per request: 158.388 [ms] (mean)
Time per request: 15.839 [ms] (mean, across all concurrent requests)
Transfer rate: 865.47 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 86 157 18.9 157 253
Waiting: 85 157 18.9 157 253
Total: 86 157 18.9 157 255
Percentage of the requests served within a certain time (ms)
50% 157
66% 165
75% 169
80% 172
90% 179
95% 186
98% 202
99% 212
100% 255 (longest request)
memcache on:
Requests per second: 225.20 [#/sec] (mean)
ukd1:~# ab -n 1000 -c 10 http://www.isitaboat.co.uk/
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 www.isitaboat.co.uk (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: lighttpd/1.4.13
Server Hostname: www.isitaboat.co.uk
Server Port: 80
Document Path: /
Document Length: 13817 bytes
Concurrency Level: 10
Time taken for tests: 4.440499 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 14037011 bytes
HTML transferred: 13817000 bytes
Requests per second: 225.20 [#/sec] (mean)
Time per request: 44.405 [ms] (mean)
Time per request: 4.440 [ms] (mean, across all concurrent requests)
Transfer rate: 3087.04 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 12 43 30.6 38 289
Waiting: 11 43 29.6 38 289
Total: 12 43 30.6 38 289
Percentage of the requests served within a certain time (ms)
50% 38
66% 41
75% 44
80% 45
90% 56
95% 71
98% 151
99% 280
100% 289 (longest request)
8 blueyed Mar 29, 2007 01:18
rhs98, the plugin is not supported for b2evo 1.8.x - it uses the init method introduces in b2evo 1.9.
When "hacking" this to work with 1.8.x you should rather call
$tmp = array( 'is_installed'=>true );
$this->PluginInit($tmp);
(through __construct() like you do already is fine for PHP5).
Have you confirmed that the plugin actually gets used, e.g. by enabling debugging (see http://manual.b2evolution.net/Debugging) and looking at the Debuglog output?
I guess the problem is that MemCache::connect_and_init() does not get called in your hacked version at all.
My results from my local machine (for v-1-9) look like:
$ ab -n 100 -c 10 http://b2cvs19.local/blogs/index.php/a
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 b2cvs19.local (be patient).....done
Server Software: Apache/2.2.3
Server Hostname: b2cvs19.local
Server Port: 80Document Path: /blogs/index.php/a
Document Length: 267640 bytesConcurrency Level: 10
Time taken for tests: 43.934431 seconds
Complete requests: 100
Failed requests: 97
(Connect: 0, Length: 97, Exceptions: 0)
Write errors: 0
Non-2xx responses: 1
Total transferred: 26565362 bytes
HTML transferred: 26532871 bytes
Requests per second: 2.28 [#/sec] (mean)
Time per request: 4393.443 [ms] (mean)
Time per request: 439.344 [ms] (mean, across all concurrent requests)
Transfer rate: 590.47 [Kbytes/sec] receivedConnection Times (ms)
min mean[+/-sd] median max
Connect: 0 28 102.4 0 537
Processing: 858 4288 6945.7 2509 39284
Waiting: 499 3308 6219.8 2020 39284
Total: 858 4317 6964.7 2509 39284Percentage of the requests served within a certain time (ms)
50% 2509
66% 3132
75% 3629
80% 3991
90% 4978
95% 25904
98% 38859
99% 39284
100% 39284 (longest request)
With the plugin enabled:
daniel@base { ~/cvs/b2evo.v-1-9/blogs/plugins }
$ ab -n 100 -c 10 http://b2cvs19.local/blogs/index.php/a
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 b2cvs19.local (be patient).....done
Server Software: Apache/2.2.3
Server Hostname: b2cvs19.local
Server Port: 80Document Path: /blogs/index.php/a
Document Length: 268180 bytesConcurrency Level: 10
Time taken for tests: 13.776806 seconds
Complete requests: 100
Failed requests: 99
(Connect: 0, Length: 99, Exceptions: 0)
Write errors: 0
Total transferred: 26755791 bytes
HTML transferred: 26711759 bytes
Requests per second: 7.26 [#/sec] (mean)
Time per request: 1377.681 [ms] (mean)
Time per request: 137.768 [ms] (mean, across all concurrent requests)
Transfer rate: 1896.52 [Kbytes/sec] receivedConnection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 66.2 0 364
Processing: 449 1328 986.6 1017 6394
Waiting: 324 1281 960.1 979 6330
Total: 449 1346 1033.5 1017 6394Percentage of the requests served within a certain time (ms)
50% 1017
66% 1220
75% 1397
80% 1510
90% 3253
95% 4052
98% 4408
99% 6394
100% 6394 (longest request)
Oh.. you may want to also make sure that no other plugin is making it "constantly slow", e.g. the DNS blacklist plugin would always check the IP again, in SessionLoaded (yes!, crap - should be cached and not be enabled by default).
btw: your lighttpd/server appears to be quite fast.. ^^
9 rhs98 Mar 30, 2007 14:24
:lol: :lol: cheers - its a Xen session on a reasonably powerful box. My session isn't a large proportion of the server either.
Its running lighttpd and xcache (opcode cacher) which help alot - lighttpd is alot faster than Apache from my experience. I think its mainly lighttpd and server config helping me :)
Anyway - I'll upgrade to 1.9.
I did not confirm that it was running, I just assumed it was from the page count increase.
Is the plugin still under active development?
p.s. if you want I'm happy to share my lighttpd config for b2evo
10 rhs98 Mar 30, 2007 14:54
Upgraded:
On
Requests per second: 14.12 [#/sec] (mean)
ukd1:/home/hugh# ab -n 100 -c 10 http://www.hughsandeman.co.uk/
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 www.hughsandeman.co.uk (be patient).....done
Server Software: lighttpd/1.4.13
Server Hostname: www.hughsandeman.co.uk
Server Port: 80
Document Path: /
Document Length: 25694 bytes
Concurrency Level: 10
Time taken for tests: 7.82862 seconds
Complete requests: 100
Failed requests: 93
(Connect: 0, Length: 93, Exceptions: 0)
Write errors: 0
Non-2xx responses: 1
Total transferred: 2589982 bytes
HTML transferred: 2544668 bytes
Requests per second: 14.12 [#/sec] (mean)
Time per request: 708.286 [ms] (mean)
Time per request: 70.829 [ms] (mean, across all concurrent requests)
Transfer rate: 357.06 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 224 686 707.5 561 7082
Waiting: 217 682 708.2 561 7082
Total: 224 686 707.5 561 7082
Percentage of the requests served within a certain time (ms)
50% 561
66% 641
75% 711
80% 832
90% 1121
95% 1309
98% 1759
99% 7082
100% 7082 (longest request)
Off
Requests per second: 3.55 [#/sec] (mean)
ukd1:/home/hugh# ab -n 100 -c 10 http://www.hughsandeman.co.uk/
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 www.hughsandeman.co.uk (be patient).....done
Server Software: lighttpd/1.4.13
Server Hostname: www.hughsandeman.co.uk
Server Port: 80
Document Path: /
Document Length: 26149 bytes
Concurrency Level: 10
Time taken for tests: 28.144306 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 2647723 bytes
HTML transferred: 2614900 bytes
Requests per second: 3.55 [#/sec] (mean)
Time per request: 2814.431 [ms] (mean)
Time per request: 281.443 [ms] (mean, across all concurrent requests)
Transfer rate: 91.85 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 7.9 0 32
Processing: 824 2684 741.0 2744 4299
Waiting: 704 2345 670.6 2386 3807
Total: 824 2687 739.6 2744 4299
Percentage of the requests served within a certain time (ms)
50% 2744
66% 2922
75% 3153
80% 3258
90% 3781
95% 4032
98% 4221
99% 4299
100% 4299 (longest request)
I'm gonna find out why its so generally slow - 3 pages per sec is awful, and 14 is still pretty bad (though a vast improvement).
11 rhs98 Mar 30, 2007 15:09
Sorry for the multi replies - but it seperates it:
# User@Host: hugh[hugh] @ localhost []
# Query_time: 0 Lock_time: 0 Rows_sent: 156 Rows_examined: [b]17321[/b]
SELECT sess_user_ID
FROM evo_sessions
WHERE sess_lastseen > "2007-03-30 13:51:17"
AND sess_key IS NOT NULL;
This table (sessions) doesn't have proper indexing (or at least not after an upgrade) - adding the following reduces the row's examined to 840 ish.
ALTER TABLE `evo_sessions` ADD INDEX ( `sess_lastseen` )
Though oddly this doesn't help much :-/
12 blueyed Mar 30, 2007 15:11
rhs98 wrote:
Is the plugin still under active development?
Not really. I've started it some months ago and was using it myself. There has never been an official file release though, mainly because 1.9 has not been released until some time ago.
If you want to help out, you know where the source is.. :)
rhs98 wrote:
p.s. if you want I'm happy to share my lighttpd config for b2evo
Sure, though I don't think there's anything special for b2evo in there, is it? Please create a new thread for this then. Thanks!
13 rhs98 Mar 30, 2007 15:52
blueyed wrote:
rhs98 wrote:
Is the plugin still under active development?
Not really. I've started it some months ago and was using it myself. There has never been an official file release though, mainly because 1.9 has not been released until some time ago.
If you want to help out, you know where the source is.. :)
I will, assuming I get time! :)
I need to read up on the changes, and how plugins work :lol:
14 slamp Feb 18, 2009 14:28
Sorry for this very big up, but I have some performance problem on a blog and I want to try memcached.
@blueyed: do you know if your plugin could work with b2evolution 2.4 ?
15 blueyed Feb 18, 2009 16:38
slamp wrote:
@blueyed: do you know if your plugin could work with b2evolution 2.4 ?
Probably yes, just try it..
You also want to setup an PHP accelerator like (XCache, eaccelerator, APC, .. - only one of them, of course).
Those provide a great performance boost already.
16 waltercruz Feb 23, 2009 17:45
I use xcache.. but i would like to see the memcached in action ;)
17 slamp Feb 24, 2009 22:11
I can't use a php accelerator because I'm note able to modify which php extensions are loaded, but I can launch a daemon like memcached. So I compile and install memcached. Next I need to install the plugin and test the blog.
There's a memcache_plugin available here:
http://svn.sourceforge.net/viewvc/evocms-plugins/memcache_plugin/trunk/
Surely it speeds things up. The plugin however is still experimental, but I'm using it on production myself - it's written by me.
Just try it. Works with b2evo 1.8.