Comments (6)
I'm not sure about the meaning of this test. If possible, could you do some changes to how it's run? Namely
- simplify the test scripts to contain the relevant code only
- especially don't mix the extensions in the same test run if you want to compare them
- for http tests use ab or old good tools alike
- for http tests run the test tool from another machine
- do not sort away the data
Such tests are of course interesting, but they have to be done under clean conditions to be reliable.
Thanks.
from apcu.
-
meaning of the test - perfomance of operations degrades over time => cirtical bug, not acceptable for a cache.
- simplify the test scripts to contain the relevant code only
dropped commented data & eacelerator usage - especially don't mix the extensions in the same test run if you want to compare them =>
Eaccelerator used as common point of synchronization(to start all web-threads as same time), doesn't actually tested here, rewrote to use acpu for syncronization too - for http tests use ab or old good tools alike
Well actually its not an http test, i need to get responses because i sum them to get total amount of responses per estimated time, so ab could not be used. - for http tests run the test tool from another machine -
Was actually done that way, i replaced it to localhost for easier replayability. - do not sort data away
Yea sorry i was actually interested in top performance of each for correct comparison, rewrote original message a bit
from apcu.
Ok, I've been probably unclear. The test how you do it now has a broken idea, so it can't be plausible.
- you talk about time but count iterations, you see?
- even that small script has way too much stuff, testing sleep, microtime and other stuff isn't the intention
- running curl by forking is a bad idea - none of interest is the time processes going up and down, connecting, disconnecting, hanging or not, etc.
- the test IS a HTTP test, as otherwise there's no chance to reproduce the behavior of multiple threads/processes
So how to do it. The question to be answered is - how much time is needed to complete the operation? That means, the answer should be measured in time units, not iterations.So lets test the operation, pure. From your script, it's like
for ($i = 0; $i < 4096; ++$i) {
$x = apcu_store('test', 1);
$x = apcu_fetch('test');
$x = apcu_delete('test');
}
For measurements lets take ab as the most available tool. Some useful options it has are -c and -n. A good result can be achieved when setting -c to the number of cores on the test machine. -n value could be some multiple of -c, but anyway bigger or equal. Actually, having a 4 core machine, i run ab like
ab -c4 -n100 http://xxx.xxx.xxx.xxx/apcu_bench.php
As in your approach, you even can pack that ab cmd into the loop, if you wish. Then you'll see how the results differ in each run. ab will run the concurrent request in much more convenient way than the fork approach. Besides that ab will deliver some useful information. Forked processes approach is really a thing out of control. If one hangs a ms longer still having an open connection, but another curl is forked and waits for connection- you might have much more curl processes than you imagine. And as they all have an open connection, that will slowdown the server. Repeating that again and again means just DDoS'ing the server. So that's really a bad idea, and that's probably the reason you get it evermore slower. If you don't like ab, so take any other appropriate tool. But please do it the way I've described. Actually I'm really curious about the results you get :)
Thanks.
from apcu.
Closing, no feedback ...
I'm not finishing the conversation, @Techmind if you are able to do as weltling suggests and find strange behavior feel free to open the bug, just trying to keep on top of things ...
from apcu.
I was doing some simple testing (on project heavily using apc user cache):
ab -H "Connection:close" -c 20 -n 100 http://localhost/
repeated 5 times, these are best results:
PHP 5.4.17 with APC:
Requests per second: 9.69 #/sec
PHP 5.5.3 (opcode cache is turned on by default?) with APCu:
Requests per second: 7.12 #/sec
That is around 25% degradation?
from apcu.
@kowach, What this ticket was about is the degradation over time, that's probably not what your test was about. So one can still can call it degradation, but sense it has is the comparsion of two cache variants.
It were great if you could extract some synthetic test cases, so then you could file a new ticket about APC vs. opcache+APCu.
from apcu.
Related Issues (20)
- Could OOM Killer cause APCU deadlock ? HOT 1
- Valgrind Use of uninitialised value of size 8 in php_var_unserialize_internal() via php_apc_unserializer() HOT 2
- start_time in apcu_cache_info() HOT 2
- Test tests/typed_prop.phpt fails on PHP 8.3 HOT 1
- Enable igbinary as serializer Cause PHP 8.2 exited on signal 4 HOT 1
- segmentation fault when calling phpinfo() in ZTS builds HOT 2
- Unable to install on Mac M2 HOT 2
- compliation error on RedHat 8.2: zend_signal.h:46:2: error: unknown type name ‘siginfo_t’ HOT 4
- DLL missing HOT 2
- Create new release HOT 4
- apc.php shows wrong timestamps HOT 1
- DLL for PHP 8.3 (Windows) missing HOT 1
- %d printf specifier for key_t fails if the type is actually long (which is allowed by POSIX)
- apc_cache.c has two format specifier bugs (with patch) HOT 1
- Windows DLL for APCu 5.1.23 HOT 1
- Introduce documentation for setting "apc.smart"
- Store an \SplPriorityQueue HOT 1
- Windows DLL available to download HOT 1
- Expunges happen without hitting limits HOT 1
- `apcu_fetch` returns `success` for missing keys HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apcu.