Comments (16)
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.
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.
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.
from s2i-php-container.
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.
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.
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.
@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.
@remicollet FYI
from s2i-php-container.
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.
@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.
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.
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.
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.
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.
I have a similar problem with 55 and 56 performance cpu
Did deleting xdebug help?
from s2i-php-container.
Related Issues (20)
- ENV and FPM HOT 2
- allow easily consuming kubernetes TLS secrets HOT 1
- tests suite failure: blocker composer plugin HOT 1
- PHP 8.1 build - It's the latest/greatest/fastest and we're anxious to start using it. HOT 11
- AH02282: No slotmem from mod_heartmonitor
- Testing issue created for samples operator HOT 1
- Feature request: Support custom certs for composer HOT 1
- Executing `test_scl_usage` when tty exists waits on 'cat' forever HOT 5
- No Action Required !! Testing automation workflow HOT 1
- No Action Required !! Testing automation workflow HOT 1
- How to get PHP 8.0.28 ? Multiple vulnerabilities in PHP 8.0.20 HOT 2
- Incomplete ssl test
- Run script error HOT 2
- 8.1 version of s2i-php-container web server user does not get the environment variables (env) secrets from Openshift HOT 2
- Environment variables are being ignored by the php engine HOT 4
- php-fpm issues (container runtime) HOT 4
- PHP version leakage HOT 5
- Default fpm settings easily lead to out of memory events or OOMkiller being active HOT 1
- Add support for PHP-8.2 to Fedora HOT 1
- PHP 8.3 timeline / PHP 8.3 is measuring+53% faster than 8.2 - 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 s2i-php-container.