Git Product home page Git Product logo

Comments (6)

weltling avatar weltling commented on August 16, 2024

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.

Techmind avatar Techmind commented on August 16, 2024
  1. 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.

weltling avatar weltling commented on August 16, 2024

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.

krakjoe avatar krakjoe commented on August 16, 2024

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.

kowach avatar kowach commented on August 16, 2024

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.

weltling avatar weltling commented on August 16, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.