Skip to content

Instantly share code, notes, and snippets.

@ricardclau
Created March 7, 2013 18:36
Show Gist options
  • Save ricardclau/5110543 to your computer and use it in GitHub Desktop.
Save ricardclau/5110543 to your computer and use it in GitHub Desktop.
Symfony2 Performance Tests
==========================
What is tested? Basically the simplest application you can develop with Symfony2 (Version 2.2.0).
Composer was run with -o flag which optimizes autoload creating a classmap
<?php
namespace RicardClau\Bundle\BenchmarkBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DefaultController extends Controller
{
/**
* @Route("/benchmark", name="benchmark")
* @return \Symfony\Component\HttpFoundation\Response
*/
public function benchmarkAction()
{
return new \Symfony\Component\HttpFoundation\Response('zend optimizer +');
}
}
Machine used: Macbook Air with 1.8 Ghz i5 and 8Gb ram, HD is SSD
Results with ab -n 5000 -c 10
=============================
PHP 5.4.12 without APC
----------------------
~ 37 req / s
PHP 5.4.12 with APC 3.1.13 no custom
------------------------------------
~ 180 req / s
PHP 5.4.12 with APC 3.1.13 and apc.stat = Off
---------------------------------------------
~ 195 req / s
PHP 5.4.12 with Zend Optimizer+ no custom
-----------------------------------------
~ 211 req / s
PHP 5.4.12 with Zend Optimizer+ recommended settings
----------------------------------------------------
zend_optimizerplus.memory_consumption=128
zend_optimizerplus.interned_strings_buffer=8
zend_optimizerplus.max_accelerated_files=4000
zend_optimizerplus.revalidate_freq=60
zend_optimizerplus.fast_shutdown=1
zend_optimizerplus.enable_cli=1
~ 220 req / s
PHP 5.4.12 with Zend Optimizer+ extreme settings
----------------------------------------------------
All of the above plus
zend_optimizerplus.save_comments=0
zend_optimizerplus.enable_file_override=1
~ 202 req / s
@pierrre
Copy link

pierrre commented Mar 7, 2013

With ApcClassLoader enabled?

@ricardclau
Copy link
Author

No, should be almost the same as apc.stat set to Off but will anyway I will do the test tomorrow and publish the results in my blog

@Ziumin
Copy link

Ziumin commented Mar 8, 2013

Could you test it with this string return new \Symfony\Component\HttpFoundation\Response('APC');?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment