Giter VIP home page Giter VIP logo

Comments (16)

bparees avatar bparees commented on August 24, 2024

can you elaborate? what sort of performance issue? memory usage? cpu? during build? application runtime? has it gone up from previous versions of the 5.6 image? how does it compare with the same metrics for the 5.5 image?

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

Sorry edited my initial message just as you replied.

Applications running with 5.6 are significantly slower to respond which often leads to 504 responses
Switching to use 5.5 or 7.0 do not have the problem and they perform much faster

It's not a resource issue as metrics do not report any limits being reached

from s2i-php-container.

bparees avatar bparees commented on August 24, 2024

Can you define significantly? does this apply to trivial(hello world) apps? Have you done any profiling to see where the time is being spent?

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

Here is just some basic tests a customer ran, this seems to run slower across all the PHP images (in comparison to local PHP and an OpenShift 2 cluster):

time php test.php

<?php

function tryAlloc($megabyte){ 
echo "try allocating {$megabyte} megabyte..."; 
$mark = microtime(true); 
$dummy = str_repeat("-",1048576*$megabyte); 
echo "allocation time : " . sprintf("%f", microtime(true)-$mark) . "\n"; 
echo "Usage: " . memory_get_usage(true)/1048576; 
echo " Peak: " . memory_get_peak_usage(true)/1048576; 
echo "\n"; 
}

tryAlloc(1); 
tryAlloc(10); 
tryAlloc(20); 
tryAlloc(30); 
tryAlloc(40); 
tryAlloc(50); 
tryAlloc(100);

php-56-centos7:

real	0m0.659s
user	0m0.031s
sys	0m0.324s

php-70-centos7:

real	0m0.136s
user	0m0.039s
sys	0m0.082s

php 5.4 (openshift 2):

real	0m0.244s 
user	0m0.056s 
sys	0m0.179s

PHP 7.0 (centos 7 own docker image):

real	0m0.057s
user	0m0.029s
sys	0m0.028s

The different versions make it a bit hard to do comparisons but it's obviously noticeable that the S2I images are effecting performance. I ran these tests on the exact same hardware configuration.

from s2i-php-container.

bparees avatar bparees commented on August 24, 2024

can you share the dockerfile for the php7-centos image you built?

I take it you're just running "docker run -it sometime /bin/sh" and then running your time php operation?

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

The php7-centos image uses Remi's RPMs rather than the SCL https://raw.githubusercontent.com/andrewklau/docker-centos-lamp/master/Dockerfile

The S2I images were tested with both docker run -it xyz /bin/bash and also from the resultant image with the cakephp example

from s2i-php-container.

hhorak avatar hhorak commented on August 24, 2024

@andrewklau Do you also see performance differences between different php56 images, like whether it can be caused by changes in the latest build?

from s2i-php-container.

hhorak avatar hhorak commented on August 24, 2024

@remicollet FYI

from s2i-php-container.

remicollet avatar remicollet commented on August 24, 2024

PHP 7.0 is much faster, and use less memory than PHP 5.6, this is expected. this is even one of the most important PHP 7 change.

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

@hhorak this has happened for quite some time (a few months)

@remicollet yeah, however 5.5 seems to perform better than 5.6

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

Here's another test, using the exact same deploymentconfig

<?php

$mark = microtime(true);

$a = 0; 
// CPU stress test 
for($i = 0; $i < 100000000; $i++) { 
$a += $i; 
}

echo "CPU Test: " . sprintf("%f", microtime(true)-$mark) . "\n";

centos-lamp (php 7.0 remi)

sh-4.2# time php test.php                                                                                                                                                                                                        
CPU Test: 5.598732                                                                                                                                                                                                               
                                                                                                                                                                                                                                 
real    0m5.653s                                                                                                                                                                                                                 
user    0m1.445s                                                                                                                                                                                                                 
sys     0m0.010s   

php-56-centos7

sh-4.2$ time php test.php                                                                                                                                                                                                        
CPU Test: 27.610644                                                                                                                                                                                                              
                                                                                                                                                                                                                                 
real    0m27.692s                                                                                                                                                                                                                
user    0m7.083s                                                                                                                                                                                                                 
sys     0m0.012s                                                                                                                                                                                                                 

from s2i-php-container.

remicollet avatar remicollet commented on August 24, 2024

Please compare enabled extensions (output of php -m)

E.g. some extensions, like XDebug could have performance impact.
Remi's packages also take benefit or recent changes in recent versions (dtrace is no more enabled by default in 7.0.14)

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

Ah!! Sorry the above results were centos-lamp and php-56-centos7

I believe php -m has found our culprit:

PHP55 does not have XDebug enabled
PHP56 does has XDebug enabled
PHP70 does not have XDebug enabled

I believe this would be related to #122

from s2i-php-container.

andrewklau avatar andrewklau commented on August 24, 2024

PHP 55/70

[Zend Modules]                                                                                                                                                                                                                   
Zend OPcache   

PHP 56

[Zend Modules]                                                                                                                                                                                                                   
Xdebug                                                                                                                                                                                                                           
Zend OPcache                                                                                                                                                                                                                     

Only php56 has xdebug being explicitly installed.

from s2i-php-container.

alexvaa avatar alexvaa commented on August 24, 2024

I have a similar problem with 55 and 56 performance cpu
Did deleting xdebug help?

from s2i-php-container.

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.