mirror of
https://github.com/mrclay/minify.git
synced 2025-08-28 08:10:14 +02:00
Memcache ab testing (memcached seems to be running out of connections on XP)
This commit is contained in:
@@ -11,5 +11,5 @@ Minify::serve('Files', array(
|
||||
'files' => array(
|
||||
dirname(__FILE__) . '/before.js'
|
||||
)
|
||||
,'setExpires' => $_SERVER['REQUEST_TIME'] + 31536000 // 1 yr
|
||||
,'maxAge' => 31536000 // 1 yr
|
||||
));
|
||||
|
19
min_extras/ab_tests/minify/test_Files_Memcache.php
Normal file
19
min_extras/ab_tests/minify/test_Files_Memcache.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require '../../config.php';
|
||||
|
||||
require 'Minify.php';
|
||||
require 'Minify/Cache/Memcache.php';
|
||||
|
||||
$mc = new Memcache;
|
||||
if (! $mc->connect('localhost', 11211)) {
|
||||
die();
|
||||
}
|
||||
Minify::setCache(new Minify_Cache_Memcache($mc));
|
||||
|
||||
Minify::serve('Files', array(
|
||||
'files' => array(
|
||||
dirname(__FILE__) . '/before.js'
|
||||
)
|
||||
,'maxAge' => 31536000 // 1 yr
|
||||
));
|
@@ -11,5 +11,5 @@ Minify::serve('Groups', array(
|
||||
'groups' => array(
|
||||
'test' => array(dirname(__FILE__) . '/before.js')
|
||||
)
|
||||
,'setExpires' => $_SERVER['REQUEST_TIME'] + 31536000 // 1 yr
|
||||
,'maxAge' => 31536000 // 1 yr
|
||||
));
|
||||
|
@@ -1,38 +1,9 @@
|
||||
Document Path: /min_extras/ab_tests/ideal_php/before.php
|
||||
Document Length: 15993 bytes
|
||||
Requests per second: 415.58 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min_extras/ab_tests/v1.0/minify.php?files=before.js
|
||||
Document Length: 54159 bytes
|
||||
Requests per second: 275.86 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min_extras/ab_tests/minify/test_Files.php
|
||||
Document Length: 15993 bytes
|
||||
(Connect: 0, Length: 4, Exceptions: 0)
|
||||
Requests per second: 239.70 [#/sec] (mean)
|
||||
Requests per second: 248.06 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min_extras/ab_tests/minify/test_Groups.php/test
|
||||
Document Path: /min_extras/ab_tests/minify/test_Files_Memcache.php
|
||||
Document Length: 15993 bytes
|
||||
(Connect: 0, Length: 2, Exceptions: 0)
|
||||
Requests per second: 204.15 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min_extras/ab_tests/minify/test_Version1.php?files=before.js
|
||||
Document Length: 15993 bytes
|
||||
(Connect: 0, Length: 2, Exceptions: 0)
|
||||
Requests per second: 233.58 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min/?f=min_extras/ab_tests/minify/before.js
|
||||
Document Length: 15993 bytes
|
||||
(Connect: 0, Length: 1, Exceptions: 0)
|
||||
Requests per second: 246.63 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min_extras/ab_tests/mod_deflate/before.js
|
||||
Document Length: 16053 bytes
|
||||
(Connect: 0, Length: 1, Exceptions: 0)
|
||||
Requests per second: 191.04 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
Document Path: /min_extras/ab_tests/type-map/before.js.var
|
||||
Document Length: 15993 bytes
|
||||
(Connect: 0, Length: 1, Exceptions: 0)
|
||||
Requests per second: 518.22 [#/sec] (mean)
|
||||
(Connect: 0, Length: 17, Exceptions: 0)
|
||||
Requests per second: 181.56 [#/sec] (mean)
|
||||
--------------------------------------------------------------------------------
|
||||
|
@@ -2,8 +2,9 @@
|
||||
|
||||
@SET DOMAIN=http://mc.dev
|
||||
|
||||
::@SET ABCALL=ab -d -S -c 100 -n 2000 -H "Accept-Encoding: deflate, gzip" http://localhost
|
||||
@SET ABCALL=ab -d -S -c 100 -n 2000 -H "Accept-Encoding: deflate, gzip"
|
||||
:: for priming cache
|
||||
@SET ABPRIM=ab -d -S -c 1 -n 2 -H "Accept-Encoding: deflate, gzip"
|
||||
|
||||
@SET ABTESTS=%DOMAIN%/min_extras/ab_tests
|
||||
|
||||
@@ -14,6 +15,17 @@
|
||||
|
||||
DEL results.txt
|
||||
|
||||
:: prime caches (though some may not need it)
|
||||
%ABPRIM% %ABTESTS%/ideal_php/before.php
|
||||
%ABPRIM% %ABTESTS%/v1.0/minify.php?files=before.js
|
||||
%ABPRIM% %ABTESTS%/minify/test_Files.php
|
||||
%ABPRIM% %ABTESTS%/minify/test_Files_Memcache.php
|
||||
%ABPRIM% %ABTESTS%/minify/test_Groups.php/test
|
||||
%ABPRIM% %ABTESTS%/minify/test_Version1.php?files=before.js
|
||||
%ABPRIM% %DOMAIN%/min/?f=min_extras/ab_tests/minify/before.js
|
||||
%ABPRIM% %ABTESTS%/mod_deflate/before.js
|
||||
%ABPRIM% %ABTESTS%/type-map/before.js.var
|
||||
|
||||
:: baseline PHP
|
||||
%ABCALL% %ABTESTS%/ideal_php/before.php >> results.txt
|
||||
@%DELIM% >> results.txt
|
||||
@@ -26,6 +38,10 @@ DEL results.txt
|
||||
%ABCALL% %ABTESTS%/minify/test_Files.php >> results.txt
|
||||
@%DELIM% >> results.txt
|
||||
|
||||
:: Files controller w/ Memcache as cache
|
||||
%ABCALL% %ABTESTS%/minify/test_Files_Memcache.php >> results.txt
|
||||
@%DELIM% >> results.txt
|
||||
|
||||
:: Groups controller
|
||||
%ABCALL% %ABTESTS%/minify/test_Groups.php/test >> results.txt
|
||||
@%DELIM% >> results.txt
|
||||
|
13
min_extras/ab_tests/test_memcache.bat
Normal file
13
min_extras/ab_tests/test_memcache.bat
Normal file
@@ -0,0 +1,13 @@
|
||||
@SET PATH=%PATH%;C:\xampp\apache\bin
|
||||
|
||||
@SET DOMAIN=http://mc.dev
|
||||
|
||||
@SET ABTESTS=%DOMAIN%/min_extras/ab_tests
|
||||
|
||||
ab -d -S -c 1 -n 2 -H "Accept-Encoding: deflate, gzip" %ABTESTS%/minify/test_Files_Memcache.php
|
||||
|
||||
DEL results.txt
|
||||
|
||||
ab -d -S -c 100 -n 1000 -H "Accept-Encoding: deflate, gzip" %ABTESTS%/minify/test_Files_Memcache.php >> results.txt
|
||||
|
||||
START "C:\Program Files\Notepad++\notepad++.exe" results.txt
|
Reference in New Issue
Block a user