From 88ce5eb071c1233a2e93ffded7445a747cd7a445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 16:25:44 +0200 Subject: [PATCH 01/43] Added initial docker stacks to be able to share benchmarking environments and easily benchmark against php 5.6, hhvm and php 7 --- README.md | 54 + docker/docker-compose.yml | 83 + docker/stack/nginx/conf.d/.gitkeep | 0 docker/stack/nginx/conf.d/00-basics.conf | 43 + docker/stack/nginx/conf.d/app.conf | 38 + docker/stack/nginx/nginx.conf | 46 + docker/stack/nginx/run.sh | 22 + docker/stack/php/conf.d/.gitkeep | 0 docker/stack/php/conf.d/00-basics.ini | 24 + docker/stack/php/conf.d/app.ini | 8 + docker/stack/php/hhvm/php.ini | 5 + docker/stack/php/hhvm/server.ini | 15 + docker/stack/php/permissions.sh | 10 + docker/stack/php/php-fpm/php-fpm.conf | 9 + docker/stack/php/php-fpm/pool.d/www.conf | 21 + docker/stack/php/php.ini | 1953 ++++++++++++++++++++++ docker/stack/php/run-hhvm.sh | 33 + docker/stack/php/run-php-fpm-7.sh | 27 + docker/stack/php/run-php-fpm.sh | 22 + docker/stack/php/shell/Dockerfile | 3 + 20 files changed, 2416 insertions(+) create mode 100644 docker/docker-compose.yml create mode 100644 docker/stack/nginx/conf.d/.gitkeep create mode 100644 docker/stack/nginx/conf.d/00-basics.conf create mode 100644 docker/stack/nginx/conf.d/app.conf create mode 100644 docker/stack/nginx/nginx.conf create mode 100755 docker/stack/nginx/run.sh create mode 100644 docker/stack/php/conf.d/.gitkeep create mode 100644 docker/stack/php/conf.d/00-basics.ini create mode 100644 docker/stack/php/conf.d/app.ini create mode 100644 docker/stack/php/hhvm/php.ini create mode 100644 docker/stack/php/hhvm/server.ini create mode 100755 docker/stack/php/permissions.sh create mode 100644 docker/stack/php/php-fpm/php-fpm.conf create mode 100644 docker/stack/php/php-fpm/pool.d/www.conf create mode 100644 docker/stack/php/php.ini create mode 100755 docker/stack/php/run-hhvm.sh create mode 100755 docker/stack/php/run-php-fpm-7.sh create mode 100755 docker/stack/php/run-php-fpm.sh create mode 100644 docker/stack/php/shell/Dockerfile diff --git a/README.md b/README.md index a8b905319..a895e1c4a 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,60 @@ If you want to see current configuration, run `sudo sysctl -a`. </VirtualHost> ~~~ +## Benchmarking using the supplied Docker Stack + +Use the supplied Docker Stack in order to automatically set up the following benchmarking environments: + +* Ubuntu 15.04 64bit (Docker) + * Nginx 1.7.12 + * PHP-FPM 5.6.4 + * Zend OPcache 7.0.4-dev + * PhalconPHP 2.0.9 + * PHP-FPM 7.0.0 + * Zend OPcache 7.0.6-dev + * PhalconPHP 2.0.9 + * HHVM 3.10.1 + +By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. + +### Getting Started + +If running locally, install [Docker Toolbox](https://www.docker.com/docker-toolbox). + +Clone the source code: +~~~ +git clone https://github.com/kenjis/php-framework-benchmark.git +cd php-framework-benchmark +~~~ + +Cd into the docker directory of this repo and make sure that docker toolbox is available: +~~~ +cd docker +eval "$(docker-machine env default)" +~~~ + +Start the Nginx/PHP server stacks: +~~~ +docker-compose up -d +~~~ + +Start the supplied docker shell from within this repository's `docker` folder: +~~~ +docker-compose run shell +~~~ + +Run the set-up script: +~~~ +sh setup.sh +~~~ + +Run benchmarks against each stack: +~~~ +stack=docker_nginx_php_5_6_4 sh benchmark.sh +stack=docker_nginx_hhvm_3_10_1 sh benchmark.sh +stack=docker_nginx_php_7_0_0 sh benchmark.sh +~~~ + ## References * [Aura](http://auraphp.com/) ([@auraphp](https://twitter.com/auraphp)) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 000000000..666a55fa4 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,83 @@ +# Shell to run benchmarks within +shell: + build: ./stack/php/shell + links: + - nginx_php_5_6_4 + - nginx_hhvm_3_10_1 + - nginx_php_7_0_0 + volumes: + - ..:/repo:rw + working_dir: '/repo' + command: "/bin/bash" + +# PHP 5.6.4 +php_5_6_4: + image: neam/php-benchmark:ubuntu-15.04-fpm-5.6.4-hhvm-3.10.1-phalcon-2.0.9 + volumes: + - ..:/public:rw + - ./stack/php/:/stack/php:rw + ports: + - "9000" + working_dir: '/repo' + command: "/stack/php/run-php-fpm.sh" + +# HHVM 3.10.1 +hhvm_3_10_1: + image: neam/php-benchmark:ubuntu-15.04-fpm-5.6.4-hhvm-3.10.1-phalcon-2.0.9 + volumes: + - ..:/public:rw + - ./stack/php/:/stack/php:rw + ports: + - "9000" + working_dir: '/repo' + command: "/stack/php/run-hhvm.sh" + +# PHP 7.0.0 +php_7_0_0: + image: neam/php-benchmark:ubuntu-15.04-fpm-7.0.0-hhvm-3.10.1-phalcon-2.0.9 + volumes: + - ..:/public:rw + - ./stack/php/:/stack/php:rw + ports: + - "9000" + working_dir: '/repo' + command: "/stack/php/run-php-fpm-7.sh" + +# Nginx configured to serve PHP 5.6.4 +nginx_php_5_6_4: + image: nginx:1.7 + links: + - php_5_6_4:php + volumes: + - ..:/public:rw + - ./stack/nginx/:/stack/nginx:rw + ports: + - "80" + working_dir: '/app' + command: "/stack/nginx/run.sh" + +# Nginx configured to serve HHVM 3.10.1 +nginx_hhvm_3_10_1: + image: nginx:1.7 + links: + - hhvm_3_10_1:php + volumes: + - ..:/public:rw + - ./stack/nginx/:/stack/nginx:rw + ports: + - "80" + working_dir: '/app' + command: "/stack/nginx/run.sh" + +# Nginx configured to serve PHP 7.0.0 +nginx_php_7_0_0: + image: nginx:1.7 + links: + - php_7_0_0:php + volumes: + - ..:/public:rw + - ./stack/nginx/:/stack/nginx:rw + ports: + - "80" + working_dir: '/app' + command: "/stack/nginx/run.sh" diff --git a/docker/stack/nginx/conf.d/.gitkeep b/docker/stack/nginx/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/stack/nginx/conf.d/00-basics.conf b/docker/stack/nginx/conf.d/00-basics.conf new file mode 100644 index 000000000..ecea572b4 --- /dev/null +++ b/docker/stack/nginx/conf.d/00-basics.conf @@ -0,0 +1,43 @@ + + # Hide nginx version information. + server_tokens off; + + tcp_nopush on; + tcp_nodelay off; + + client_max_body_size 100m; + client_body_timeout 600s; + + # define the $proxied_https variable based on the forwarded proto as Nginx is not the SSL endpoint + # The name $https cannot be used as the variable is already defined in Nginx core + map $http_x_forwarded_proto $proxied_https { + default off; + https on; + } + + # Enable Gzip compression. + gzip on; + gzip_http_version 1.0; + gzip_comp_level 5; + gzip_min_length 256; + gzip_proxied any; + gzip_vary on; + gzip_types + application/atom+xml + application/javascript + application/x-javascript + application/json + application/rss+xml + application/vnd.ms-fontobject + application/x-font-ttf + application/x-web-app-manifest+json + application/xhtml+xml + application/xml + font/opentype + image/svg+xml + image/x-icon + text/css + text/plain + text/x-component; + # text/html is always compressed by HttpGzipModule + diff --git a/docker/stack/nginx/conf.d/app.conf b/docker/stack/nginx/conf.d/app.conf new file mode 100644 index 000000000..99b9fb04e --- /dev/null +++ b/docker/stack/nginx/conf.d/app.conf @@ -0,0 +1,38 @@ + + index index.php; + + server { + server_name localhost; + listen 80; + + # Specify a charset + charset utf-8; + + # Document root + root /public; + + # Attempt the uri, uri+/, then fall back to index.php with args included + location / { + try_files $uri $uri/ /index.php?$args; + } + + # PHP + location ~ \.(hh|php) { + include fastcgi_params; + fastcgi_buffers 256 4k; + fastcgi_param HTTPS $proxied_https; + + # support urls like /$fw/index.php/foo/bar - http://stackoverflow.com/a/24243627/682317 + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + # for hhvm + fastcgi_keep_conn on; + fastcgi_param NGINX_SCRIPT_NAME $fastcgi_script_name; + fastcgi_param NGINX_DOCUMENT_ROOT $document_root; + + fastcgi_pass php; + } + + } \ No newline at end of file diff --git a/docker/stack/nginx/nginx.conf b/docker/stack/nginx/nginx.conf new file mode 100644 index 000000000..c2cc8c26b --- /dev/null +++ b/docker/stack/nginx/nginx.conf @@ -0,0 +1,46 @@ + +user nginx; +worker_processes 1; + +error_log /proc/self/fd/2 notice; +pid /var/run/nginx.pid; + + +# Tweaked according to max_clients = (worker_processes * worker_connections ) / (X * 2) +# X is however many concurrent connections these clients make to you +# 2 is because you open a connection to what you are proxying +# --> max_clients * X * 2 = worker_connections + +events { + worker_connections 30000; # Key to high performance - have a lot of connections available +} + +# --> worker_rlimit_nofile = worker_connections*2 + some margin + +worker_rlimit_nofile 65000; # Each connection needs a filehandle (or 2 if you are proxying) + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /proc/self/fd/2 main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + upstream php { + server php:9000 max_fails=3 fail_timeout=3s; + keepalive 16; + } + + include /etc/nginx/conf.d/*.conf; +} diff --git a/docker/stack/nginx/run.sh b/docker/stack/nginx/run.sh new file mode 100755 index 000000000..4d3f3623e --- /dev/null +++ b/docker/stack/nginx/run.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# This script is run within the nginx:1.7-based container on start + +# Fail on any error +set -o errexit + +# Copy nginx configuration from app directory to nginx container + +# Remove existing config files +if [ "$(ls /etc/nginx/conf.d/)" ]; then + rm /etc/nginx/conf.d/*.conf +fi + +# Copy custom project include files +if [ "$(ls /stack/nginx/conf.d/)" ]; then + cp -r /stack/nginx/conf.d/* /etc/nginx/conf.d/ +fi +cp /stack/nginx/nginx.conf /etc/nginx/nginx.conf + +# Run nginx +nginx -g 'daemon off;' diff --git a/docker/stack/php/conf.d/.gitkeep b/docker/stack/php/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/stack/php/conf.d/00-basics.ini b/docker/stack/php/conf.d/00-basics.ini new file mode 100644 index 000000000..1ef751243 --- /dev/null +++ b/docker/stack/php/conf.d/00-basics.ini @@ -0,0 +1,24 @@ +; Logging +display_errors=on +log_errors=on +error_reporting=E_ALL | E_STRICT + +; Required timezone +date.timezone = UTC + +; Security +expose_php=off +cgi.fix_pathinfo=0 + +memory_limit=128M + +; Opcache +opcache.memory_consumption=128 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=4000 +opcache.validate_timestamps=off +opcache.fast_shutdown=0 +opcache.enable_cli=1 + +; Omit warning NOTICE: PHP message: PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. +always_populate_raw_post_data=-1 diff --git a/docker/stack/php/conf.d/app.ini b/docker/stack/php/conf.d/app.ini new file mode 100644 index 000000000..0cffb0826 --- /dev/null +++ b/docker/stack/php/conf.d/app.ini @@ -0,0 +1,8 @@ + +max_execution_time=300 +error_reporting=E_ALL +html_errors=on +short_open_tag=on + +; Uncomment during development +opcache.validate_timestamps=on ; diff --git a/docker/stack/php/hhvm/php.ini b/docker/stack/php/hhvm/php.ini new file mode 100644 index 000000000..716835fc0 --- /dev/null +++ b/docker/stack/php/hhvm/php.ini @@ -0,0 +1,5 @@ +; hhvm specific +hhvm.log.level = Warning +hhvm.log.always_log_unhandled_exceptions = true +hhvm.log.runtime_error_reporting_level = 8191 +hhvm.mysql.typed_results = false \ No newline at end of file diff --git a/docker/stack/php/hhvm/server.ini b/docker/stack/php/hhvm/server.ini new file mode 100644 index 000000000..51a687084 --- /dev/null +++ b/docker/stack/php/hhvm/server.ini @@ -0,0 +1,15 @@ +; php options + +pid = /var/run/hhvm/pid + +; hhvm specific + +hhvm.server.port = 9000 +hhvm.server.type = fastcgi +hhvm.server.default_document = index.php +;hhvm.log.use_log_file = true +;hhvm.log.file = /var/log/hhvm/error.log +hhvm.log.header = true +hhvm.log.natives_stack_trace = true +hhvm.debug.server_error_message = true +hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc diff --git a/docker/stack/php/permissions.sh b/docker/stack/php/permissions.sh new file mode 100755 index 000000000..feddaa0d7 --- /dev/null +++ b/docker/stack/php/permissions.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Show what the script is doing +set -x + +# Work around permission errors locally by making sure that "www-data" uses the same uid and gid as the host volume +TARGET_UID=$(stat -c "%u" /public) +usermod -o -u $TARGET_UID www-data +TARGET_GID=$(stat -c "%g" /public) +groupmod -o -g $TARGET_GID www-data diff --git a/docker/stack/php/php-fpm/php-fpm.conf b/docker/stack/php/php-fpm/php-fpm.conf new file mode 100644 index 000000000..1944305bf --- /dev/null +++ b/docker/stack/php/php-fpm/php-fpm.conf @@ -0,0 +1,9 @@ +; This file was initially adapated from the output of: (on PHP 5.6) +; grep -vE '^;|^ *$' php-fpm.conf.default + +[global] + +error_log = /proc/self/fd/2 +daemonize = no + +include=${PHP_CONF_DIR}/fpm/pool.d/*.conf diff --git a/docker/stack/php/php-fpm/pool.d/www.conf b/docker/stack/php/php-fpm/pool.d/www.conf new file mode 100644 index 000000000..796e13e69 --- /dev/null +++ b/docker/stack/php/php-fpm/pool.d/www.conf @@ -0,0 +1,21 @@ +[www] + +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + +user = www-data +group = www-data + +listen = [::]:9000 + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 + +; send worker output to stdout/stderr +catch_workers_output = yes + +; make all environment variables available to php-fpm at runtime +clear_env = no diff --git a/docker/stack/php/php.ini b/docker/stack/php/php.ini new file mode 100644 index 000000000..cbe510c6b --- /dev/null +++ b/docker/stack/php/php.ini @@ -0,0 +1,1953 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.hash_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; url_rewriter.tags +; Default Value: "a=href,area=href,frame=src,form=,fieldset=" +; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; <? and ?> tags as PHP source which should be processed as such. It is +; generally recommended that <?php and ?> should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the <?= shorthand tag, which can be +; used regardless of this directive. +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/short-open-tag +short_open_tag = Off + +; Allow ASP-style <% %> tags. +; http://php.net/asp-tags +asp_tags = Off + +; The number of significant digits displayed in floating point numbers. +; http://php.net/precision +precision = 14 + +; Output buffering is a mechanism for controlling how much output data +; (excluding headers and cookies) PHP should keep internally before pushing that +; data to the client. If your application's output exceeds this setting, PHP +; will send that data in chunks of roughly the size you specify. +; Turning on this setting and managing its maximum buffer size can yield some +; interesting side-effects depending on your application and web server. +; You may be able to send headers and cookies after you've already sent output +; through print or echo. You also may see performance benefits if your server is +; emitting less packets due to buffered output versus PHP streaming the output +; as it gets it. On production servers, 4096 bytes is a good setting for performance +; reasons. +; Note: Output buffering can also be controlled via Output Buffering Control +; functions. +; Possible Values: +; On = Enabled and buffer is unlimited. (Use with caution) +; Off = Disabled +; Integer = Enables the buffer and sets its maximum size in bytes. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 +; http://php.net/output-buffering +output_buffering = 4096 + +; You can redirect all of the output of your scripts to a function. For +; example, if you set output_handler to "mb_output_handler", character +; encoding will be transparently converted to the specified encoding. +; Setting any output handler automatically turns on output buffering. +; Note: People who wrote portable scripts should not depend on this ini +; directive. Instead, explicitly set the output handler using ob_start(). +; Using this ini directive may cause problems unless you know what script +; is doing. +; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" +; and you cannot use both "ob_gzhandler" and "zlib.output_compression". +; Note: output_handler must be empty if this is set 'On' !!!! +; Instead you must use zlib.output_handler. +; http://php.net/output-handler +;output_handler = + +; Transparent output compression using the zlib library +; Valid values for this option are 'off', 'on', or a specific buffer size +; to be used for compression (default is 4KB) +; Note: Resulting chunk size may vary due to nature of compression. PHP +; outputs chunks that are few hundreds bytes each as a result of +; compression. If you prefer a larger chunk size for better +; performance, enable output_buffering in addition. +; Note: You need to use zlib.output_handler instead of the standard +; output_handler, or otherwise the output will be corrupted. +; http://php.net/zlib.output-compression +zlib.output_compression = Off + +; http://php.net/zlib.output-compression-level +;zlib.output_compression_level = -1 + +; You cannot specify additional output handlers if zlib.output_compression +; is activated here. This setting does the same as output_handler but in +; a different order. +; http://php.net/zlib.output-handler +;zlib.output_handler = + +; Implicit flush tells PHP to tell the output layer to flush itself +; automatically after every output block. This is equivalent to calling the +; PHP function flush() after each and every call to print() or echo() and each +; and every HTML block. Turning this option on has serious performance +; implications and is generally recommended for debugging purposes only. +; http://php.net/implicit-flush +; Note: This directive is hardcoded to On for the CLI SAPI +implicit_flush = Off + +; The unserialize callback function will be called (with the undefined class' +; name as parameter), if the unserializer finds an undefined class +; which should be instantiated. A warning appears if the specified function is +; not defined, or if the function doesn't include/implement the missing class. +; So only set this entry, if you really want to implement such a +; callback-function. +unserialize_callback_func = + +; When floats & doubles are serialized store serialize_precision significant +; digits after the floating point. The default value ensures that when floats +; are decoded with unserialize, the data will remain the same. +serialize_precision = 17 + +; open_basedir, if set, limits all file operations to the defined directory +; and below. This directive makes most sense if used in a per-directory +; or per-virtualhost web server configuration file. +; http://php.net/open-basedir +;open_basedir = + +; This directive allows you to disable certain functions for security reasons. +; It receives a comma-delimited list of function names. +; http://php.net/disable-functions +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, + +; This directive allows you to disable certain classes for security reasons. +; It receives a comma-delimited list of class names. +; http://php.net/disable-classes +disable_classes = + +; Colors for Syntax Highlighting mode. Anything that's acceptable in +; <span style="color: ???????"> would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 16k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = Off + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 128M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "<span style='color: #ff0000'>" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "</span>" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +;error_log = syslog + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 8M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a character encoding using +; the Content-type: header. To disable sending of the charset, simply +; set it to be empty. +; +; PHP's built-in default is text/html +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; mbstring or iconv output handler is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is +; to disable this feature and it will be removed in a future version. +; If post reading is disabled through enable_post_data_reading, +; $HTTP_RAW_POST_DATA is *NOT* populated. +; http://php.net/always-populate-raw-post-data +;always_populate_raw_post_data = -1 + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/usr/share/php" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 2M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=msql.dll +; +; ... or under UNIX: +; +; extension=msql.so +; +; ... or with a path: +; +; extension=/path/to/extension/msql.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +;date.timezone = + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING + +[sqlite] +; http://php.net/sqlite.assoc-case +;sqlite.assoc_case = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[SQL] +; http://php.net/sql.safe-mode +sql.safe_mode = Off + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQL] +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysql.allow_local_infile +mysql.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysql.allow-persistent +mysql.allow_persistent = On + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysql.cache_size +mysql.cache_size = 2000 + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysql.max-persistent +mysql.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/mysql.max-links +mysql.max_links = -1 + +; Default port number for mysql_connect(). If unset, mysql_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysql.default-port +mysql.default_port = + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysql.default-socket +mysql.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysql.default-host +mysql.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysql.default-user +mysql.default_user = + +; Default password for mysql_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysql.default-password +mysql.default_password = + +; Maximum time (in seconds) for connect timeout. -1 means no limit +; http://php.net/mysql.connect-timeout +mysql.connect_timeout = 60 + +; Trace mode. When trace_mode is active (=On), warnings for table/index scans and +; SQL-Errors will be displayed. +; http://php.net/mysql.trace-mode +mysql.trace_mode = Off + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[Sybase-CT] +; Allow or prevent persistent links. +; http://php.net/sybct.allow-persistent +sybct.allow_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/sybct.max-persistent +sybct.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/sybct.max-links +sybct.max_links = -1 + +; Minimum server message severity to display. +; http://php.net/sybct.min-server-severity +sybct.min_server_severity = 10 + +; Minimum client message severity to display. +; http://php.net/sybct.min-client-severity +sybct.min_client_severity = 10 + +; Set per-context timeout +; http://php.net/sybct.timeout +;sybct.timeout= + +;sybct.packet_size + +; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. +; Default: one minute +;sybct.login_timeout= + +; The name of the host you claim to be connecting from, for display by sp_who. +; Default: none +;sybct.hostname= + +; Allows you to define how often deadlocks are to be retried. -1 means "forever". +; Default: 0 +;sybct.deadlock_retry_count= + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/var/lib/php5/sessions" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 0 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; How many bytes to read from the file. +; http://php.net/session.entropy-length +;session.entropy_length = 32 + +; Specified here to create the session id. +; http://php.net/session.entropy-file +; Defaults to /dev/urandom +; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom +; If neither are found at compile time, the default is no entropy file. +; On windows, setting the entropy_length setting will activate the +; Windows random source (using the CryptoAPI) +;session.entropy_file = /dev/urandom + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Select a hash function for use in generating session ids. +; Possible Values +; 0 (MD5 128 bits) +; 1 (SHA-1 160 bits) +; This option may also be set to the name of any hash function supported by +; the hash extension. A list of available hashes is returned by the hash_algos() +; function. +; http://php.net/session.hash-function +session.hash_function = 0 + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.hash_bits_per_character = 5 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; form/fieldset are special; if you include them here, the rewriter will +; add a hidden <input> field with the info which is otherwise appended +; to URLs. If you want XHTML conformity, remove the form entry. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=,fieldset=" +; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; http://php.net/url-rewriter.tags +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +[MSSQL] +; Allow or prevent persistent links. +mssql.allow_persistent = On + +; Maximum number of persistent links. -1 means no limit. +mssql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +mssql.max_links = -1 + +; Minimum error severity to display. +mssql.min_error_severity = 10 + +; Minimum message severity to display. +mssql.min_message_severity = 10 + +; Compatibility mode with old versions of PHP 3.0. +mssql.compatibility_mode = Off + +; Connect timeout +;mssql.connect_timeout = 5 + +; Query timeout +;mssql.timeout = 60 + +; Valid range 0 - 2147483647. Default = 4096. +;mssql.textlimit = 4096 + +; Valid range 0 - 2147483647. Default = 4096. +;mssql.textsize = 4096 + +; Limits the number of records in each batch. 0 = all records in one batch. +;mssql.batchsize = 0 + +; Specify how datetime and datetim4 columns are returned +; On => Returns data converted to SQL server settings +; Off => Returns values as YYYY-MM-DD hh:mm:ss +;mssql.datetimeconvert = On + +; Use NT authentication when connecting to the server +mssql.secure_connection = Off + +; Specify max number of processes. -1 = library default +; msdlib defaults to 25 +; FreeTDS defaults to 4096 +;mssql.max_procs = -1 + +; Specify client character set. +; If empty or not set the client charset from freetds.conf is used +; This is only used when compiled with FreeTDS +;mssql.charset = "ISO-8859-1" + +[Assertion] +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Issue a PHP warning for each failed assertion. +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstrig.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 0 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[mcrypt] +; For more information about mcrypt settings see http://php.net/mcrypt-module-open + +; Directory where to load mcrypt algorithms +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.algorithms_dir= + +; Directory where to load mcrypt modes +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.modes_dir= + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=0 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=0 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=64 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=4 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 100000 are allowed. +;opcache.max_accelerated_files=2000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments" +; may be always stored (save_comments=1), but not loaded by applications +; that don't need them anyway. +;opcache.load_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: diff --git a/docker/stack/php/run-hhvm.sh b/docker/stack/php/run-hhvm.sh new file mode 100755 index 000000000..067566601 --- /dev/null +++ b/docker/stack/php/run-hhvm.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# This script is run within the php containers on start + +# Fail on any error +set -o errexit + +# Show what the script is doing +set -x + +# Fix permissions +$(dirname $0)/permissions.sh + +# HHVM cli +cp $PHP_CONF_DIR/fpm/php.ini /etc/hhvm/php.ini # Note: The HHVM cli is here configured to use default php.ini contents that came with php5-fpm +cat /stack/php/hhvm/php.ini >> /etc/hhvm/php.ini # Default hhvm-specific config used for HHVM cli and HHVM fastcgi server +for configfile in /stack/php/conf.d/*; do + cat $configfile >> /etc/hhvm/php.ini +done + +# HHVM fastcgi server +cp $PHP_CONF_DIR/fpm/php.ini /etc/hhvm/server.ini # Note: The HHVM fastcgi server is here configured to use default php.ini contents that came with php5-fpm +cat /stack/php/hhvm/php.ini >> /etc/hhvm/server.ini # Default hhvm-specific config used for HHVM cli and HHVM fastcgi server +cat /stack/php/hhvm/server.ini >> /etc/hhvm/server.ini # Default hhvm-specific config used for HHVM fastcgi server +for configfile in /stack/php/conf.d/*; do + cat $configfile >> /etc/hhvm/server.ini +done + +# Uncomment in order to use hhvm for cli +/usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60 + +# Run HHVM in server mode +hhvm -m server -c /etc/hhvm/server.ini -u www-data diff --git a/docker/stack/php/run-php-fpm-7.sh b/docker/stack/php/run-php-fpm-7.sh new file mode 100755 index 000000000..e452e28cf --- /dev/null +++ b/docker/stack/php/run-php-fpm-7.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# This script is run within the php containers on start + +# Fail on any error +set -o errexit + +# Show what the script is doing +set -x + +# Fix permissions +$(dirname $0)/permissions.sh + +# PHP-FPM +cp /stack/php/php.ini $PHP_CONF_DIR/fpm/php.ini +for configfile in /stack/php/conf.d/*; do + cp $configfile $PHP_CONF_DIR/fpm/conf.d/ +done +for configfile in /stack/php/php-fpm/pool.d/*; do + cp $configfile $PHP_CONF_DIR/fpm/pool.d/ +done +cp /stack/php/php-fpm/php-fpm.conf $PHP_CONF_DIR/fpm/php-fpm.conf + +# Setup config variables only available at runtime +sed -i "s|\${PHP_CONF_DIR}|${PHP_CONF_DIR}|" $PHP_CONF_DIR/fpm/php-fpm.conf + +php-fpm7.0 diff --git a/docker/stack/php/run-php-fpm.sh b/docker/stack/php/run-php-fpm.sh new file mode 100755 index 000000000..138c6e545 --- /dev/null +++ b/docker/stack/php/run-php-fpm.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# This script is run within the php containers on start + +# Fail on any error +set -o errexit + +# Show what the script is doing +set -x + +# Fix permissions +$(dirname $0)/permissions.sh + +# PHP-FPM +for configfile in /stack/php/conf.d/*; do + cp $configfile $PHP_CONF_DIR/fpm/conf.d/ +done +for configfile in /stack/php/php-fpm/pool.d/*; do + cp $configfile $PHP_CONF_DIR/fpm/pool.d/ +done +cp /stack/php/php-fpm/php-fpm.conf $PHP_CONF_DIR/fpm/php-fpm.conf +php5-fpm diff --git a/docker/stack/php/shell/Dockerfile b/docker/stack/php/shell/Dockerfile new file mode 100644 index 000000000..b63d9a1be --- /dev/null +++ b/docker/stack/php/shell/Dockerfile @@ -0,0 +1,3 @@ +FROM neam/php-benchmark:ubuntu-15.04-fpm-5.6.4-hhvm-3.10.1-phalcon-2.0.9 + +RUN apt-get update && apt-get install -y -q curl apache2-utils From f0699744b73e478a9a2f70cad2b7dce7163d9b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 16:30:11 +0200 Subject: [PATCH 02/43] Storing results separately for each stack --- benchmark.sh | 9 +++++++-- benchmarks/_functions.sh | 4 ++-- benchmarks/hello_world.sh | 38 +++++++++++++++++++++++++++++--------- bin/show_results_table.php | 2 +- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/benchmark.sh b/benchmark.sh index ccbf19dcd..90d55a291 100644 --- a/benchmark.sh +++ b/benchmark.sh @@ -1,6 +1,11 @@ #!/bin/sh -base="http://127.0.0.1/php-framework-benchmark" +# exit on failure +set -e + +if [ "$stack" = "" ]; then + stack="local" +fi cd `dirname $0` @@ -14,6 +19,6 @@ fi cd benchmarks -sh hello_world.sh "$base" +sh hello_world.sh "$stack" php ../bin/show_results_table.php diff --git a/benchmarks/_functions.sh b/benchmarks/_functions.sh index 821818aa0..40d9215b6 100644 --- a/benchmarks/_functions.sh +++ b/benchmarks/_functions.sh @@ -2,8 +2,8 @@ benchmark () { fw="$1" url="$2" - ab_log="output/$fw.ab.log" - output="output/$fw.output" + ab_log="$output_dir/$fw.ab.log" + output="$output_dir/$fw.output" echo "ab -c 10 -t 3 $url" ab -c 10 -t 3 "$url" > "$ab_log" diff --git a/benchmarks/hello_world.sh b/benchmarks/hello_world.sh index 2fa0c5b35..9b355bf35 100644 --- a/benchmarks/hello_world.sh +++ b/benchmarks/hello_world.sh @@ -1,22 +1,42 @@ #!/bin/sh +# exit on failure +set -e + cd `dirname $0` . ./_functions.sh -base="$1" +stack="$1" bm_name=`basename $0 .sh` -results_file="output/results.$bm_name.log" -check_file="output/check.$bm_name.log" -error_file="output/error.$bm_name.log" -url_file="output/urls.log" +if [ "$stack" = "local" ]; then + base="http://127.0.0.1/php-framework-benchmark" +fi +if [ "$stack" = "docker_nginx_php_5_6_4" ]; then + base="http://nginx_php_5_6_4" +fi +if [ "$stack" = "docker_nginx_hhvm_3_10_1" ]; then + base="http://nginx_hhvm_3_10_1" +fi +if [ "$stack" = "docker_nginx_php_7_0_0" ]; then + base="http://nginx_php_7_0_0" +fi + +output_dir="output/$stack" + +results_file="$output_dir/results.$bm_name.log" +check_file="$output_dir/check.$bm_name.log" +error_file="$output_dir/error.$bm_name.log" +url_file="$output_dir/urls.log" cd .. -mv "$results_file" "$results_file.old" -mv "$check_file" "$check_file.old" -mv "$error_file" "$error_file.old" -mv "$url_file" "$url_file.old" +mkdir -p "$output_dir" + +mv "$results_file" "$results_file.old" || true +mv "$check_file" "$check_file.old" || true +mv "$error_file" "$error_file.old" || true +mv "$url_file" "$url_file.old" || true for fw in `echo $targets` do diff --git a/bin/show_results_table.php b/bin/show_results_table.php index 276884fad..13ae630c1 100644 --- a/bin/show_results_table.php +++ b/bin/show_results_table.php @@ -3,7 +3,7 @@ require __DIR__ . '/../libs/parse_results.php'; require __DIR__ . '/../libs/build_table.php'; -$results = parse_results(__DIR__ . '/../output/results.hello_world.log'); +$results = parse_results(__DIR__ . '/../output/' . getenv('stack') . '/results.hello_world.log'); //var_dump($results); echo build_table($results); From 93028ee70d413387aff666817d50ff3cb5d63fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 17:13:27 +0200 Subject: [PATCH 03/43] Framework changes necessary for all listed frameworks to run and output data --- aura-2.0/web/index.php | 2 +- bear-0.10/bootstrap/contexts/prod.php | 2 +- bear-1.0/bootstrap/bootstrap.php | 2 +- bear-1.0/var/log/.gitignore | 2 ++ bear-1.0/var/www/index.php | 2 +- benchmarks/_functions.sh | 10 ++++++++-- cake-3.0/webroot/index.php | 2 +- cake-3.1/src/Controller/HelloController.php | 2 +- cake-3.1/webroot/index.php | 2 -- ci-3.0/index.php | 2 +- cygnite-1.3/index.php | 2 +- fatfree-3.5/index.php | 2 +- fuel-1.8-dev/public/index.php | 2 +- fuel-2.0-dev/public/index.php | 2 +- ice-1.0/public/index.php | 2 +- laravel-4.2/public/index.php | 2 +- laravel-5.0/public/index.php | 2 +- laravel-5.1/app/Http/Controllers/HelloController.php | 2 +- laravel-5.1/public/index.php | 2 -- libs/output_data.php | 2 +- lumen-5.0/public/index.php | 2 +- lumen-5.1/app/Http/Controllers/HelloController.php | 2 +- lumen-5.1/app/Http/routes.php | 4 ++++ lumen-5.1/public/index.php | 2 -- no-framework/index.php | 2 +- nofuss-1.2/cache/routes.all.php | 11 +++++++++-- nofuss-1.2/html/index.php | 2 +- nofuss-1.2/routes/web/_root.php | 9 +++++++++ nofuss-1.2/routes/web/php-framework-benchmark.php | 2 +- phalcon-1.3/public/index.php | 2 +- phalcon-2.0/public/index.php | 2 +- phpixie-3.2/assets/config/http.php | 2 +- phpixie-3.2/web/index.php | 2 +- radar-1.0-dev/web/index.php | 9 +++++++-- silex-1.2/web/index.php | 2 +- silex-1.3/src/App/Controller/Hello.php | 2 +- silex-1.3/web/index.php | 2 -- slim-2.6/index.php | 2 +- slim-3.0/index.php | 7 ++++--- symfony-2.5/web/app.php | 2 +- symfony-2.6/web/app.php | 2 +- .../src/AppBundle/Controller/HelloController.php | 2 +- symfony-2.7/web/app.php | 2 -- tipsy-0.10/web/index.php | 2 +- .../My/Hello/Controller/StandardController.php | 2 +- typo3f-3.0/Web/index.php | 2 ++ yii-2.0/web/index.php | 2 +- ze-1.0/config/autoload/routes.global.php | 8 +++++++- ze-1.0/public/index.php | 2 -- ze-1.0/src/Action/HelloAction.php | 2 +- zf-2.4/public/index.php | 2 +- zf-2.5/public/index.php | 10 +++++++++- 52 files changed, 97 insertions(+), 59 deletions(-) create mode 100644 bear-1.0/var/log/.gitignore create mode 100644 nofuss-1.2/routes/web/_root.php diff --git a/aura-2.0/web/index.php b/aura-2.0/web/index.php index 78a5551cf..85fd354d4 100644 --- a/aura-2.0/web/index.php +++ b/aura-2.0/web/index.php @@ -16,4 +16,4 @@ ); $kernel(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/bear-0.10/bootstrap/contexts/prod.php b/bear-0.10/bootstrap/contexts/prod.php index c8ed31fce..a7af38283 100644 --- a/bear-0.10/bootstrap/contexts/prod.php +++ b/bear-0.10/bootstrap/contexts/prod.php @@ -65,7 +65,7 @@ // OK: { $app->response->setResource($app->page)->render()->send(); - require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; + echo require dirname(__FILE__).'/../../libs/output_data.php'; exit(0); } diff --git a/bear-1.0/bootstrap/bootstrap.php b/bear-1.0/bootstrap/bootstrap.php index 1a43a7c62..54c73541a 100644 --- a/bear-1.0/bootstrap/bootstrap.php +++ b/bear-1.0/bootstrap/bootstrap.php @@ -31,7 +31,7 @@ // representation transfer $page()->transfer($app->responder, $_SERVER); - require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; + echo require dirname(__FILE__).'/../../libs/output_data.php'; exit(0); } catch (\Exception $e) { $app->error->handle($e, $request)->transfer(); diff --git a/bear-1.0/var/log/.gitignore b/bear-1.0/var/log/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/bear-1.0/var/log/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/bear-1.0/var/www/index.php b/bear-1.0/var/www/index.php index c764fdf9c..974a8ee4a 100644 --- a/bear-1.0/var/www/index.php +++ b/bear-1.0/var/www/index.php @@ -3,7 +3,7 @@ // Adhoc fix for benchmarking // Remove sub directories from URI $_SERVER['REQUEST_URI'] = preg_replace( - '!/php-framework-benchmark/bear-1.0/var/www/index.php!', + ['!/php-framework-benchmark/bear-1.0/var/www/index.php!', '!/bear-1.0/var/www/index.php!'], '', $_SERVER['REQUEST_URI'] ); diff --git a/benchmarks/_functions.sh b/benchmarks/_functions.sh index 40d9215b6..56a128c1c 100644 --- a/benchmarks/_functions.sh +++ b/benchmarks/_functions.sh @@ -19,17 +19,23 @@ benchmark () grep "Document Length:" "$ab_log" >> "$check_file" grep "Failed requests:" "$ab_log" >> "$check_file" grep 'Hello World!' "$output" >> "$check_file" + grep ':' "$output" >> "$check_file" echo "---" >> "$check_file" # check errors touch "$error_file" error='' - x=`grep 'Failed requests: 0' "$ab_log"` + x=`grep 'Failed requests: 0' "$ab_log" || true` if [ "$x" = "" ]; then tmp=`grep "Failed requests:" "$ab_log"` error="$error$tmp" fi - x=`grep 'Hello World!' "$output"` + x=`grep 'Hello World!' "$output" || true` + if [ "$x" = "" ]; then + tmp=`cat "$output"` + error="$error$tmp" + fi + x=`grep ':' "$output" || true` if [ "$x" = "" ]; then tmp=`cat "$output"` error="$error$tmp" diff --git a/cake-3.0/webroot/index.php b/cake-3.0/webroot/index.php index 19cef45a8..a74956dbe 100644 --- a/cake-3.0/webroot/index.php +++ b/cake-3.0/webroot/index.php @@ -36,4 +36,4 @@ new Response() ); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/cake-3.1/src/Controller/HelloController.php b/cake-3.1/src/Controller/HelloController.php index 1064f786a..57519d727 100644 --- a/cake-3.1/src/Controller/HelloController.php +++ b/cake-3.1/src/Controller/HelloController.php @@ -8,7 +8,7 @@ class HelloController extends AppController public function index() { - $this->response->body('Hello World!'); + $this->response->body('Hello World!' . require dirname(__FILE__).'/../../../libs/output_data.php'); return $this->response; } } diff --git a/cake-3.1/webroot/index.php b/cake-3.1/webroot/index.php index 19cef45a8..d1e7b66db 100644 --- a/cake-3.1/webroot/index.php +++ b/cake-3.1/webroot/index.php @@ -35,5 +35,3 @@ Request::createFromGlobals(), new Response() ); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ci-3.0/index.php b/ci-3.0/index.php index 86269334a..a9993ae7f 100755 --- a/ci-3.0/index.php +++ b/ci-3.0/index.php @@ -291,4 +291,4 @@ */ require_once BASEPATH.'core/CodeIgniter.php'; -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../libs/output_data.php'; diff --git a/cygnite-1.3/index.php b/cygnite-1.3/index.php index 764eb6581..07e0a7c63 100644 --- a/cygnite-1.3/index.php +++ b/cygnite-1.3/index.php @@ -59,4 +59,4 @@ */ require_once CF_BOOTSTRAP.DS.'start'.EXT; -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../libs/output_data.php'; diff --git a/fatfree-3.5/index.php b/fatfree-3.5/index.php index a0af1b1b2..88245d046 100644 --- a/fatfree-3.5/index.php +++ b/fatfree-3.5/index.php @@ -9,4 +9,4 @@ $f3->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../libs/output_data.php'; diff --git a/fuel-1.8-dev/public/index.php b/fuel-1.8-dev/public/index.php index c370280b5..928a0708d 100644 --- a/fuel-1.8-dev/public/index.php +++ b/fuel-1.8-dev/public/index.php @@ -101,4 +101,4 @@ class_alias('Fuel\\Core\\Autoloader', 'Autoloader'); $response->send(true); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/fuel-2.0-dev/public/index.php b/fuel-2.0-dev/public/index.php index dcf5e9e9c..04dd98d74 100644 --- a/fuel-2.0-dev/public/index.php +++ b/fuel-2.0-dev/public/index.php @@ -159,4 +159,4 @@ echo $response; } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/ice-1.0/public/index.php b/ice-1.0/public/index.php index 782bf0d11..c244eba85 100644 --- a/ice-1.0/public/index.php +++ b/ice-1.0/public/index.php @@ -13,4 +13,4 @@ echo $e->getMessage(); } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/laravel-4.2/public/index.php b/laravel-4.2/public/index.php index d74006337..28166a153 100644 --- a/laravel-4.2/public/index.php +++ b/laravel-4.2/public/index.php @@ -48,4 +48,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/laravel-5.0/public/index.php b/laravel-5.0/public/index.php index cb4732d5b..c65bcd728 100644 --- a/laravel-5.0/public/index.php +++ b/laravel-5.0/public/index.php @@ -56,4 +56,4 @@ $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/laravel-5.1/app/Http/Controllers/HelloController.php b/laravel-5.1/app/Http/Controllers/HelloController.php index dc8f0df49..c2ec62e54 100644 --- a/laravel-5.1/app/Http/Controllers/HelloController.php +++ b/laravel-5.1/app/Http/Controllers/HelloController.php @@ -6,6 +6,6 @@ class HelloController extends Controller { public function index() { - return 'Hello World!'; + return 'Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'; } } diff --git a/laravel-5.1/public/index.php b/laravel-5.1/public/index.php index b94d907c9..c5820533b 100644 --- a/laravel-5.1/public/index.php +++ b/laravel-5.1/public/index.php @@ -56,5 +56,3 @@ $response->send(); $kernel->terminate($request, $response); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/libs/output_data.php b/libs/output_data.php index 5c12ec2b1..3505f3c42 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -1,6 +1,6 @@ <?php -printf( +return sprintf( "\n%' 8d:%f:%d", memory_get_peak_usage(), microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], diff --git a/lumen-5.0/public/index.php b/lumen-5.0/public/index.php index 743febbfa..9b393db37 100644 --- a/lumen-5.0/public/index.php +++ b/lumen-5.0/public/index.php @@ -27,4 +27,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/lumen-5.1/app/Http/Controllers/HelloController.php b/lumen-5.1/app/Http/Controllers/HelloController.php index dc8f0df49..c2ec62e54 100644 --- a/lumen-5.1/app/Http/Controllers/HelloController.php +++ b/lumen-5.1/app/Http/Controllers/HelloController.php @@ -6,6 +6,6 @@ class HelloController extends Controller { public function index() { - return 'Hello World!'; + return 'Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'; } } diff --git a/lumen-5.1/app/Http/routes.php b/lumen-5.1/app/Http/routes.php index c9ec04e68..6212eff3f 100644 --- a/lumen-5.1/app/Http/routes.php +++ b/lumen-5.1/app/Http/routes.php @@ -20,4 +20,8 @@ '/php-framework-benchmark/lumen-5.1/public/index.php/hello/index', 'HelloController@index' ); + $group->get( + '/lumen-5.1/public/index.php/hello/index', + 'HelloController@index' + ); }); diff --git a/lumen-5.1/public/index.php b/lumen-5.1/public/index.php index 743febbfa..04aa08688 100644 --- a/lumen-5.1/public/index.php +++ b/lumen-5.1/public/index.php @@ -26,5 +26,3 @@ */ $app->run(); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/no-framework/index.php b/no-framework/index.php index 6965db1db..dc25142f9 100644 --- a/no-framework/index.php +++ b/no-framework/index.php @@ -2,4 +2,4 @@ echo 'Hello World!'; -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../libs/output_data.php'; diff --git a/nofuss-1.2/cache/routes.all.php b/nofuss-1.2/cache/routes.all.php index d300f6c79..f246ea9e8 100644 --- a/nofuss-1.2/cache/routes.all.php +++ b/nofuss-1.2/cache/routes.all.php @@ -4,13 +4,20 @@ array ( '*' => array ( - 'home' => + 'home-subdirectory' => array ( - 'name' => 'home', + 'name' => 'home-subdirectory', 'regexp' => 'php-framework-benchmark/nofuss-1.2/html/index.php/hello/index', 'controller' => 'home/index/index', 'inheritableRegexp' => 'nofuss-1.2/html/index.php/hello/index', ), + 'home' => + array ( + 'name' => 'home', + 'regexp' => 'nofuss-1.2/html/index.php/hello/index', + 'controller' => 'home/index/index', + 'inheritableRegexp' => 'nofuss-1.2/html/index.php/hello/index', + ), ), ), ); \ No newline at end of file diff --git a/nofuss-1.2/html/index.php b/nofuss-1.2/html/index.php index be3d06598..2a839ad03 100755 --- a/nofuss-1.2/html/index.php +++ b/nofuss-1.2/html/index.php @@ -38,5 +38,5 @@ // The if statement is needed for setup.sh if ($_SERVER['DOCUMENT_ROOT'] !== '') { - require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; + echo require dirname(__FILE__).'/../../libs/output_data.php'; } diff --git a/nofuss-1.2/routes/web/_root.php b/nofuss-1.2/routes/web/_root.php new file mode 100644 index 000000000..aeb7b591d --- /dev/null +++ b/nofuss-1.2/routes/web/_root.php @@ -0,0 +1,9 @@ +<?php + +return array( + array( + 'name' => 'home', + 'regexp' => 'nofuss-1.2/html/index.php/hello/index', + 'controller' => 'home/index/index' + ) +); diff --git a/nofuss-1.2/routes/web/php-framework-benchmark.php b/nofuss-1.2/routes/web/php-framework-benchmark.php index aeb7b591d..a4c6710dc 100755 --- a/nofuss-1.2/routes/web/php-framework-benchmark.php +++ b/nofuss-1.2/routes/web/php-framework-benchmark.php @@ -2,7 +2,7 @@ return array( array( - 'name' => 'home', + 'name' => 'home-subdirectory', 'regexp' => 'nofuss-1.2/html/index.php/hello/index', 'controller' => 'home/index/index' ) diff --git a/phalcon-1.3/public/index.php b/phalcon-1.3/public/index.php index 0692a1a0e..63da2d2a4 100644 --- a/phalcon-1.3/public/index.php +++ b/phalcon-1.3/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/phalcon-2.0/public/index.php b/phalcon-2.0/public/index.php index 0692a1a0e..63da2d2a4 100644 --- a/phalcon-2.0/public/index.php +++ b/phalcon-2.0/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/phpixie-3.2/assets/config/http.php b/phpixie-3.2/assets/config/http.php index 4dd8be910..a4ad49aa0 100644 --- a/phpixie-3.2/assets/config/http.php +++ b/phpixie-3.2/assets/config/http.php @@ -2,7 +2,7 @@ return array( 'translator' => array( - 'basePath' => '/php-framework-benchmark/phpixie-3.2/web/index.php/' + 'basePath' => (strpos($_SERVER['REQUEST_URI'], '/php-framework-benchmark') !== false ? '/php-framework-benchmark' : '') . '/phpixie-3.2/web/index.php/' ), 'resolver' => array( 'type' => 'pattern', diff --git a/phpixie-3.2/web/index.php b/phpixie-3.2/web/index.php index c26670e82..2349aebb1 100644 --- a/phpixie-3.2/web/index.php +++ b/phpixie-3.2/web/index.php @@ -6,4 +6,4 @@ $framework->registerDebugHandlers(); $framework->processHttpSapiRequest(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/radar-1.0-dev/web/index.php b/radar-1.0-dev/web/index.php index 89f73f169..989a41640 100644 --- a/radar-1.0-dev/web/index.php +++ b/radar-1.0-dev/web/index.php @@ -31,14 +31,19 @@ * Routes */ $adr->get( - 'Hello', + 'Hello.Subdirectory', '/php-framework-benchmark/radar-1.0-dev/web/index.php/hello/index', 'Domain\Hello\HelloApplicationService' ); +$adr->get( + 'Hello', + '/radar-1.0-dev/web/index.php/hello/index', + 'Domain\Hello\HelloApplicationService' +); /** * Run */ $adr->run(ServerRequestFactory::fromGlobals(), new Response()); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/silex-1.2/web/index.php b/silex-1.2/web/index.php index 325c88efb..064f2aa44 100644 --- a/silex-1.2/web/index.php +++ b/silex-1.2/web/index.php @@ -8,4 +8,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/silex-1.3/src/App/Controller/Hello.php b/silex-1.3/src/App/Controller/Hello.php index 28fdc8857..6bb844d6a 100644 --- a/silex-1.3/src/App/Controller/Hello.php +++ b/silex-1.3/src/App/Controller/Hello.php @@ -6,6 +6,6 @@ class Hello { public function index() { - return 'Hello World!'; + return 'Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'; } } diff --git a/silex-1.3/web/index.php b/silex-1.3/web/index.php index 325c88efb..d34dd8700 100644 --- a/silex-1.3/web/index.php +++ b/silex-1.3/web/index.php @@ -7,5 +7,3 @@ $app->get('/hello/index', 'App\\Controller\\Hello::index'); $app->run(); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/slim-2.6/index.php b/slim-2.6/index.php index 582160876..a4515cf60 100644 --- a/slim-2.6/index.php +++ b/slim-2.6/index.php @@ -10,4 +10,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../libs/output_data.php'; diff --git a/slim-3.0/index.php b/slim-3.0/index.php index d07cb7226..10feef908 100644 --- a/slim-3.0/index.php +++ b/slim-3.0/index.php @@ -5,9 +5,10 @@ $app = new \Slim\App(); $app->get('/hello/index', function ($request, $response, $args) { - return $response->write('Hello World!'); + $response = $response->write('Hello World! sdfsdf'); + $output_data = require dirname(__FILE__).'/../libs/output_data.php'; + $response .= $response->write($output_data); + return $response; }); $app->run(); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.5/web/app.php b/symfony-2.5/web/app.php index 95518cfdc..01304f299 100644 --- a/symfony-2.5/web/app.php +++ b/symfony-2.5/web/app.php @@ -28,4 +28,4 @@ $response->send(); $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/symfony-2.6/web/app.php b/symfony-2.6/web/app.php index 090c587ea..54a7c8d05 100644 --- a/symfony-2.6/web/app.php +++ b/symfony-2.6/web/app.php @@ -29,4 +29,4 @@ $response->send(); $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/symfony-2.7/src/AppBundle/Controller/HelloController.php b/symfony-2.7/src/AppBundle/Controller/HelloController.php index b8b7e924d..7b5e25565 100644 --- a/symfony-2.7/src/AppBundle/Controller/HelloController.php +++ b/symfony-2.7/src/AppBundle/Controller/HelloController.php @@ -13,6 +13,6 @@ class HelloController extends Controller */ public function indexAction() { - return new Response('Hello World!'); + return new Response('Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'); } } diff --git a/symfony-2.7/web/app.php b/symfony-2.7/web/app.php index 090c587ea..c5c264090 100644 --- a/symfony-2.7/web/app.php +++ b/symfony-2.7/web/app.php @@ -28,5 +28,3 @@ $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/tipsy-0.10/web/index.php b/tipsy-0.10/web/index.php index fe37afb37..4a9f229a8 100644 --- a/tipsy-0.10/web/index.php +++ b/tipsy-0.10/web/index.php @@ -15,4 +15,4 @@ $t->start(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php b/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php index c663b07c9..64d9686bb 100644 --- a/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php +++ b/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php @@ -12,6 +12,6 @@ class StandardController extends ActionController { public function indexAction() { - return 'Hello World!'; + return 'Hello World!' . "\n" . require BENCHMARK_ROOT_PATH . '/libs/output_data.php'; } } diff --git a/typo3f-3.0/Web/index.php b/typo3f-3.0/Web/index.php index 438507d7a..0a1035bb1 100644 --- a/typo3f-3.0/Web/index.php +++ b/typo3f-3.0/Web/index.php @@ -24,6 +24,8 @@ require($rootPath . 'Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Bootstrap.php'); +define('BENCHMARK_ROOT_PATH', dirname($rootPath) . '/../..'); $context = \TYPO3\Flow\Core\Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development'; $bootstrap = new \TYPO3\Flow\Core\Bootstrap($context); + $bootstrap->run(); diff --git a/yii-2.0/web/index.php b/yii-2.0/web/index.php index 6dba3d685..99eb8f1d3 100644 --- a/yii-2.0/web/index.php +++ b/yii-2.0/web/index.php @@ -11,4 +11,4 @@ (new yii\web\Application($config))->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/ze-1.0/config/autoload/routes.global.php b/ze-1.0/config/autoload/routes.global.php index 13d630ce5..e6a231e64 100644 --- a/ze-1.0/config/autoload/routes.global.php +++ b/ze-1.0/config/autoload/routes.global.php @@ -21,10 +21,16 @@ 'allowed_methods' => ['GET'], ], [ - 'name' => 'hello', + 'name' => 'hello.subdirectory', 'path' => '/php-framework-benchmark/ze-1.0/public/index.php/hello/index', 'middleware' => App\Action\HelloAction::class, 'allowed_methods' => ['GET'], ], + [ + 'name' => 'hello', + 'path' => '/ze-1.0/public/index.php/hello/index', + 'middleware' => App\Action\HelloAction::class, + 'allowed_methods' => ['GET'], + ], ], ]; diff --git a/ze-1.0/public/index.php b/ze-1.0/public/index.php index c5139d8d7..b4fedcab4 100644 --- a/ze-1.0/public/index.php +++ b/ze-1.0/public/index.php @@ -16,5 +16,3 @@ /** @var \Zend\Expressive\Application $app */ $app = $container->get('Zend\Expressive\Application'); $app->run(); - -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ze-1.0/src/Action/HelloAction.php b/ze-1.0/src/Action/HelloAction.php index f28d951ac..23d8a2fdb 100644 --- a/ze-1.0/src/Action/HelloAction.php +++ b/ze-1.0/src/Action/HelloAction.php @@ -12,7 +12,7 @@ public function __invoke( ResponseInterface $response, callable $next) { - $response->getBody()->write('Hello World!'); + $response->getBody()->write('Hello World!' . require dirname(__FILE__).'/../../../libs/output_data.php'); return $response->withHeader('Content-Type', 'text/html'); } } diff --git a/zf-2.4/public/index.php b/zf-2.4/public/index.php index e47cc9c49..67a67e6b5 100644 --- a/zf-2.4/public/index.php +++ b/zf-2.4/public/index.php @@ -16,4 +16,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; diff --git a/zf-2.5/public/index.php b/zf-2.5/public/index.php index e47cc9c49..3b52b8cef 100644 --- a/zf-2.5/public/index.php +++ b/zf-2.5/public/index.php @@ -5,6 +5,14 @@ */ chdir(dirname(__DIR__)); +// Adhoc fix for benchmarking +// Remove sub directories from URI +$_SERVER['REQUEST_URI'] = preg_replace( + ['!/php-framework-benchmark/zf-2.5/public/index.php!', '!/zf-2.5/public/index.php!'], + '', + $_SERVER['REQUEST_URI'] +); + // Decline static file requests back to the PHP built-in webserver if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { return false; @@ -16,4 +24,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +echo require dirname(__FILE__).'/../../libs/output_data.php'; From a9887153d75bc4076c36faa65d227c00b78ea527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 17:43:50 +0200 Subject: [PATCH 04/43] Ability to check results stack by stack --- .gitignore | 1 - README.md | 10 ++++++++ bin/docker-urls.sh | 12 ++++++++++ docker/docker-compose.yml | 6 +++++ index.php | 19 ++++++++++++--- output/docker_nginx_php_5_6_4/.gitignore | 3 +++ .../results.hello_world.log | 23 +++++++++++++++++++ output/results.hello_world.log | 23 ------------------- 8 files changed, 70 insertions(+), 27 deletions(-) create mode 100755 bin/docker-urls.sh create mode 100644 output/docker_nginx_php_5_6_4/.gitignore create mode 100644 output/docker_nginx_php_5_6_4/results.hello_world.log delete mode 100644 output/results.hello_world.log diff --git a/.gitignore b/.gitignore index 4f41b96f7..0126f9506 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /nbproject/ -/output/ vendor/ diff --git a/README.md b/README.md index a895e1c4a..093ca6632 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,16 @@ stack=docker_nginx_hhvm_3_10_1 sh benchmark.sh stack=docker_nginx_php_7_0_0 sh benchmark.sh ~~~ +### Check the results + +To see the results graph, run the following script from outside the docker shell, from the repository root: + +~~~ +bin/docker-urls.sh +~~~ + +It echoes URLs, which you should open up in your browser. + ## References * [Aura](http://auraphp.com/) ([@auraphp](https://twitter.com/auraphp)) diff --git a/bin/docker-urls.sh b/bin/docker-urls.sh new file mode 100755 index 000000000..527b7f4c7 --- /dev/null +++ b/bin/docker-urls.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +DIR=`dirname $0`; + +echo "PHP 5.6.4 Stack:"; +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://') +echo "HHVM 3.10.1 Stack:"; +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://') +echo "PHP 7.0.0 Stack:"; +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://') + +exit 0 \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 666a55fa4..dfa4c9bf7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -18,6 +18,8 @@ php_5_6_4: - ./stack/php/:/stack/php:rw ports: - "9000" + environment: + STACK: 'docker_nginx_php_5_6_4' working_dir: '/repo' command: "/stack/php/run-php-fpm.sh" @@ -29,6 +31,8 @@ hhvm_3_10_1: - ./stack/php/:/stack/php:rw ports: - "9000" + environment: + STACK: 'docker_nginx_hhvm_3_10_1' working_dir: '/repo' command: "/stack/php/run-hhvm.sh" @@ -40,6 +44,8 @@ php_7_0_0: - ./stack/php/:/stack/php:rw ports: - "9000" + environment: + STACK: 'docker_nginx_php_7_0_0' working_dir: '/repo' command: "/stack/php/run-php-fpm-7.sh" diff --git a/index.php b/index.php index 8982c6288..f5b399121 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,20 @@ <?php +$stack = getenv('STACK') ? getenv('STACK') : 'local'; +$host = null; +switch ($stack) { + case 'local': + $host = 'localhost'; + break; + default: + $host = str_replace('docker_', '', $stack); + break; +}; +$output_dir = __DIR__ . '/output/' . $stack; + Parse_Results: { require __DIR__ . '/libs/parse_results.php'; - $results = parse_results(__DIR__ . '/output/results.hello_world.log'); + $results = parse_results($output_dir . '/results.hello_world.log'); } Load_Theme: { @@ -50,6 +62,7 @@ <body> <h1>PHP Framework Benchmark</h1> <h2>Hello World Benchmark</h2> +<h3><?php echo $stack; ?></h3> <div> <?php echo $div_rpm, $div_mem, $div_time, $div_file; @@ -58,11 +71,11 @@ <ul> <?php -$url_file = __DIR__ . '/output/urls.log'; +$url_file = $output_dir . '/urls.log'; if (file_exists($url_file)) { $urls = file($url_file); foreach ($urls as $url) { - $url = str_replace('127.0.0.1', $_SERVER['HTTP_HOST'], $url); + $url = str_replace(['127.0.0.1', $host], $_SERVER['HTTP_HOST'], $url); echo '<li><a href="' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '">' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '</a></li>' . "\n"; diff --git a/output/docker_nginx_php_5_6_4/.gitignore b/output/docker_nginx_php_5_6_4/.gitignore new file mode 100644 index 000000000..720071f19 --- /dev/null +++ b/output/docker_nginx_php_5_6_4/.gitignore @@ -0,0 +1,3 @@ +* +!results.hello_world.log +!.gitignore diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log new file mode 100644 index 000000000..3d42a3b0b --- /dev/null +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -0,0 +1,23 @@ +phalcon-2.0: 774.64: 282936: 0.001357: 5 +ice-1.0: 680.57: 275560: 0.002463: 4 +tipsy-0.10: 762.23: 336568: 0.000640: 18 +fatfree-3.5: 365.25: 443728: 0.002854: 9 +slim-2.6: 761.72: 499712: 0.000745: 24 +ci-3.0: 97.54: 451096: 0.029233: 26 +nofuss-1.2: 343.89: 619496: 0.010555: 6 +slim-3.0: 502.51: 647744: 0.001052: 56 +bear-1.0: 202.53: 791424: 0.008215: 98 +lumen-5.1: 303.53: 750624: 0.005721: 32 +ze-1.0: 216.34: 822864: 0.011665: 64 +radar-1.0-dev: 253.12: 738608: 0.008413: 73 +yii-2.0: 304.98: 1399392: 0.004463: 49 +silex-1.3: 319.21: 733952: 0.003194: 58 +cygnite-1.3: 71.28: 779760: 0.026458: 70 +fuel-1.8-dev: 38.59: 729960: 0.116497: 55 +phpixie-3.2: 32.26: 1329368: 0.005880: 164 +aura-2.0: 110.17: 932784: 0.017762: 68 +cake-3.1: 92.69: 1383696: 0.016896: 84 +symfony-2.7: 15.94: 2735352: 0.014343: 103 +laravel-5.1: 79.35: 2637888: 0.054929: 38 +zf-2.5: 2.08: 3069536: 0.049335: 209 +typo3f-3.0: 0.32: 6553744: 2.795679: 272 diff --git a/output/results.hello_world.log b/output/results.hello_world.log deleted file mode 100644 index 64323603c..000000000 --- a/output/results.hello_world.log +++ /dev/null @@ -1,23 +0,0 @@ -phalcon-2.0: 1746.90: 278432: 0.001488: 5 -ice-1.0: 1454.79: 270376: 0.001139: 4 -tipsy-0.10: 1425.66: 332640: 0.001068: 18 -fatfree-3.5: 1106.20: 438488: 0.001483: 9 -slim-2.6: 880.24: 494360: 0.001359: 24 -ci-3.0: 810.99: 447096: 0.001257: 26 -nofuss-1.2: 672.16: 417704: 0.007358: 21 -slim-3.0: 534.16: 643752: 0.001601: 56 -bear-1.0: 442.63: 794624: 0.008693: 98 -lumen-5.1: 412.36: 999352: 0.002775: 37 -ze-1.0: 391.97: 838024: 0.002283: 67 -radar-1.0-dev: 369.79: 739008: 0.003101: 73 -yii-2.0: 379.77: 1435968: 0.002907: 49 -silex-1.3: 383.66: 900000: 0.010153: 64 -cygnite-1.3: 385.16: 793584: 0.003314: 70 -fuel-1.8-dev: 346.33: 680384: 0.002663: 44 -phpixie-3.2: 236.58: 1374400: 0.008409: 164 -aura-2.0: 233.80: 937344: 0.011615: 68 -cake-3.1: 207.27: 1439320: 0.004517: 84 -symfony-2.7: 101.99: 3363064: 0.014221: 106 -laravel-5.1: 91.59: 2889400: 0.024721: 39 -zf-2.5: 81.13: 3161792: 0.015882: 204 -typo3f-3.0: 26.98: 6814840: 0.105535: 277 From 8d10688737443f69d86288739d91841d3e1ceed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 17:44:10 +0200 Subject: [PATCH 05/43] Include error log on results page --- index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.php b/index.php index f5b399121..9498c23ec 100644 --- a/index.php +++ b/index.php @@ -86,6 +86,11 @@ <hr> +<h3>Error log</h3> +<pre><?php echo file_get_contents($output_dir . '/error.hello_world.log'); ?></pre> + +<hr> + <footer> <p style="text-align: right">This page is a part of <a href="https://github.com/kenjis/php-framework-benchmark">php-framework-benchmark</a>.</p> </footer> From 72fece19922708704e5b7e98cb520d6782058fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 17:45:03 +0200 Subject: [PATCH 06/43] Do not bail if error log happens to be empty after a run --- benchmarks/hello_world.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/hello_world.sh b/benchmarks/hello_world.sh index 9b355bf35..f0eb90b4a 100644 --- a/benchmarks/hello_world.sh +++ b/benchmarks/hello_world.sh @@ -47,4 +47,4 @@ do fi done -cat "$error_file" +cat "$error_file" || true From be9c180140b67d2e255c263751a0b2640ed3490f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 19:24:39 +0200 Subject: [PATCH 07/43] Results for the frameworks that actually run in the various stacks --- benchmark.sh | 1 + libs/output_data.php | 11 ++- list.sh | 87 ++++++++++++++++++- output/docker_nginx_hhvm_3_10_1/.gitignore | 3 + .../results.hello_world.log | 18 ++++ .../results.hello_world.log | 44 +++++----- output/docker_nginx_php_7_0_0/.gitignore | 3 + .../results.hello_world.log | 18 ++++ 8 files changed, 159 insertions(+), 26 deletions(-) create mode 100644 output/docker_nginx_hhvm_3_10_1/.gitignore create mode 100644 output/docker_nginx_hhvm_3_10_1/results.hello_world.log create mode 100644 output/docker_nginx_php_7_0_0/.gitignore create mode 100644 output/docker_nginx_php_7_0_0/results.hello_world.log diff --git a/benchmark.sh b/benchmark.sh index 90d55a291..cc9a003be 100644 --- a/benchmark.sh +++ b/benchmark.sh @@ -6,6 +6,7 @@ set -e if [ "$stack" = "" ]; then stack="local" fi +export stack; cd `dirname $0` diff --git a/libs/output_data.php b/libs/output_data.php index 3505f3c42..e08fee38c 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -1,8 +1,17 @@ <?php +$real_usage = null; +// On HHVM, using $real_usage = false ends up always returning 2097152 bytes - https://github.com/facebook/hhvm/issues/2257 +if (defined('HHVM_VERSION')) { + $real_usage = true; +} +// On PHP 7.0, using $real_usage = true ends up always returning 2097152 bytes +if (PHP_MAJOR_VERSION === 7) { + $real_usage = false; +} return sprintf( "\n%' 8d:%f:%d", - memory_get_peak_usage(), + memory_get_peak_usage($real_usage), // Using $real_usage due to microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], count(get_included_files()) - 1 ); diff --git a/list.sh b/list.sh index 3fa675ef7..9ab3b9fb1 100755 --- a/list.sh +++ b/list.sh @@ -1,5 +1,6 @@ #!/bin/sh +if [ "$stack" = "local" ] || [ "$stack" = "docker_nginx_php_5_6_4" ]; then list=" #no-framework #phalcon-1.3 @@ -32,9 +33,91 @@ cake-3.1 symfony-2.7 #laravel-4.2 #laravel-5.0 -laravel-5.1 +#segfaults-too-much#laravel-5.1 #zf-2.4 zf-2.5 #typo3f-2.3 -typo3f-3.0 +#disabled-since-it-attempts-to-connect-to-mysql#typo3f-3.0 " +fi +if [ "$stack" = "docker_nginx_hhvm_3_10_1" ]; then +list=" +#no-framework +#not-supported-by-hhvm##phalcon-1.3 +#not-supported-by-hhvm#phalcon-2.0 +#not-supported-by-hhvm#ice-1.0 +tipsy-0.10 +fatfree-3.5 +slim-2.6 +ci-3.0 +nofuss-1.2 +slim-3.0 +#apc_fetch()-error#bear-1.0 +lumen-5.1 +ze-1.0 +radar-1.0-dev +yii-2.0 +#lumen-5.0 +#silex-1.2 +silex-1.3 +cygnite-1.3 +fuel-1.8-dev +#fuel-2.0-dev +phpixie-3.2 +#cake-3.0 +aura-2.0 +cake-3.1 +#bear-0.10 +#symfony-2.5 +#symfony-2.6 +symfony-2.7 +#laravel-4.2 +#laravel-5.0 +#fails-with-no-such-file-or-directory#laravel-5.1 +#zf-2.4 +zf-2.5 +#typo3f-2.3 +#disabled-since-it-attempts-to-connect-to-mysql#typo3f-3.0 +" + +fi +if [ "$stack" = "docker_nginx_php_7_0_0" ]; then +list=" +#no-framework +#not-compiled-for-php7-is-it-even-supported##phalcon-1.3 +#not-compiled-for-php7-is-it-even-supported#phalcon-2.0 +#not-compiled-for-php7-is-it-even-supported#ice-1.0 +tipsy-0.10 +fatfree-3.5 +slim-2.6 +ci-3.0 +nofuss-1.2 +slim-3.0 +#apc_fetch()-error#bear-1.0 +lumen-5.1 +ze-1.0 +radar-1.0-dev +yii-2.0 +#lumen-5.0 +#silex-1.2 +silex-1.3 +cygnite-1.3 +fuel-1.8-dev +#fuel-2.0-dev +phpixie-3.2 +#cake-3.0 +aura-2.0 +cake-3.1 +#bear-0.10 +#symfony-2.5 +#symfony-2.6 +symfony-2.7 +#laravel-4.2 +#laravel-5.0 +#segfaults-too-much#laravel-5.1 +#zf-2.4 +zf-2.5 +#typo3f-2.3 +#disabled-since-it-attempts-to-connect-to-mysql#typo3f-3.0 +" +fi diff --git a/output/docker_nginx_hhvm_3_10_1/.gitignore b/output/docker_nginx_hhvm_3_10_1/.gitignore new file mode 100644 index 000000000..720071f19 --- /dev/null +++ b/output/docker_nginx_hhvm_3_10_1/.gitignore @@ -0,0 +1,3 @@ +* +!results.hello_world.log +!.gitignore diff --git a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log new file mode 100644 index 000000000..ce897d688 --- /dev/null +++ b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log @@ -0,0 +1,18 @@ +tipsy-0.10: 151.22: 40864: 0.013672: 18 +fatfree-3.5: 191.62: 73960: 0.005139: 9 +slim-2.6: 134.64: 45728: 0.018968: 24 +ci-3.0: 42.75: 47936: 0.029706: 26 +nofuss-1.2: 159.58: 47216: 0.008147: 6 +slim-3.0: 57.89: 76576: 0.025089: 56 +lumen-5.1: 89.58: 221896: 0.012224: 32 +ze-1.0: 48.92: 149536: 0.024459: 64 +radar-1.0-dev: 42.40: 87256: 0.031434: 73 +yii-2.0: 63.54: 511976: 0.020642: 49 +silex-1.3: 58.46: 103120: 0.026938: 58 +cygnite-1.3: 29.07: 175672: 0.048073: 70 +fuel-1.8-dev: 30.30: 123128: 0.043546: 54 +phpixie-3.2: 16.85: 286152: 0.083052: 164 +aura-2.0: 48.15: 166232: 0.025206: 68 +cake-3.1: 34.88: 171256: 0.049870: 84 +symfony-2.7: 22.98: 667248: 0.062403: 103 +zf-2.5: 14.64: 602112: 0.097132: 208 diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index 3d42a3b0b..d424eda26 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,23 +1,21 @@ -phalcon-2.0: 774.64: 282936: 0.001357: 5 -ice-1.0: 680.57: 275560: 0.002463: 4 -tipsy-0.10: 762.23: 336568: 0.000640: 18 -fatfree-3.5: 365.25: 443728: 0.002854: 9 -slim-2.6: 761.72: 499712: 0.000745: 24 -ci-3.0: 97.54: 451096: 0.029233: 26 -nofuss-1.2: 343.89: 619496: 0.010555: 6 -slim-3.0: 502.51: 647744: 0.001052: 56 -bear-1.0: 202.53: 791424: 0.008215: 98 -lumen-5.1: 303.53: 750624: 0.005721: 32 -ze-1.0: 216.34: 822864: 0.011665: 64 -radar-1.0-dev: 253.12: 738608: 0.008413: 73 -yii-2.0: 304.98: 1399392: 0.004463: 49 -silex-1.3: 319.21: 733952: 0.003194: 58 -cygnite-1.3: 71.28: 779760: 0.026458: 70 -fuel-1.8-dev: 38.59: 729960: 0.116497: 55 -phpixie-3.2: 32.26: 1329368: 0.005880: 164 -aura-2.0: 110.17: 932784: 0.017762: 68 -cake-3.1: 92.69: 1383696: 0.016896: 84 -symfony-2.7: 15.94: 2735352: 0.014343: 103 -laravel-5.1: 79.35: 2637888: 0.054929: 38 -zf-2.5: 2.08: 3069536: 0.049335: 209 -typo3f-3.0: 0.32: 6553744: 2.795679: 272 +phalcon-2.0: 835.00: 283120: 0.002651: 5 +ice-1.0: 749.81: 275680: 0.001453: 4 +tipsy-0.10: 988.07: 336808: 0.000606: 18 +fatfree-3.5: 520.58: 444136: 0.002025: 9 +slim-2.6: 795.92: 499872: 0.000879: 24 +ci-3.0: 101.58: 451376: 0.037094: 26 +nofuss-1.2: 344.94: 619640: 0.002954: 6 +slim-3.0: 498.56: 648136: 0.002141: 56 +bear-1.0: 215.44: 791688: 0.410931: 98 +lumen-5.1: 318.22: 750968: 0.006660: 32 +ze-1.0: 241.72: 823056: 0.009136: 64 +radar-1.0-dev: 259.75: 738792: 0.006119: 73 +yii-2.0: 313.75: 1399576: 0.006194: 49 +silex-1.3: 357.62: 734208: 0.001185: 58 +cygnite-1.3: 121.78: 779944: 0.018045: 70 +fuel-1.8-dev: 56.56: 730200: 0.065322: 55 +phpixie-3.2: 83.94: 1329712: 0.011355: 164 +aura-2.0: 127.48: 933160: 0.030256: 68 +cake-3.1: 152.83: 1383960: 0.010397: 84 +symfony-2.7: 70.54: 2735504: 0.017342: 103 +zf-2.5: 43.50: 3070136: 0.029376: 209 diff --git a/output/docker_nginx_php_7_0_0/.gitignore b/output/docker_nginx_php_7_0_0/.gitignore new file mode 100644 index 000000000..720071f19 --- /dev/null +++ b/output/docker_nginx_php_7_0_0/.gitignore @@ -0,0 +1,3 @@ +* +!results.hello_world.log +!.gitignore diff --git a/output/docker_nginx_php_7_0_0/results.hello_world.log b/output/docker_nginx_php_7_0_0/results.hello_world.log new file mode 100644 index 000000000..9060a750f --- /dev/null +++ b/output/docker_nginx_php_7_0_0/results.hello_world.log @@ -0,0 +1,18 @@ +tipsy-0.10: 1149.66: 386832: 0.000585: 18 +fatfree-3.5: 620.23: 455712: 0.001992: 9 +slim-2.6: 1148.00: 506936: 0.000839: 24 +ci-3.0: 114.68: 398920: 0.037701: 26 +nofuss-1.2: 447.11: 695808: 0.002700: 6 +slim-3.0: 863.84: 606016: 0.000602: 56 +lumen-5.1: 442.27: 689360: 0.005848: 27 +ze-1.0: 366.28: 686376: 0.005012: 64 +radar-1.0-dev: 382.59: 651376: 0.002490: 73 +yii-2.0: 466.63: 1044888: 0.002134: 49 +silex-1.3: 540.76: 665320: 0.000726: 58 +cygnite-1.3: 148.47: 668760: 0.016897: 70 +fuel-1.8-dev: 63.19: 651200: 0.067138: 54 +phpixie-3.2: 101.25: 1022112: 0.010456: 159 +aura-2.0: 179.28: 770104: 0.007434: 68 +cake-3.1: 199.17: 867160: 0.015056: 83 +symfony-2.7: 81.19: 2063144: 0.007208: 103 +zf-2.5: 59.44: 1766080: 0.018493: 209 From df036ffd88e1267c335919c0334580b1aeecf372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 19:27:43 +0200 Subject: [PATCH 08/43] Re-enabled "no-framework" so that relative results can be compared across the stacks --- list.sh | 6 +++--- output/docker_nginx_hhvm_3_10_1/results.hello_world.log | 1 + output/docker_nginx_php_5_6_4/results.hello_world.log | 1 + output/docker_nginx_php_7_0_0/results.hello_world.log | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/list.sh b/list.sh index 9ab3b9fb1..125c68bde 100755 --- a/list.sh +++ b/list.sh @@ -2,7 +2,7 @@ if [ "$stack" = "local" ] || [ "$stack" = "docker_nginx_php_5_6_4" ]; then list=" -#no-framework +no-framework #phalcon-1.3 phalcon-2.0 ice-1.0 @@ -42,7 +42,7 @@ zf-2.5 fi if [ "$stack" = "docker_nginx_hhvm_3_10_1" ]; then list=" -#no-framework +no-framework #not-supported-by-hhvm##phalcon-1.3 #not-supported-by-hhvm#phalcon-2.0 #not-supported-by-hhvm#ice-1.0 @@ -83,7 +83,7 @@ zf-2.5 fi if [ "$stack" = "docker_nginx_php_7_0_0" ]; then list=" -#no-framework +no-framework #not-compiled-for-php7-is-it-even-supported##phalcon-1.3 #not-compiled-for-php7-is-it-even-supported#phalcon-2.0 #not-compiled-for-php7-is-it-even-supported#ice-1.0 diff --git a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log index ce897d688..247f931cc 100644 --- a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log +++ b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log @@ -1,3 +1,4 @@ +no-framework: 941.20: 31136: 0.000816: 1 tipsy-0.10: 151.22: 40864: 0.013672: 18 fatfree-3.5: 191.62: 73960: 0.005139: 9 slim-2.6: 134.64: 45728: 0.018968: 24 diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index d424eda26..54aade299 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,3 +1,4 @@ +no-framework: 1606.08: 234608: 0.000233: 1 phalcon-2.0: 835.00: 283120: 0.002651: 5 ice-1.0: 749.81: 275680: 0.001453: 4 tipsy-0.10: 988.07: 336808: 0.000606: 18 diff --git a/output/docker_nginx_php_7_0_0/results.hello_world.log b/output/docker_nginx_php_7_0_0/results.hello_world.log index 9060a750f..a60fa5be4 100644 --- a/output/docker_nginx_php_7_0_0/results.hello_world.log +++ b/output/docker_nginx_php_7_0_0/results.hello_world.log @@ -1,3 +1,4 @@ +no-framework: 2002.75: 357288: 0.000312: 1 tipsy-0.10: 1149.66: 386832: 0.000585: 18 fatfree-3.5: 620.23: 455712: 0.001992: 9 slim-2.6: 1148.00: 506936: 0.000839: 24 From 79c2e76f1f7a804a81506bc068bc6c4219c2652f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 19:52:39 +0200 Subject: [PATCH 09/43] Synced $output_dir usage --- bin/show_comparison_table.php | 7 +++++-- bin/show_results_table.php | 5 ++++- docker/docker-compose.yml | 6 +++--- index.php | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/show_comparison_table.php b/bin/show_comparison_table.php index 5a84aca6c..ce69a4e97 100644 --- a/bin/show_comparison_table.php +++ b/bin/show_comparison_table.php @@ -4,6 +4,9 @@ require __DIR__ . '/../libs/build_table.php'; require __DIR__ . '/../libs/recalc_relative.php'; +$stack = getenv('stack') ? getenv('stack') : 'local'; +$output_dir = __DIR__ . '/../output/' . $stack; + $list = [ 'cake-3.0', 'symfony-2.6', @@ -11,9 +14,9 @@ ]; system('git checkout master'); -$results_master = parse_results(__DIR__ . '/../output/results.hello_world.log'); +$results_master = parse_results($output_dir . '/results.hello_world.log'); system('git checkout optimize'); -$results_optimize = parse_results(__DIR__ . '/../output/results.hello_world.log'); +$results_optimize = parse_results($output_dir . '/results.hello_world.log'); //var_dump($results_master, $results_optimize); $is_fisrt = true; diff --git a/bin/show_results_table.php b/bin/show_results_table.php index 13ae630c1..9bf4c9f4d 100644 --- a/bin/show_results_table.php +++ b/bin/show_results_table.php @@ -3,7 +3,10 @@ require __DIR__ . '/../libs/parse_results.php'; require __DIR__ . '/../libs/build_table.php'; -$results = parse_results(__DIR__ . '/../output/' . getenv('stack') . '/results.hello_world.log'); +$stack = getenv('stack') ? getenv('stack') : 'local'; +$output_dir = __DIR__ . '/../output/' . $stack; + +$results = parse_results($output_dir . '/results.hello_world.log'); //var_dump($results); echo build_table($results); diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index dfa4c9bf7..be41cd92a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -19,7 +19,7 @@ php_5_6_4: ports: - "9000" environment: - STACK: 'docker_nginx_php_5_6_4' + stack: 'docker_nginx_php_5_6_4' working_dir: '/repo' command: "/stack/php/run-php-fpm.sh" @@ -32,7 +32,7 @@ hhvm_3_10_1: ports: - "9000" environment: - STACK: 'docker_nginx_hhvm_3_10_1' + stack: 'docker_nginx_hhvm_3_10_1' working_dir: '/repo' command: "/stack/php/run-hhvm.sh" @@ -45,7 +45,7 @@ php_7_0_0: ports: - "9000" environment: - STACK: 'docker_nginx_php_7_0_0' + stack: 'docker_nginx_php_7_0_0' working_dir: '/repo' command: "/stack/php/run-php-fpm-7.sh" diff --git a/index.php b/index.php index 9498c23ec..ea67a4a93 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ <?php -$stack = getenv('STACK') ? getenv('STACK') : 'local'; +$stack = getenv('stack') ? getenv('stack') : 'local'; +$output_dir = __DIR__ . '/output/' . $stack; $host = null; switch ($stack) { case 'local': @@ -10,7 +11,6 @@ $host = str_replace('docker_', '', $stack); break; }; -$output_dir = __DIR__ . '/output/' . $stack; Parse_Results: { require __DIR__ . '/libs/parse_results.php'; From 10178e567732321bb81e99e7d333ba91635d901e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Wed, 9 Dec 2015 19:53:32 +0200 Subject: [PATCH 10/43] Graphs across stacks are now comparable --- index.php | 13 +++++--- libs/make_graph.php | 8 ++--- libs/parse_results.php | 71 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 76 insertions(+), 16 deletions(-) diff --git a/index.php b/index.php index ea67a4a93..1e38e1fe9 100644 --- a/index.php +++ b/index.php @@ -35,17 +35,22 @@ } } +$max_rps = 2300; +$max_memory = 3; +$max_time = 500; +$max_file = 300; + // RPS Benchmark -list($chart_rpm, $div_rpm) = make_graph('rps', 'Throughput', 'requests per second'); +list($chart_rpm, $div_rpm) = make_graph('rps', 'Throughput', 'requests per second', $max_rps); // Memory Benchmark -list($chart_mem, $div_mem) = make_graph('memory', 'Memory', 'peak memory (MB)'); +list($chart_mem, $div_mem) = make_graph('memory', 'Memory', 'peak memory (MB)', $max_memory); // Exec Time Benchmark -list($chart_time, $div_time) = make_graph('time', 'Exec Time', 'ms'); +list($chart_time, $div_time) = make_graph('time', 'Exec Time', 'ms', $max_time); // Included Files -list($chart_file, $div_file) = make_graph('file', 'Included Files', 'count'); +list($chart_file, $div_file) = make_graph('file', 'Included Files', 'count', $max_file); ?> <!DOCTYPE html> <html lang="en"> diff --git a/libs/make_graph.php b/libs/make_graph.php index e7bf1e460..a14351396 100644 --- a/libs/make_graph.php +++ b/libs/make_graph.php @@ -2,7 +2,7 @@ require __DIR__ . '/php-recipe-2nd/make_chart_parts.php'; -function make_graph($id, $title, $hAxis_title) +function make_graph($id, $title, $hAxis_title, $vAxis_maxValue = 0.01) { global $results; @@ -14,8 +14,8 @@ function make_graph($id, $title, $hAxis_title) 'DarkKhaki', 'DarkMagenta', 'DarkOliveGreen', 'DarkOrange', 'DarkOrchid', 'DarkRed', 'DarkSalmon', 'DarkSeaGreen', 'DarkSlateBlue', 'DarkSlateGray', ); - $graphWidth = 1100; - $graphHeight = 400; + $graphWidth = 1300; + $graphHeight = 500; $data = array(); $data[] = array('', $id, array('role' => 'style')); // header @@ -31,7 +31,7 @@ function make_graph($id, $title, $hAxis_title) 'titleTextStyle' => array('fontSize' => 16), 'hAxis' => array('title' => $hAxis_title, 'titleTextStyle' => array('bold' => true)), - 'vAxis' => array('minValue' => 0, 'maxValue' => 0.01), + 'vAxis' => array('minValue' => 0, 'maxValue' => $vAxis_maxValue), 'width' => $graphWidth, 'height' => $graphHeight, 'bar' => array('groupWidth' => '90%'), diff --git a/libs/parse_results.php b/libs/parse_results.php index ec8acb02f..7f57ac7be 100644 --- a/libs/parse_results.php +++ b/libs/parse_results.php @@ -30,14 +30,69 @@ function parse_results($file) 'file' => $file, ]; } - - foreach ($results as $fw => $data) { - $results[$fw]['rps_relative'] = $data['rps'] / $min_rps; - $results[$fw]['memory_relative'] = $data['memory'] / $min_memory; - $results[$fw]['time_relative'] = $data['time'] / $min_time; - $results[$fw]['file_relative'] = $data['file'] / $min_file; + + $frameworks = [ + "no-framework", + //"phalcon-1.3", + "phalcon-2.0", + "ice-1.0", + "tipsy-0.10", + "fatfree-3.5", + "slim-2.6", + "ci-3.0", + "nofuss-1.2", + "slim-3.0", + "bear-1.0", + "lumen-5.1", + "ze-1.0", + "radar-1.0-dev", + "yii-2.0", + //"lumen-5.0", + //"silex-1.2", + "silex-1.3", + "cygnite-1.3", + //"fuel-1.8-dev", + "fuel-2.0-dev", + "phpixie-3.2", + //"cake-3.0", + "aura-2.0", + "cake-3.1", + "bear-0.10", + //"symfony-2.5", + //"symfony-2.6", + "symfony-2.7", + //"laravel-4.2", + //"laravel-5.0", + "laravel-5.1", + //"zf-2.4", + "zf-2.5", + //"typo3f-2.3", + "typo3f-3.0", + ]; + + $ordered_results = []; + foreach ($frameworks as $fw) { + if (isset($results[$fw])) { + $data = $results[$fw]; + $ordered_results[$fw] = $data; + $results[$fw]['rps_relative'] = $data['rps'] / $min_rps; + $results[$fw]['memory_relative'] = $data['memory'] / $min_memory; + $results[$fw]['time_relative'] = $data['time'] / $min_time; + $results[$fw]['file_relative'] = $data['file'] / $min_file; + } else { + $ordered_results[$fw] = [ + 'rps' => 0, + 'memory' => 0, + 'time' => 0, + 'file' => 0, + 'rps_relative' => 0, + 'memory_relative' => 0, + 'time_relative' => 0, + 'file_relative' => 0, + ]; + } } -// var_dump($results); +// var_dump($ordered_results); - return $results; + return $ordered_results; } From 0b937725af0d76967ceb50fcdfc5b6ca20fdd446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 10:23:49 +0200 Subject: [PATCH 11/43] Removed comment proven to be wrong + non-altering code --- libs/output_data.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libs/output_data.php b/libs/output_data.php index e08fee38c..5e71b61a4 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -5,10 +5,6 @@ if (defined('HHVM_VERSION')) { $real_usage = true; } -// On PHP 7.0, using $real_usage = true ends up always returning 2097152 bytes -if (PHP_MAJOR_VERSION === 7) { - $real_usage = false; -} return sprintf( "\n%' 8d:%f:%d", memory_get_peak_usage($real_usage), // Using $real_usage due to From 8316f277f0023f16937cb674ce0e2f0b6d26d242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 10:28:23 +0200 Subject: [PATCH 12/43] Reversed output_data require-refactoring --- aura-2.0/web/index.php | 2 +- bear-0.10/bootstrap/contexts/prod.php | 2 +- bear-1.0/bootstrap/bootstrap.php | 2 +- cake-3.0/webroot/index.php | 2 +- cake-3.1/src/Controller/HelloController.php | 2 +- cake-3.1/webroot/index.php | 2 ++ ci-3.0/index.php | 2 +- cygnite-1.3/index.php | 2 +- fatfree-3.5/index.php | 2 +- fuel-1.8-dev/public/index.php | 2 +- fuel-2.0-dev/public/index.php | 2 +- ice-1.0/public/index.php | 2 +- laravel-4.2/public/index.php | 2 +- laravel-5.0/public/index.php | 2 +- laravel-5.1/app/Http/Controllers/HelloController.php | 2 +- laravel-5.1/public/index.php | 2 ++ lumen-5.0/public/index.php | 2 +- lumen-5.1/app/Http/Controllers/HelloController.php | 2 +- lumen-5.1/public/index.php | 2 ++ no-framework/index.php | 2 +- nofuss-1.2/html/index.php | 2 +- phalcon-1.3/public/index.php | 2 +- phalcon-2.0/public/index.php | 2 +- phpixie-3.2/web/index.php | 2 +- radar-1.0-dev/web/index.php | 2 +- silex-1.2/web/index.php | 2 +- silex-1.3/src/App/Controller/Hello.php | 2 +- silex-1.3/web/index.php | 2 ++ slim-2.6/index.php | 2 +- slim-3.0/index.php | 7 +++---- symfony-2.5/web/app.php | 2 +- symfony-2.6/web/app.php | 2 +- symfony-2.7/src/AppBundle/Controller/HelloController.php | 2 +- symfony-2.7/web/app.php | 2 ++ tipsy-0.10/web/index.php | 2 +- .../Classes/My/Hello/Controller/StandardController.php | 2 +- typo3f-3.0/Web/index.php | 2 -- yii-2.0/web/index.php | 2 +- ze-1.0/public/index.php | 2 ++ ze-1.0/src/Action/HelloAction.php | 2 +- zf-2.4/public/index.php | 2 +- zf-2.5/public/index.php | 2 +- 42 files changed, 49 insertions(+), 40 deletions(-) diff --git a/aura-2.0/web/index.php b/aura-2.0/web/index.php index 85fd354d4..78a5551cf 100644 --- a/aura-2.0/web/index.php +++ b/aura-2.0/web/index.php @@ -16,4 +16,4 @@ ); $kernel(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/bear-0.10/bootstrap/contexts/prod.php b/bear-0.10/bootstrap/contexts/prod.php index a7af38283..c8ed31fce 100644 --- a/bear-0.10/bootstrap/contexts/prod.php +++ b/bear-0.10/bootstrap/contexts/prod.php @@ -65,7 +65,7 @@ // OK: { $app->response->setResource($app->page)->render()->send(); - echo require dirname(__FILE__).'/../../libs/output_data.php'; + require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; exit(0); } diff --git a/bear-1.0/bootstrap/bootstrap.php b/bear-1.0/bootstrap/bootstrap.php index 54c73541a..1a43a7c62 100644 --- a/bear-1.0/bootstrap/bootstrap.php +++ b/bear-1.0/bootstrap/bootstrap.php @@ -31,7 +31,7 @@ // representation transfer $page()->transfer($app->responder, $_SERVER); - echo require dirname(__FILE__).'/../../libs/output_data.php'; + require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; exit(0); } catch (\Exception $e) { $app->error->handle($e, $request)->transfer(); diff --git a/cake-3.0/webroot/index.php b/cake-3.0/webroot/index.php index a74956dbe..19cef45a8 100644 --- a/cake-3.0/webroot/index.php +++ b/cake-3.0/webroot/index.php @@ -36,4 +36,4 @@ new Response() ); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/cake-3.1/src/Controller/HelloController.php b/cake-3.1/src/Controller/HelloController.php index 57519d727..1064f786a 100644 --- a/cake-3.1/src/Controller/HelloController.php +++ b/cake-3.1/src/Controller/HelloController.php @@ -8,7 +8,7 @@ class HelloController extends AppController public function index() { - $this->response->body('Hello World!' . require dirname(__FILE__).'/../../../libs/output_data.php'); + $this->response->body('Hello World!'); return $this->response; } } diff --git a/cake-3.1/webroot/index.php b/cake-3.1/webroot/index.php index d1e7b66db..19cef45a8 100644 --- a/cake-3.1/webroot/index.php +++ b/cake-3.1/webroot/index.php @@ -35,3 +35,5 @@ Request::createFromGlobals(), new Response() ); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ci-3.0/index.php b/ci-3.0/index.php index a9993ae7f..86269334a 100755 --- a/ci-3.0/index.php +++ b/ci-3.0/index.php @@ -291,4 +291,4 @@ */ require_once BASEPATH.'core/CodeIgniter.php'; -echo require dirname(__FILE__).'/../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/cygnite-1.3/index.php b/cygnite-1.3/index.php index 07e0a7c63..764eb6581 100644 --- a/cygnite-1.3/index.php +++ b/cygnite-1.3/index.php @@ -59,4 +59,4 @@ */ require_once CF_BOOTSTRAP.DS.'start'.EXT; -echo require dirname(__FILE__).'/../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/fatfree-3.5/index.php b/fatfree-3.5/index.php index 88245d046..a0af1b1b2 100644 --- a/fatfree-3.5/index.php +++ b/fatfree-3.5/index.php @@ -9,4 +9,4 @@ $f3->run(); -echo require dirname(__FILE__).'/../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/fuel-1.8-dev/public/index.php b/fuel-1.8-dev/public/index.php index 928a0708d..c370280b5 100644 --- a/fuel-1.8-dev/public/index.php +++ b/fuel-1.8-dev/public/index.php @@ -101,4 +101,4 @@ class_alias('Fuel\\Core\\Autoloader', 'Autoloader'); $response->send(true); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/fuel-2.0-dev/public/index.php b/fuel-2.0-dev/public/index.php index 04dd98d74..dcf5e9e9c 100644 --- a/fuel-2.0-dev/public/index.php +++ b/fuel-2.0-dev/public/index.php @@ -159,4 +159,4 @@ echo $response; } -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ice-1.0/public/index.php b/ice-1.0/public/index.php index c244eba85..782bf0d11 100644 --- a/ice-1.0/public/index.php +++ b/ice-1.0/public/index.php @@ -13,4 +13,4 @@ echo $e->getMessage(); } -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/laravel-4.2/public/index.php b/laravel-4.2/public/index.php index 28166a153..d74006337 100644 --- a/laravel-4.2/public/index.php +++ b/laravel-4.2/public/index.php @@ -48,4 +48,4 @@ $app->run(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/laravel-5.0/public/index.php b/laravel-5.0/public/index.php index c65bcd728..cb4732d5b 100644 --- a/laravel-5.0/public/index.php +++ b/laravel-5.0/public/index.php @@ -56,4 +56,4 @@ $kernel->terminate($request, $response); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/laravel-5.1/app/Http/Controllers/HelloController.php b/laravel-5.1/app/Http/Controllers/HelloController.php index c2ec62e54..dc8f0df49 100644 --- a/laravel-5.1/app/Http/Controllers/HelloController.php +++ b/laravel-5.1/app/Http/Controllers/HelloController.php @@ -6,6 +6,6 @@ class HelloController extends Controller { public function index() { - return 'Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'; + return 'Hello World!'; } } diff --git a/laravel-5.1/public/index.php b/laravel-5.1/public/index.php index c5820533b..b94d907c9 100644 --- a/laravel-5.1/public/index.php +++ b/laravel-5.1/public/index.php @@ -56,3 +56,5 @@ $response->send(); $kernel->terminate($request, $response); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/lumen-5.0/public/index.php b/lumen-5.0/public/index.php index 9b393db37..743febbfa 100644 --- a/lumen-5.0/public/index.php +++ b/lumen-5.0/public/index.php @@ -27,4 +27,4 @@ $app->run(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/lumen-5.1/app/Http/Controllers/HelloController.php b/lumen-5.1/app/Http/Controllers/HelloController.php index c2ec62e54..dc8f0df49 100644 --- a/lumen-5.1/app/Http/Controllers/HelloController.php +++ b/lumen-5.1/app/Http/Controllers/HelloController.php @@ -6,6 +6,6 @@ class HelloController extends Controller { public function index() { - return 'Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'; + return 'Hello World!'; } } diff --git a/lumen-5.1/public/index.php b/lumen-5.1/public/index.php index 04aa08688..743febbfa 100644 --- a/lumen-5.1/public/index.php +++ b/lumen-5.1/public/index.php @@ -26,3 +26,5 @@ */ $app->run(); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/no-framework/index.php b/no-framework/index.php index dc25142f9..6965db1db 100644 --- a/no-framework/index.php +++ b/no-framework/index.php @@ -2,4 +2,4 @@ echo 'Hello World!'; -echo require dirname(__FILE__).'/../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/nofuss-1.2/html/index.php b/nofuss-1.2/html/index.php index 2a839ad03..be3d06598 100755 --- a/nofuss-1.2/html/index.php +++ b/nofuss-1.2/html/index.php @@ -38,5 +38,5 @@ // The if statement is needed for setup.sh if ($_SERVER['DOCUMENT_ROOT'] !== '') { - echo require dirname(__FILE__).'/../../libs/output_data.php'; + require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; } diff --git a/phalcon-1.3/public/index.php b/phalcon-1.3/public/index.php index 63da2d2a4..0692a1a0e 100644 --- a/phalcon-1.3/public/index.php +++ b/phalcon-1.3/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/phalcon-2.0/public/index.php b/phalcon-2.0/public/index.php index 63da2d2a4..0692a1a0e 100644 --- a/phalcon-2.0/public/index.php +++ b/phalcon-2.0/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/phpixie-3.2/web/index.php b/phpixie-3.2/web/index.php index 2349aebb1..c26670e82 100644 --- a/phpixie-3.2/web/index.php +++ b/phpixie-3.2/web/index.php @@ -6,4 +6,4 @@ $framework->registerDebugHandlers(); $framework->processHttpSapiRequest(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/radar-1.0-dev/web/index.php b/radar-1.0-dev/web/index.php index 989a41640..d779c0768 100644 --- a/radar-1.0-dev/web/index.php +++ b/radar-1.0-dev/web/index.php @@ -46,4 +46,4 @@ */ $adr->run(ServerRequestFactory::fromGlobals(), new Response()); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/silex-1.2/web/index.php b/silex-1.2/web/index.php index 064f2aa44..325c88efb 100644 --- a/silex-1.2/web/index.php +++ b/silex-1.2/web/index.php @@ -8,4 +8,4 @@ $app->run(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/silex-1.3/src/App/Controller/Hello.php b/silex-1.3/src/App/Controller/Hello.php index 6bb844d6a..28fdc8857 100644 --- a/silex-1.3/src/App/Controller/Hello.php +++ b/silex-1.3/src/App/Controller/Hello.php @@ -6,6 +6,6 @@ class Hello { public function index() { - return 'Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'; + return 'Hello World!'; } } diff --git a/silex-1.3/web/index.php b/silex-1.3/web/index.php index d34dd8700..325c88efb 100644 --- a/silex-1.3/web/index.php +++ b/silex-1.3/web/index.php @@ -7,3 +7,5 @@ $app->get('/hello/index', 'App\\Controller\\Hello::index'); $app->run(); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/slim-2.6/index.php b/slim-2.6/index.php index a4515cf60..582160876 100644 --- a/slim-2.6/index.php +++ b/slim-2.6/index.php @@ -10,4 +10,4 @@ $app->run(); -echo require dirname(__FILE__).'/../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/slim-3.0/index.php b/slim-3.0/index.php index 10feef908..d07cb7226 100644 --- a/slim-3.0/index.php +++ b/slim-3.0/index.php @@ -5,10 +5,9 @@ $app = new \Slim\App(); $app->get('/hello/index', function ($request, $response, $args) { - $response = $response->write('Hello World! sdfsdf'); - $output_data = require dirname(__FILE__).'/../libs/output_data.php'; - $response .= $response->write($output_data); - return $response; + return $response->write('Hello World!'); }); $app->run(); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.5/web/app.php b/symfony-2.5/web/app.php index 01304f299..95518cfdc 100644 --- a/symfony-2.5/web/app.php +++ b/symfony-2.5/web/app.php @@ -28,4 +28,4 @@ $response->send(); $kernel->terminate($request, $response); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.6/web/app.php b/symfony-2.6/web/app.php index 54a7c8d05..090c587ea 100644 --- a/symfony-2.6/web/app.php +++ b/symfony-2.6/web/app.php @@ -29,4 +29,4 @@ $response->send(); $kernel->terminate($request, $response); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.7/src/AppBundle/Controller/HelloController.php b/symfony-2.7/src/AppBundle/Controller/HelloController.php index 7b5e25565..b8b7e924d 100644 --- a/symfony-2.7/src/AppBundle/Controller/HelloController.php +++ b/symfony-2.7/src/AppBundle/Controller/HelloController.php @@ -13,6 +13,6 @@ class HelloController extends Controller */ public function indexAction() { - return new Response('Hello World!' . require dirname(__FILE__).'/../../../../libs/output_data.php'); + return new Response('Hello World!'); } } diff --git a/symfony-2.7/web/app.php b/symfony-2.7/web/app.php index c5c264090..090c587ea 100644 --- a/symfony-2.7/web/app.php +++ b/symfony-2.7/web/app.php @@ -28,3 +28,5 @@ $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/tipsy-0.10/web/index.php b/tipsy-0.10/web/index.php index 4a9f229a8..fe37afb37 100644 --- a/tipsy-0.10/web/index.php +++ b/tipsy-0.10/web/index.php @@ -15,4 +15,4 @@ $t->start(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php b/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php index 64d9686bb..c663b07c9 100644 --- a/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php +++ b/typo3f-3.0/Packages/Application/My.Hello/Classes/My/Hello/Controller/StandardController.php @@ -12,6 +12,6 @@ class StandardController extends ActionController { public function indexAction() { - return 'Hello World!' . "\n" . require BENCHMARK_ROOT_PATH . '/libs/output_data.php'; + return 'Hello World!'; } } diff --git a/typo3f-3.0/Web/index.php b/typo3f-3.0/Web/index.php index 0a1035bb1..438507d7a 100644 --- a/typo3f-3.0/Web/index.php +++ b/typo3f-3.0/Web/index.php @@ -24,8 +24,6 @@ require($rootPath . 'Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Bootstrap.php'); -define('BENCHMARK_ROOT_PATH', dirname($rootPath) . '/../..'); $context = \TYPO3\Flow\Core\Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development'; $bootstrap = new \TYPO3\Flow\Core\Bootstrap($context); - $bootstrap->run(); diff --git a/yii-2.0/web/index.php b/yii-2.0/web/index.php index 99eb8f1d3..6dba3d685 100644 --- a/yii-2.0/web/index.php +++ b/yii-2.0/web/index.php @@ -11,4 +11,4 @@ (new yii\web\Application($config))->run(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ze-1.0/public/index.php b/ze-1.0/public/index.php index b4fedcab4..c5139d8d7 100644 --- a/ze-1.0/public/index.php +++ b/ze-1.0/public/index.php @@ -16,3 +16,5 @@ /** @var \Zend\Expressive\Application $app */ $app = $container->get('Zend\Expressive\Application'); $app->run(); + +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ze-1.0/src/Action/HelloAction.php b/ze-1.0/src/Action/HelloAction.php index 23d8a2fdb..f28d951ac 100644 --- a/ze-1.0/src/Action/HelloAction.php +++ b/ze-1.0/src/Action/HelloAction.php @@ -12,7 +12,7 @@ public function __invoke( ResponseInterface $response, callable $next) { - $response->getBody()->write('Hello World!' . require dirname(__FILE__).'/../../../libs/output_data.php'); + $response->getBody()->write('Hello World!'); return $response->withHeader('Content-Type', 'text/html'); } } diff --git a/zf-2.4/public/index.php b/zf-2.4/public/index.php index 67a67e6b5..e47cc9c49 100644 --- a/zf-2.4/public/index.php +++ b/zf-2.4/public/index.php @@ -16,4 +16,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/zf-2.5/public/index.php b/zf-2.5/public/index.php index 3b52b8cef..44738080a 100644 --- a/zf-2.5/public/index.php +++ b/zf-2.5/public/index.php @@ -24,4 +24,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -echo require dirname(__FILE__).'/../../libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; From 51c2493b0b455331ba436490a625e27c52550a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:29:02 +0200 Subject: [PATCH 13/43] Requiring libs/output_data based on env var --- README.md | 1 + aura-2.0/web/index.php | 2 +- bear-0.10/bootstrap/contexts/prod.php | 2 +- bear-1.0/bootstrap/bootstrap.php | 2 +- cake-3.0/webroot/index.php | 2 +- cake-3.1/webroot/index.php | 2 +- ci-3.0/index.php | 2 +- cygnite-1.3/index.php | 2 +- docker/docker-compose.yml | 3 +++ fatfree-3.5/index.php | 2 +- fuel-1.8-dev/public/index.php | 2 +- fuel-2.0-dev/public/index.php | 2 +- ice-1.0/public/index.php | 2 +- laravel-4.2/public/index.php | 2 +- laravel-5.0/public/index.php | 2 +- laravel-5.1/public/index.php | 2 +- lumen-5.0/public/index.php | 2 +- lumen-5.1/public/index.php | 2 +- no-framework/index.php | 2 +- nofuss-1.2/html/index.php | 4 ++-- .../results.hello_world.log | 24 ++----------------- phalcon-1.3/public/index.php | 2 +- phalcon-2.0/public/index.php | 2 +- phpixie-3.2/web/index.php | 2 +- radar-1.0-dev/web/index.php | 2 +- silex-1.2/web/index.php | 2 +- silex-1.3/web/index.php | 2 +- slim-2.6/index.php | 2 +- slim-3.0/index.php | 2 +- symfony-2.5/web/app.php | 2 +- symfony-2.6/web/app.php | 2 +- symfony-2.7/web/app.php | 2 +- tipsy-0.10/web/index.php | 2 +- yii-2.0/web/index.php | 2 +- ze-1.0/public/index.php | 2 +- zf-2.4/public/index.php | 2 +- zf-2.5/public/index.php | 2 +- 37 files changed, 41 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 093ca6632..3f8a4d135 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ If you want to see current configuration, run `sudo sysctl -a`. ~~~ <VirtualHost *:80> DocumentRoot /home/vagrant/public + SetEnv php_framework_benchmark_path /home/vagrant/public/php-framework-benchmark </VirtualHost> ~~~ diff --git a/aura-2.0/web/index.php b/aura-2.0/web/index.php index 78a5551cf..f6bbdce5a 100644 --- a/aura-2.0/web/index.php +++ b/aura-2.0/web/index.php @@ -16,4 +16,4 @@ ); $kernel(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/bear-0.10/bootstrap/contexts/prod.php b/bear-0.10/bootstrap/contexts/prod.php index c8ed31fce..f0abcd572 100644 --- a/bear-0.10/bootstrap/contexts/prod.php +++ b/bear-0.10/bootstrap/contexts/prod.php @@ -65,7 +65,7 @@ // OK: { $app->response->setResource($app->page)->render()->send(); - require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; + require getenv('php_framework_benchmark_path').'/libs/output_data.php'; exit(0); } diff --git a/bear-1.0/bootstrap/bootstrap.php b/bear-1.0/bootstrap/bootstrap.php index 1a43a7c62..678352a5b 100644 --- a/bear-1.0/bootstrap/bootstrap.php +++ b/bear-1.0/bootstrap/bootstrap.php @@ -31,7 +31,7 @@ // representation transfer $page()->transfer($app->responder, $_SERVER); - require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; + require getenv('php_framework_benchmark_path').'/libs/output_data.php'; exit(0); } catch (\Exception $e) { $app->error->handle($e, $request)->transfer(); diff --git a/cake-3.0/webroot/index.php b/cake-3.0/webroot/index.php index 19cef45a8..d64c65f60 100644 --- a/cake-3.0/webroot/index.php +++ b/cake-3.0/webroot/index.php @@ -36,4 +36,4 @@ new Response() ); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/cake-3.1/webroot/index.php b/cake-3.1/webroot/index.php index 19cef45a8..d64c65f60 100644 --- a/cake-3.1/webroot/index.php +++ b/cake-3.1/webroot/index.php @@ -36,4 +36,4 @@ new Response() ); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/ci-3.0/index.php b/ci-3.0/index.php index 86269334a..02b266370 100755 --- a/ci-3.0/index.php +++ b/ci-3.0/index.php @@ -291,4 +291,4 @@ */ require_once BASEPATH.'core/CodeIgniter.php'; -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/cygnite-1.3/index.php b/cygnite-1.3/index.php index 764eb6581..c7227615e 100644 --- a/cygnite-1.3/index.php +++ b/cygnite-1.3/index.php @@ -59,4 +59,4 @@ */ require_once CF_BOOTSTRAP.DS.'start'.EXT; -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index be41cd92a..ea5996bde 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -20,6 +20,7 @@ php_5_6_4: - "9000" environment: stack: 'docker_nginx_php_5_6_4' + php_framework_benchmark_path: /public working_dir: '/repo' command: "/stack/php/run-php-fpm.sh" @@ -33,6 +34,7 @@ hhvm_3_10_1: - "9000" environment: stack: 'docker_nginx_hhvm_3_10_1' + php_framework_benchmark_path: /public working_dir: '/repo' command: "/stack/php/run-hhvm.sh" @@ -46,6 +48,7 @@ php_7_0_0: - "9000" environment: stack: 'docker_nginx_php_7_0_0' + php_framework_benchmark_path: /public working_dir: '/repo' command: "/stack/php/run-php-fpm-7.sh" diff --git a/fatfree-3.5/index.php b/fatfree-3.5/index.php index a0af1b1b2..63adbd8b7 100644 --- a/fatfree-3.5/index.php +++ b/fatfree-3.5/index.php @@ -9,4 +9,4 @@ $f3->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/fuel-1.8-dev/public/index.php b/fuel-1.8-dev/public/index.php index c370280b5..6cb040bcb 100644 --- a/fuel-1.8-dev/public/index.php +++ b/fuel-1.8-dev/public/index.php @@ -101,4 +101,4 @@ class_alias('Fuel\\Core\\Autoloader', 'Autoloader'); $response->send(true); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/fuel-2.0-dev/public/index.php b/fuel-2.0-dev/public/index.php index dcf5e9e9c..64a68f02f 100644 --- a/fuel-2.0-dev/public/index.php +++ b/fuel-2.0-dev/public/index.php @@ -159,4 +159,4 @@ echo $response; } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/ice-1.0/public/index.php b/ice-1.0/public/index.php index 782bf0d11..a5550d9b2 100644 --- a/ice-1.0/public/index.php +++ b/ice-1.0/public/index.php @@ -13,4 +13,4 @@ echo $e->getMessage(); } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/laravel-4.2/public/index.php b/laravel-4.2/public/index.php index d74006337..58d202bb2 100644 --- a/laravel-4.2/public/index.php +++ b/laravel-4.2/public/index.php @@ -48,4 +48,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/laravel-5.0/public/index.php b/laravel-5.0/public/index.php index cb4732d5b..1ef7e8de6 100644 --- a/laravel-5.0/public/index.php +++ b/laravel-5.0/public/index.php @@ -56,4 +56,4 @@ $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/laravel-5.1/public/index.php b/laravel-5.1/public/index.php index b94d907c9..57d4255eb 100644 --- a/laravel-5.1/public/index.php +++ b/laravel-5.1/public/index.php @@ -57,4 +57,4 @@ $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/lumen-5.0/public/index.php b/lumen-5.0/public/index.php index 743febbfa..187d41560 100644 --- a/lumen-5.0/public/index.php +++ b/lumen-5.0/public/index.php @@ -27,4 +27,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/lumen-5.1/public/index.php b/lumen-5.1/public/index.php index 743febbfa..187d41560 100644 --- a/lumen-5.1/public/index.php +++ b/lumen-5.1/public/index.php @@ -27,4 +27,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/no-framework/index.php b/no-framework/index.php index 6965db1db..00a05fce4 100644 --- a/no-framework/index.php +++ b/no-framework/index.php @@ -2,4 +2,4 @@ echo 'Hello World!'; -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/nofuss-1.2/html/index.php b/nofuss-1.2/html/index.php index be3d06598..03ca132a8 100755 --- a/nofuss-1.2/html/index.php +++ b/nofuss-1.2/html/index.php @@ -37,6 +37,6 @@ $bootstrap->go(); // The if statement is needed for setup.sh -if ($_SERVER['DOCUMENT_ROOT'] !== '') { - require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +if (getenv('php_framework_benchmark_path') !== '') { + require getenv('php_framework_benchmark_path').'/libs/output_data.php'; } diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index 54aade299..3f717223d 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,22 +1,2 @@ -no-framework: 1606.08: 234608: 0.000233: 1 -phalcon-2.0: 835.00: 283120: 0.002651: 5 -ice-1.0: 749.81: 275680: 0.001453: 4 -tipsy-0.10: 988.07: 336808: 0.000606: 18 -fatfree-3.5: 520.58: 444136: 0.002025: 9 -slim-2.6: 795.92: 499872: 0.000879: 24 -ci-3.0: 101.58: 451376: 0.037094: 26 -nofuss-1.2: 344.94: 619640: 0.002954: 6 -slim-3.0: 498.56: 648136: 0.002141: 56 -bear-1.0: 215.44: 791688: 0.410931: 98 -lumen-5.1: 318.22: 750968: 0.006660: 32 -ze-1.0: 241.72: 823056: 0.009136: 64 -radar-1.0-dev: 259.75: 738792: 0.006119: 73 -yii-2.0: 313.75: 1399576: 0.006194: 49 -silex-1.3: 357.62: 734208: 0.001185: 58 -cygnite-1.3: 121.78: 779944: 0.018045: 70 -fuel-1.8-dev: 56.56: 730200: 0.065322: 55 -phpixie-3.2: 83.94: 1329712: 0.011355: 164 -aura-2.0: 127.48: 933160: 0.030256: 68 -cake-3.1: 152.83: 1383960: 0.010397: 84 -symfony-2.7: 70.54: 2735504: 0.017342: 103 -zf-2.5: 43.50: 3070136: 0.029376: 209 +no-framework: 1857.66: <b>Fatal error</b>: require(): Failed opening required '/libs/output_data.php' (include_path='. +phalcon-2.0: 804.48: <b>Fatal error</b>: require(): Failed opening required '/libs/output_data.php' (include_path='. diff --git a/phalcon-1.3/public/index.php b/phalcon-1.3/public/index.php index 0692a1a0e..812b17fcf 100644 --- a/phalcon-1.3/public/index.php +++ b/phalcon-1.3/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/phalcon-2.0/public/index.php b/phalcon-2.0/public/index.php index 0692a1a0e..812b17fcf 100644 --- a/phalcon-2.0/public/index.php +++ b/phalcon-2.0/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/phpixie-3.2/web/index.php b/phpixie-3.2/web/index.php index c26670e82..2d971eb55 100644 --- a/phpixie-3.2/web/index.php +++ b/phpixie-3.2/web/index.php @@ -6,4 +6,4 @@ $framework->registerDebugHandlers(); $framework->processHttpSapiRequest(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/radar-1.0-dev/web/index.php b/radar-1.0-dev/web/index.php index d779c0768..ae10a496b 100644 --- a/radar-1.0-dev/web/index.php +++ b/radar-1.0-dev/web/index.php @@ -46,4 +46,4 @@ */ $adr->run(ServerRequestFactory::fromGlobals(), new Response()); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/silex-1.2/web/index.php b/silex-1.2/web/index.php index 325c88efb..555ffc58c 100644 --- a/silex-1.2/web/index.php +++ b/silex-1.2/web/index.php @@ -8,4 +8,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/silex-1.3/web/index.php b/silex-1.3/web/index.php index 325c88efb..555ffc58c 100644 --- a/silex-1.3/web/index.php +++ b/silex-1.3/web/index.php @@ -8,4 +8,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/slim-2.6/index.php b/slim-2.6/index.php index 582160876..f8e0f578b 100644 --- a/slim-2.6/index.php +++ b/slim-2.6/index.php @@ -10,4 +10,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/slim-3.0/index.php b/slim-3.0/index.php index d07cb7226..1c181463b 100644 --- a/slim-3.0/index.php +++ b/slim-3.0/index.php @@ -10,4 +10,4 @@ $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/symfony-2.5/web/app.php b/symfony-2.5/web/app.php index 95518cfdc..9e56926ba 100644 --- a/symfony-2.5/web/app.php +++ b/symfony-2.5/web/app.php @@ -28,4 +28,4 @@ $response->send(); $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/symfony-2.6/web/app.php b/symfony-2.6/web/app.php index 090c587ea..656394a8e 100644 --- a/symfony-2.6/web/app.php +++ b/symfony-2.6/web/app.php @@ -29,4 +29,4 @@ $response->send(); $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/symfony-2.7/web/app.php b/symfony-2.7/web/app.php index 090c587ea..656394a8e 100644 --- a/symfony-2.7/web/app.php +++ b/symfony-2.7/web/app.php @@ -29,4 +29,4 @@ $response->send(); $kernel->terminate($request, $response); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/tipsy-0.10/web/index.php b/tipsy-0.10/web/index.php index fe37afb37..1d0ab1678 100644 --- a/tipsy-0.10/web/index.php +++ b/tipsy-0.10/web/index.php @@ -15,4 +15,4 @@ $t->start(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/yii-2.0/web/index.php b/yii-2.0/web/index.php index 6dba3d685..6bf4a7e29 100644 --- a/yii-2.0/web/index.php +++ b/yii-2.0/web/index.php @@ -11,4 +11,4 @@ (new yii\web\Application($config))->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/ze-1.0/public/index.php b/ze-1.0/public/index.php index c5139d8d7..6d96cc873 100644 --- a/ze-1.0/public/index.php +++ b/ze-1.0/public/index.php @@ -17,4 +17,4 @@ $app = $container->get('Zend\Expressive\Application'); $app->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/zf-2.4/public/index.php b/zf-2.4/public/index.php index e47cc9c49..7522ca27f 100644 --- a/zf-2.4/public/index.php +++ b/zf-2.4/public/index.php @@ -16,4 +16,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; diff --git a/zf-2.5/public/index.php b/zf-2.5/public/index.php index 44738080a..b8b0aa594 100644 --- a/zf-2.5/public/index.php +++ b/zf-2.5/public/index.php @@ -24,4 +24,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; +require getenv('php_framework_benchmark_path').'/libs/output_data.php'; From 9907bbf6066ec5988f109dbc8d319d425fbb62b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:31:47 +0200 Subject: [PATCH 14/43] A single framework list to maintain --- libs/parse_results.php | 41 ++------------ list.php | 72 +++++++++++++++++++++++++ list.sh | 120 +---------------------------------------- 3 files changed, 76 insertions(+), 157 deletions(-) create mode 100644 list.php diff --git a/libs/parse_results.php b/libs/parse_results.php index 7f57ac7be..f8c8a77ff 100644 --- a/libs/parse_results.php +++ b/libs/parse_results.php @@ -1,5 +1,7 @@ <?php +require( dirname(__FILE__) . '/../list.php'); + function parse_results($file) { $lines = file($file); @@ -31,44 +33,7 @@ function parse_results($file) ]; } - $frameworks = [ - "no-framework", - //"phalcon-1.3", - "phalcon-2.0", - "ice-1.0", - "tipsy-0.10", - "fatfree-3.5", - "slim-2.6", - "ci-3.0", - "nofuss-1.2", - "slim-3.0", - "bear-1.0", - "lumen-5.1", - "ze-1.0", - "radar-1.0-dev", - "yii-2.0", - //"lumen-5.0", - //"silex-1.2", - "silex-1.3", - "cygnite-1.3", - //"fuel-1.8-dev", - "fuel-2.0-dev", - "phpixie-3.2", - //"cake-3.0", - "aura-2.0", - "cake-3.1", - "bear-0.10", - //"symfony-2.5", - //"symfony-2.6", - "symfony-2.7", - //"laravel-4.2", - //"laravel-5.0", - "laravel-5.1", - //"zf-2.4", - "zf-2.5", - //"typo3f-2.3", - "typo3f-3.0", - ]; + $frameworks = frameworks(); $ordered_results = []; foreach ($frameworks as $fw) { diff --git a/list.php b/list.php new file mode 100644 index 000000000..014551c5f --- /dev/null +++ b/list.php @@ -0,0 +1,72 @@ +<?php + +function frameworks() +{ + + $frameworks = [ + "no-framework", + //"phalcon-1.3", + "phalcon-2.0", + "ice-1.0", + "tipsy-0.10", + "fatfree-3.5", + "slim-2.6", + "ci-3.0", + "nofuss-1.2", + "slim-3.0", + "bear-1.0", + "lumen-5.1", + "ze-1.0", + "radar-1.0-dev", + "yii-2.0", + //"lumen-5.0", + //"silex-1.2", + "silex-1.3", + "cygnite-1.3", + "fuel-1.8-dev", + //"fuel-2.0-dev", + "phpixie-3.2", + //"cake-3.0", + "aura-2.0", + "cake-3.1", + //"bear-0.10", + //"symfony-2.5", + //"symfony-2.6", + "symfony-2.7", + //"laravel-4.2", + //"laravel-5.0", + //"laravel-5.1", // Disabled since it segfaults too much + //"zf-2.4", + "zf-2.5", + //"typo3f-2.3", + //"typo3f-3.0", // Disabled since it attempts to connect to mysql + ]; + + if (strpos(getenv('stack'), 'hhvm') !== false) { + return array_diff( + $frameworks, + array( + 'phalcon-1.3', // Not supported by HHVM + 'phalcon-2.0', // Not supported by HHVM + 'ice-1.0', // Not supported by HHVM + 'bear-1.0', // apc_fetch()-error on PHP7 + 'laravel-5.1', // fails-with-no-such-file-or-directory + ) + ); + } + + if (strpos(getenv('stack'), 'php_7') !== false) { + return array_diff( + $frameworks, + array( + 'phalcon-1.3', // Not compiled for PHP7 - is it even supported? + 'phalcon-2.0', // Not compiled for PHP7 - is it even supported? + 'ice-1.0', // Not compiled for PHP7 - is it even supported? + 'bear-1.0', // apc_fetch()-error on PHP7 + ) + ); + } + + return $frameworks; + +} diff --git a/list.sh b/list.sh index 125c68bde..9b78b7fe1 100755 --- a/list.sh +++ b/list.sh @@ -1,123 +1,5 @@ #!/bin/sh -if [ "$stack" = "local" ] || [ "$stack" = "docker_nginx_php_5_6_4" ]; then list=" -no-framework -#phalcon-1.3 -phalcon-2.0 -ice-1.0 -tipsy-0.10 -fatfree-3.5 -slim-2.6 -ci-3.0 -nofuss-1.2 -slim-3.0 -bear-1.0 -lumen-5.1 -ze-1.0 -radar-1.0-dev -yii-2.0 -#lumen-5.0 -#silex-1.2 -silex-1.3 -cygnite-1.3 -fuel-1.8-dev -#fuel-2.0-dev -phpixie-3.2 -#cake-3.0 -aura-2.0 -cake-3.1 -#bear-0.10 -#symfony-2.5 -#symfony-2.6 -symfony-2.7 -#laravel-4.2 -#laravel-5.0 -#segfaults-too-much#laravel-5.1 -#zf-2.4 -zf-2.5 -#typo3f-2.3 -#disabled-since-it-attempts-to-connect-to-mysql#typo3f-3.0 +"$(php -r 'require("list.php"); foreach (frameworks() as $fw) {echo $fw."\n";};')" " -fi -if [ "$stack" = "docker_nginx_hhvm_3_10_1" ]; then -list=" -no-framework -#not-supported-by-hhvm##phalcon-1.3 -#not-supported-by-hhvm#phalcon-2.0 -#not-supported-by-hhvm#ice-1.0 -tipsy-0.10 -fatfree-3.5 -slim-2.6 -ci-3.0 -nofuss-1.2 -slim-3.0 -#apc_fetch()-error#bear-1.0 -lumen-5.1 -ze-1.0 -radar-1.0-dev -yii-2.0 -#lumen-5.0 -#silex-1.2 -silex-1.3 -cygnite-1.3 -fuel-1.8-dev -#fuel-2.0-dev -phpixie-3.2 -#cake-3.0 -aura-2.0 -cake-3.1 -#bear-0.10 -#symfony-2.5 -#symfony-2.6 -symfony-2.7 -#laravel-4.2 -#laravel-5.0 -#fails-with-no-such-file-or-directory#laravel-5.1 -#zf-2.4 -zf-2.5 -#typo3f-2.3 -#disabled-since-it-attempts-to-connect-to-mysql#typo3f-3.0 -" - -fi -if [ "$stack" = "docker_nginx_php_7_0_0" ]; then -list=" -no-framework -#not-compiled-for-php7-is-it-even-supported##phalcon-1.3 -#not-compiled-for-php7-is-it-even-supported#phalcon-2.0 -#not-compiled-for-php7-is-it-even-supported#ice-1.0 -tipsy-0.10 -fatfree-3.5 -slim-2.6 -ci-3.0 -nofuss-1.2 -slim-3.0 -#apc_fetch()-error#bear-1.0 -lumen-5.1 -ze-1.0 -radar-1.0-dev -yii-2.0 -#lumen-5.0 -#silex-1.2 -silex-1.3 -cygnite-1.3 -fuel-1.8-dev -#fuel-2.0-dev -phpixie-3.2 -#cake-3.0 -aura-2.0 -cake-3.1 -#bear-0.10 -#symfony-2.5 -#symfony-2.6 -symfony-2.7 -#laravel-4.2 -#laravel-5.0 -#segfaults-too-much#laravel-5.1 -#zf-2.4 -zf-2.5 -#typo3f-2.3 -#disabled-since-it-attempts-to-connect-to-mysql#typo3f-3.0 -" -fi From eb5ecbfa13fcee45c33edcfc304642c9cc0f7a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:31:12 +0200 Subject: [PATCH 15/43] Using headers to output benchmark data (solved Content-Length curl issues as described in https://github.com/kenjis/php-framework-benchmark/issues/38) --- benchmarks/_functions.sh | 22 +++++++++++++++------- libs/output_data.php | 10 +++++++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/benchmarks/_functions.sh b/benchmarks/_functions.sh index 56a128c1c..af713ce5f 100644 --- a/benchmarks/_functions.sh +++ b/benchmarks/_functions.sh @@ -4,15 +4,16 @@ benchmark () url="$2" ab_log="$output_dir/$fw.ab.log" output="$output_dir/$fw.output" + benchmark_data="$output_dir/$fw.benchmark_data" echo "ab -c 10 -t 3 $url" ab -c 10 -t 3 "$url" > "$ab_log" - curl "$url" > "$output" + curl --dump-header "$benchmark_data" "$url" > "$output" rps=`grep "Requests per second:" "$ab_log" | cut -f 7 -d " "` - memory=`tail -1 "$output" | cut -f 1 -d ':'` - time=`tail -1 "$output" | cut -f 2 -d ':'` - file=`tail -1 "$output" | cut -f 3 -d ':'` + memory=`grep "X-Benchmark-Output-Data:" "$benchmark_data" | cut -f 2 -d ':' | cut -f 2 -d ' '` + time=`grep "X-Benchmark-Output-Data:" "$benchmark_data" | cut -f 3 -d ':'` + file=`grep "X-Benchmark-Output-Data:" "$benchmark_data" | cut -f 4 -d ':'` echo "$fw: $rps: $memory: $time: $file" >> "$results_file" echo "$fw" >> "$check_file" @@ -35,9 +36,16 @@ benchmark () tmp=`cat "$output"` error="$error$tmp" fi - x=`grep ':' "$output" || true` - if [ "$x" = "" ]; then - tmp=`cat "$output"` + if [ "$memory" = "" ]; then + tmp=`cat "$benchmark_data"` + error="$error$tmp" + fi + if [ "$time" = "" ]; then + tmp=`cat "$benchmark_data"` + error="$error$tmp" + fi + if [ "$file" = "" ]; then + tmp=`cat "$benchmark_data"` error="$error$tmp" fi if [ "$error" != "" ]; then diff --git a/libs/output_data.php b/libs/output_data.php index 5e71b61a4..2c7695941 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -1,13 +1,17 @@ <?php +// Get benchmark output data $real_usage = null; -// On HHVM, using $real_usage = false ends up always returning 2097152 bytes - https://github.com/facebook/hhvm/issues/2257 if (defined('HHVM_VERSION')) { + // On HHVM, using $real_usage = false ends up always returning 2097152 bytes - https://github.com/facebook/hhvm/issues/2257 $real_usage = true; } -return sprintf( - "\n%' 8d:%f:%d", +$results = sprintf( + "%' 8d:%f:%d", memory_get_peak_usage($real_usage), // Using $real_usage due to microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], count(get_included_files()) - 1 ); + +// Respond benchmark output data in header +header('X-Benchmark-Output-Data: ' . $results); From 4a645604f188296183a6ad0aafa114fe900ed854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:34:09 +0200 Subject: [PATCH 16/43] Only calculate output data if specifically requested (fixes https://github.com/kenjis/php-framework-benchmark/issues/36) --- benchmarks/_functions.sh | 2 +- libs/output_data.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/benchmarks/_functions.sh b/benchmarks/_functions.sh index af713ce5f..0998b1faf 100644 --- a/benchmarks/_functions.sh +++ b/benchmarks/_functions.sh @@ -8,7 +8,7 @@ benchmark () echo "ab -c 10 -t 3 $url" ab -c 10 -t 3 "$url" > "$ab_log" - curl --dump-header "$benchmark_data" "$url" > "$output" + curl -H 'X-Include-Benchmark-Output-Data: 1' --dump-header "$benchmark_data" "$url" > "$output" rps=`grep "Requests per second:" "$ab_log" | cut -f 7 -d " "` memory=`grep "X-Benchmark-Output-Data:" "$benchmark_data" | cut -f 2 -d ':' | cut -f 2 -d ' '` diff --git a/libs/output_data.php b/libs/output_data.php index 2c7695941..81f9eff89 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -1,5 +1,11 @@ <?php +// Only calculate output data if specifically requested +$headers = getallheaders(); +if (!isset($headers["X-Include-Benchmark-Output-Data"])) { + return; +} + // Get benchmark output data $real_usage = null; if (defined('HHVM_VERSION')) { From b3b63ff5ac23d5e57a4c60e250805454010dbfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:41:05 +0200 Subject: [PATCH 17/43] Restored list as it was before this pr --- list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/list.php b/list.php index 014551c5f..a46f7c429 100644 --- a/list.php +++ b/list.php @@ -4,7 +4,7 @@ function frameworks() { $frameworks = [ - "no-framework", + //"no-framework", //"phalcon-1.3", "phalcon-2.0", "ice-1.0", @@ -35,11 +35,11 @@ function frameworks() "symfony-2.7", //"laravel-4.2", //"laravel-5.0", - //"laravel-5.1", // Disabled since it segfaults too much + "laravel-5.1", // Currently segfaults a lot when running in docker stacks //"zf-2.4", "zf-2.5", //"typo3f-2.3", - //"typo3f-3.0", // Disabled since it attempts to connect to mysql + "typo3f-3.0", // Should probably be disabled since it attempts to connect to mysql ]; if (strpos(getenv('stack'), 'hhvm') !== false) { From 57dcaa70b666f42ea8e332cedf18348efd737f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:45:29 +0200 Subject: [PATCH 18/43] Only exit on failure during development --- benchmarks/hello_world.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/hello_world.sh b/benchmarks/hello_world.sh index f0eb90b4a..13e46100d 100644 --- a/benchmarks/hello_world.sh +++ b/benchmarks/hello_world.sh @@ -1,7 +1,7 @@ #!/bin/sh -# exit on failure -set -e +# exit on failure - use during development +#set -e cd `dirname $0` . ./_functions.sh From 4c5bb548a71ee4bdeb9f22ecb7e7540b7d926c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:51:40 +0200 Subject: [PATCH 19/43] Restored parse results --- libs/parse_results.php | 8 +++--- .../results.hello_world.log | 25 +++++++++++++++++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/libs/parse_results.php b/libs/parse_results.php index f8c8a77ff..94c0b0b36 100644 --- a/libs/parse_results.php +++ b/libs/parse_results.php @@ -40,10 +40,10 @@ function parse_results($file) if (isset($results[$fw])) { $data = $results[$fw]; $ordered_results[$fw] = $data; - $results[$fw]['rps_relative'] = $data['rps'] / $min_rps; - $results[$fw]['memory_relative'] = $data['memory'] / $min_memory; - $results[$fw]['time_relative'] = $data['time'] / $min_time; - $results[$fw]['file_relative'] = $data['file'] / $min_file; + $ordered_results[$fw]['rps_relative'] = $data['rps'] / $min_rps; + $ordered_results[$fw]['memory_relative'] = $data['memory'] / $min_memory; + $ordered_results[$fw]['time_relative'] = $data['time'] / $min_time; + $ordered_results[$fw]['file_relative'] = $data['file'] / $min_file; } else { $ordered_results[$fw] = [ 'rps' => 0, diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index 3f717223d..ef668d871 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,2 +1,23 @@ -no-framework: 1857.66: <b>Fatal error</b>: require(): Failed opening required '/libs/output_data.php' (include_path='. -phalcon-2.0: 804.48: <b>Fatal error</b>: require(): Failed opening required '/libs/output_data.php' (include_path='. +phalcon-2.0: 442.23: 284000: 0.001285: 5 +ice-1.0: 346.25: 276880: 0.001429: 4 +tipsy-0.10: 765.21: 337792: 0.000854: 18 +fatfree-3.5: 405.25: 445608: 0.002949: 9 +slim-2.6: 568.30: 501296: 0.000874: 24 +ci-3.0: 97.41: 452408: 0.037585: 26 +nofuss-1.2: 322.27: 620432: 0.005559: 6 +slim-3.0: 451.39: 649672: 0.001291: 56 +bear-1.0: 167.26: 792728: 0.007976: 98 +lumen-5.1: 261.62: : : +ze-1.0: 216.26: 824496: 0.016860: 67 +radar-1.0-dev: 173.97: 740256: 0.007047: 73 +yii-2.0: 233.58: 1400648: 0.004456: 49 +silex-1.3: 302.48: : : +cygnite-1.3: 105.62: 781160: 0.020838: 70 +fuel-1.8-dev: 49.83: 731240: 0.059651: 55 +phpixie-3.2: 60.23: 1331464: 0.006060: 164 +aura-2.0: 119.63: 934456: 0.014544: 68 +cake-3.1: 135.99: : : +symfony-2.7: 52.53: : : +laravel-5.1: 96.54: : : +zf-2.5: 30.62: 3072104: 0.042601: 209 +typo3f-3.0: 7.65: : : From 7afc5c06eac3a84b387b4fc8e1edac17d60a20d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 11:52:19 +0200 Subject: [PATCH 20/43] Preventing division by zero when calculating relative results --- libs/parse_results.php | 8 ++++---- libs/recalc_relative.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/parse_results.php b/libs/parse_results.php index 94c0b0b36..88cc88bc2 100644 --- a/libs/parse_results.php +++ b/libs/parse_results.php @@ -20,10 +20,10 @@ function parse_results($file) $time = (float) trim($column[3])*1000; $file = (int) trim($column[4]); - $min_rps = min($min_rps, $rps); - $min_memory = min($min_memory, $memory); - $min_time = min($min_time, $time); - $min_file = min($min_file, $file); + $min_rps = $rps > 0 ? min($min_rps, $rps) : $min_rps; + $min_memory = $memory > 0 ? min($min_memory, $memory) : $min_memory; + $min_time = $time > 0 ? min($min_time, $time) : $min_time; + $min_file = $file > 0 ? min($min_file, $file) : $min_file; $results[$fw] = [ 'rps' => $rps, diff --git a/libs/recalc_relative.php b/libs/recalc_relative.php index d51ee2fb4..88c8ff6c9 100644 --- a/libs/recalc_relative.php +++ b/libs/recalc_relative.php @@ -7,9 +7,9 @@ function recalc_relative($results) $min_time = INF; foreach ($results as $fw) { - $min_rps = min($min_rps, $fw['rps']); - $min_memory = min($min_memory, $fw['memory']); - $min_time = min($min_time, $fw['time']); + $min_rps = $fw['rps'] > 0 ? min($min_rps, $fw['rps']) : $min_rps; + $min_memory = $fw['memory'] > 0 ? min($min_memory, $fw['memory']) : $min_memory; + $min_time = $fw['time'] > 0 ? min($min_time, $fw['time']) : $min_time; } foreach ($results as $fw => $data) { From c74eeb8647c7c91f065aa654ac395bd4ce7cc524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:03:48 +0200 Subject: [PATCH 21/43] Not using getallheaders() since it is not available in PHP 7 when using fpm (related: https://github.com/kenjis/php-framework-benchmark/issues/38) --- libs/output_data.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/output_data.php b/libs/output_data.php index 81f9eff89..24e75575e 100644 --- a/libs/output_data.php +++ b/libs/output_data.php @@ -1,8 +1,7 @@ <?php // Only calculate output data if specifically requested -$headers = getallheaders(); -if (!isset($headers["X-Include-Benchmark-Output-Data"])) { +if (!isset($_SERVER["HTTP_X_INCLUDE_BENCHMARK_OUTPUT_DATA"])) { return; } From 80835656012fa1b417c8aa19f349e26dd8474836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:16:34 +0200 Subject: [PATCH 22/43] Updated results --- list.php | 2 +- .../results.hello_world.log | 38 +++++++-------- .../results.hello_world.log | 46 +++++++++---------- .../results.hello_world.log | 39 ++++++++-------- 4 files changed, 63 insertions(+), 62 deletions(-) diff --git a/list.php b/list.php index a46f7c429..db0eed00f 100644 --- a/list.php +++ b/list.php @@ -49,7 +49,7 @@ function frameworks() 'phalcon-1.3', // Not supported by HHVM 'phalcon-2.0', // Not supported by HHVM 'ice-1.0', // Not supported by HHVM - 'bear-1.0', // apc_fetch()-error on PHP7 + 'bear-1.0', // apc_fetch()-error on HHVM 'laravel-5.1', // fails-with-no-such-file-or-directory ) ); diff --git a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log index 247f931cc..e34eb1990 100644 --- a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log +++ b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log @@ -1,19 +1,19 @@ -no-framework: 941.20: 31136: 0.000816: 1 -tipsy-0.10: 151.22: 40864: 0.013672: 18 -fatfree-3.5: 191.62: 73960: 0.005139: 9 -slim-2.6: 134.64: 45728: 0.018968: 24 -ci-3.0: 42.75: 47936: 0.029706: 26 -nofuss-1.2: 159.58: 47216: 0.008147: 6 -slim-3.0: 57.89: 76576: 0.025089: 56 -lumen-5.1: 89.58: 221896: 0.012224: 32 -ze-1.0: 48.92: 149536: 0.024459: 64 -radar-1.0-dev: 42.40: 87256: 0.031434: 73 -yii-2.0: 63.54: 511976: 0.020642: 49 -silex-1.3: 58.46: 103120: 0.026938: 58 -cygnite-1.3: 29.07: 175672: 0.048073: 70 -fuel-1.8-dev: 30.30: 123128: 0.043546: 54 -phpixie-3.2: 16.85: 286152: 0.083052: 164 -aura-2.0: 48.15: 166232: 0.025206: 68 -cake-3.1: 34.88: 171256: 0.049870: 84 -symfony-2.7: 22.98: 667248: 0.062403: 103 -zf-2.5: 14.64: 602112: 0.097132: 208 +tipsy-0.10: 214.86: 41440: 0.008228: 18 +fatfree-3.5: 226.79: 74424: 0.005924: 9 +slim-2.6: 120.64: 45952: 0.009782: 24 +ci-3.0: 50.22: 48032: 0.029192: 26 +nofuss-1.2: 177.91: 47312: 0.007217: 6 +slim-3.0: 69.33: 73864: 0.024435: 56 +lumen-5.1: 108.27: 222768: 0.015289: 37 +ze-1.0: 57.80: 146744: 0.028795: 67 +radar-1.0-dev: 45.85: 87352: 0.030910: 73 +yii-2.0: 77.89: 512072: 0.015944: 49 +silex-1.3: 65.57: 101976: 0.022673: 64 +cygnite-1.3: 33.37: 175768: 0.047198: 70 +fuel-1.8-dev: 36.25: 123320: 0.042660: 54 +phpixie-3.2: 20.32: 286584: 0.076567: 164 +aura-2.0: 53.86: 166568: 0.032857: 68 +cake-3.1: 42.10: 170936: 0.043252: 84 +symfony-2.7: 23.23: 674344: 0.061641: 106 +zf-2.5: 16.68: 602648: 0.092867: 208 +typo3f-3.0: 10.50: : : diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index ef668d871..896324e5e 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,23 +1,23 @@ -phalcon-2.0: 442.23: 284000: 0.001285: 5 -ice-1.0: 346.25: 276880: 0.001429: 4 -tipsy-0.10: 765.21: 337792: 0.000854: 18 -fatfree-3.5: 405.25: 445608: 0.002949: 9 -slim-2.6: 568.30: 501296: 0.000874: 24 -ci-3.0: 97.41: 452408: 0.037585: 26 -nofuss-1.2: 322.27: 620432: 0.005559: 6 -slim-3.0: 451.39: 649672: 0.001291: 56 -bear-1.0: 167.26: 792728: 0.007976: 98 -lumen-5.1: 261.62: : : -ze-1.0: 216.26: 824496: 0.016860: 67 -radar-1.0-dev: 173.97: 740256: 0.007047: 73 -yii-2.0: 233.58: 1400648: 0.004456: 49 -silex-1.3: 302.48: : : -cygnite-1.3: 105.62: 781160: 0.020838: 70 -fuel-1.8-dev: 49.83: 731240: 0.059651: 55 -phpixie-3.2: 60.23: 1331464: 0.006060: 164 -aura-2.0: 119.63: 934456: 0.014544: 68 -cake-3.1: 135.99: : : -symfony-2.7: 52.53: : : -laravel-5.1: 96.54: : : -zf-2.5: 30.62: 3072104: 0.042601: 209 -typo3f-3.0: 7.65: : : +phalcon-2.0: 900.52: 284000: 0.009533: 5 +ice-1.0: 886.83: 276680: 0.002118: 4 +tipsy-0.10: 1247.81: 337464: 0.001201: 18 +fatfree-3.5: 596.53: 445608: 0.002086: 9 +slim-2.6: 929.21: 501296: 0.000886: 24 +ci-3.0: 121.91: 452408: 0.034529: 26 +nofuss-1.2: 383.68: 620432: 0.004703: 6 +slim-3.0: 616.10: 649672: 0.001381: 56 +bear-1.0: 219.58: 792728: 0.007820: 98 +lumen-5.1: 346.63: : : +ze-1.0: 280.52: 824496: 0.008403: 67 +radar-1.0-dev: 271.42: 740256: 0.005606: 73 +yii-2.0: 312.90: 1400440: 0.005621: 49 +silex-1.3: 322.96: : : +cygnite-1.3: 141.07: 780744: 0.019817: 70 +fuel-1.8-dev: 60.06: 731112: 0.053473: 55 +phpixie-3.2: 23.88: 1331088: 0.007039: 164 +aura-2.0: 134.19: 934240: 0.018275: 68 +cake-3.1: 162.97: : : +symfony-2.7: 67.06: : : +laravel-5.1: 112.99: : : +zf-2.5: 40.13: 3072104: 0.043973: 209 +typo3f-3.0: 0.30: : : diff --git a/output/docker_nginx_php_7_0_0/results.hello_world.log b/output/docker_nginx_php_7_0_0/results.hello_world.log index a60fa5be4..c1370f2ff 100644 --- a/output/docker_nginx_php_7_0_0/results.hello_world.log +++ b/output/docker_nginx_php_7_0_0/results.hello_world.log @@ -1,19 +1,20 @@ -no-framework: 2002.75: 357288: 0.000312: 1 -tipsy-0.10: 1149.66: 386832: 0.000585: 18 -fatfree-3.5: 620.23: 455712: 0.001992: 9 -slim-2.6: 1148.00: 506936: 0.000839: 24 -ci-3.0: 114.68: 398920: 0.037701: 26 -nofuss-1.2: 447.11: 695808: 0.002700: 6 -slim-3.0: 863.84: 606016: 0.000602: 56 -lumen-5.1: 442.27: 689360: 0.005848: 27 -ze-1.0: 366.28: 686376: 0.005012: 64 -radar-1.0-dev: 382.59: 651376: 0.002490: 73 -yii-2.0: 466.63: 1044888: 0.002134: 49 -silex-1.3: 540.76: 665320: 0.000726: 58 -cygnite-1.3: 148.47: 668760: 0.016897: 70 -fuel-1.8-dev: 63.19: 651200: 0.067138: 54 -phpixie-3.2: 101.25: 1022112: 0.010456: 159 -aura-2.0: 179.28: 770104: 0.007434: 68 -cake-3.1: 199.17: 867160: 0.015056: 83 -symfony-2.7: 81.19: 2063144: 0.007208: 103 -zf-2.5: 59.44: 1766080: 0.018493: 209 +tipsy-0.10: 896.96: 387112: 0.001258: 18 +fatfree-3.5: 359.90: 456072: 0.003100: 9 +slim-2.6: 457.76: 507976: 0.000956: 24 +ci-3.0: 37.78: 399200: 0.071718: 26 +nofuss-1.2: 198.13: 696120: 0.014310: 6 +slim-3.0: 737.52: 606872: 0.000951: 56 +lumen-5.1: 453.18: : : +ze-1.0: 383.46: 701416: 0.004219: 67 +radar-1.0-dev: 392.29: 652144: 0.004078: 73 +yii-2.0: 526.52: 1045168: 0.002648: 49 +silex-1.3: 718.84: : : +cygnite-1.3: 183.64: 669056: 0.012864: 70 +fuel-1.8-dev: 75.33: 651536: 0.204399: 54 +phpixie-3.2: 148.18: 1022880: 0.005025: 159 +aura-2.0: 227.59: 770448: 0.006133: 68 +cake-3.1: 292.33: : : +symfony-2.7: 157.97: : : +laravel-5.1: 202.55: : : +zf-2.5: 91.57: 1766928: 0.016049: 209 +typo3f-3.0: 1.38: : : From 599856dbc9c1d2b2642b50d61f3f033bebe2acb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:24:55 +0200 Subject: [PATCH 23/43] HTML-escaping error log on results page --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 1e38e1fe9..65de74c12 100644 --- a/index.php +++ b/index.php @@ -92,7 +92,7 @@ <hr> <h3>Error log</h3> -<pre><?php echo file_get_contents($output_dir . '/error.hello_world.log'); ?></pre> +<pre><?php echo htmlspecialchars(file_get_contents($output_dir . '/error.hello_world.log')); ?></pre> <hr> From 5517da4d204f6fea52e076154a2f2e9c687b7eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:32:04 +0200 Subject: [PATCH 24/43] Docker-related parts of readme to separate file --- README.md | 48 +----------------------------------- docker/README.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 docker/README.md diff --git a/README.md b/README.md index 3f8a4d135..1d87d53d7 100644 --- a/README.md +++ b/README.md @@ -167,53 +167,7 @@ Use the supplied Docker Stack in order to automatically set up the following ben By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. -### Getting Started - -If running locally, install [Docker Toolbox](https://www.docker.com/docker-toolbox). - -Clone the source code: -~~~ -git clone https://github.com/kenjis/php-framework-benchmark.git -cd php-framework-benchmark -~~~ - -Cd into the docker directory of this repo and make sure that docker toolbox is available: -~~~ -cd docker -eval "$(docker-machine env default)" -~~~ - -Start the Nginx/PHP server stacks: -~~~ -docker-compose up -d -~~~ - -Start the supplied docker shell from within this repository's `docker` folder: -~~~ -docker-compose run shell -~~~ - -Run the set-up script: -~~~ -sh setup.sh -~~~ - -Run benchmarks against each stack: -~~~ -stack=docker_nginx_php_5_6_4 sh benchmark.sh -stack=docker_nginx_hhvm_3_10_1 sh benchmark.sh -stack=docker_nginx_php_7_0_0 sh benchmark.sh -~~~ - -### Check the results - -To see the results graph, run the following script from outside the docker shell, from the repository root: - -~~~ -bin/docker-urls.sh -~~~ - -It echoes URLs, which you should open up in your browser. +See [docker/README.md](docker/README.md) ## References diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..bdcea7e1d --- /dev/null +++ b/docker/README.md @@ -0,0 +1,64 @@ +## Benchmarking using the supplied Docker Stack + +Use the supplied Docker Stack in order to automatically set up the following benchmarking environments: + +* Ubuntu 15.04 64bit (Docker) + * Nginx 1.7.12 + * PHP-FPM 5.6.4 + * Zend OPcache 7.0.4-dev + * PhalconPHP 2.0.9 + * PHP-FPM 7.0.0 + * Zend OPcache 7.0.6-dev + * PhalconPHP 2.0.9 + * HHVM 3.10.1 + +By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. + +### Getting Started + +If running locally, install [Docker Toolbox](https://www.docker.com/docker-toolbox). + +Clone the source code: +~~~ +$ git clone https://github.com/kenjis/php-framework-benchmark.git +$ cd php-framework-benchmark +~~~ + +Cd into the docker directory of this repo and make sure that docker toolbox is available: +~~~ +$ cd docker +$ eval "$(docker-machine env default)" +~~~ + +Start the Nginx/PHP server stacks: +~~~ +$ docker-compose up -d +~~~ + +Start the supplied docker shell from within this repository's `docker` folder: +~~~ +$ docker-compose run shell +~~~ + +Run the set-up script: +~~~ +# sh setup.sh +~~~ + +Run benchmarks against each stack: +~~~ +$ stack=docker_nginx_php_5_6_4 sh benchmark.sh +$ stack=docker_nginx_hhvm_3_10_1 sh benchmark.sh +$ stack=docker_nginx_php_7_0_0 sh benchmark.sh +~~~ + +### Check the results + +To see the results graph, run the following script from outside the docker shell, from the repository root: + +~~~ +$ bin/docker-urls.sh +~~~ + +It echoes URLs, which you should open up in your browser. + From 5611c2bd1433e80b234f83034c8315d86410fb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:40:03 +0200 Subject: [PATCH 25/43] Added placeholder for other results --- OTHER_RESULTS.md | 34 ++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 OTHER_RESULTS.md diff --git a/OTHER_RESULTS.md b/OTHER_RESULTS.md new file mode 100644 index 000000000..e52523f32 --- /dev/null +++ b/OTHER_RESULTS.md @@ -0,0 +1,34 @@ +# PHP ORM Benchmark + +## Other Results + +### [motin](https://github.com/motin) + +(2015-12-09) + +Using [the supplied Docker Stack]((docker/README.md)): + +* Ubuntu 15.04 64bit (Docker) + * Nginx 1.7.12 + * PHP-FPM 5.6.4 + * Zend OPcache 7.0.4-dev + * PhalconPHP 2.0.9 + * PHP-FPM 7.0.0 + * Zend OPcache 7.0.6-dev + * PhalconPHP 2.0.9 + * HHVM 3.10.1 + +Running on a MacBook Pro (Retina, 15-inch, Mid 2014). + +By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. + + + +## PHP-FPM 5.6.4 with opcode cache + +## HHVM CLI 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) + +## PHP CLI 7.0.0 with opcode cache + + + diff --git a/README.md b/README.md index 1d87d53d7..6111c93c5 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,8 @@ These are my benchmarks, not yours. **I encourage you to run on your (production Note(1): All the results are run on php with `phalcon.so` and `ice.so`. If you don't load phalcon.so or ice.so, the rps except for Phalcon or Ice probably increase a bit. +If you are interested in other results, see [OTHER_RESULTS.md](OTHER_RESULTS.md). + ## How to Benchmark Install source code as <http://localhost/php-framework-benchmark/>: From 8f75cbc8767be65e0689031b21c6abd61c57b329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:48:15 +0200 Subject: [PATCH 26/43] Activated opcode cache --- docker/stack/php/conf.d/app.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/stack/php/conf.d/app.ini b/docker/stack/php/conf.d/app.ini index 0cffb0826..73d1f2663 100644 --- a/docker/stack/php/conf.d/app.ini +++ b/docker/stack/php/conf.d/app.ini @@ -5,4 +5,4 @@ html_errors=on short_open_tag=on ; Uncomment during development -opcache.validate_timestamps=on ; +; opcache.validate_timestamps=on ; From 54f5768f3a44ea235ed4497ccebc64c1bf9cc6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:48:27 +0200 Subject: [PATCH 27/43] Including all frameworks despite stack (so that the resulting graphs share the same colors per framework) --- list.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/list.php b/list.php index db0eed00f..e00bc34ff 100644 --- a/list.php +++ b/list.php @@ -42,31 +42,6 @@ function frameworks() "typo3f-3.0", // Should probably be disabled since it attempts to connect to mysql ]; - if (strpos(getenv('stack'), 'hhvm') !== false) { - return array_diff( - $frameworks, - array( - 'phalcon-1.3', // Not supported by HHVM - 'phalcon-2.0', // Not supported by HHVM - 'ice-1.0', // Not supported by HHVM - 'bear-1.0', // apc_fetch()-error on HHVM - 'laravel-5.1', // fails-with-no-such-file-or-directory - ) - ); - } - - if (strpos(getenv('stack'), 'php_7') !== false) { - return array_diff( - $frameworks, - array( - 'phalcon-1.3', // Not compiled for PHP7 - is it even supported? - 'phalcon-2.0', // Not compiled for PHP7 - is it even supported? - 'ice-1.0', // Not compiled for PHP7 - is it even supported? - 'bear-1.0', // apc_fetch()-error on PHP7 - ) - ); - } - return $frameworks; } From 9720d479b3101fb06d673034dd4099672236943f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:58:53 +0200 Subject: [PATCH 28/43] Updated results, including also in readme --- OTHER_RESULTS.md | 87 ++++++++++++++++++- .../results.hello_world.log | 42 +++++---- .../results.hello_world.log | 46 +++++----- .../results.hello_world.log | 43 ++++----- 4 files changed, 152 insertions(+), 66 deletions(-) diff --git a/OTHER_RESULTS.md b/OTHER_RESULTS.md index e52523f32..f7196ec7b 100644 --- a/OTHER_RESULTS.md +++ b/OTHER_RESULTS.md @@ -4,7 +4,7 @@ ### [motin](https://github.com/motin) -(2015-12-09) +(2015-12-10) Using [the supplied Docker Stack]((docker/README.md)): @@ -22,13 +22,92 @@ Running on a MacBook Pro (Retina, 15-inch, Mid 2014). By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. - - ## PHP-FPM 5.6.4 with opcode cache -## HHVM CLI 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) + + +|framework |requests per second|relative|peak memory|relative| +|-------------------|------------------:|-------:|----------:|-------:| +|phalcon-2.0 | 975.53| 5,419.6| 0.27| 1.0| +|ice-1.0 | 611.45| 3,396.9| 0.26| 1.0| +|tipsy-0.10 | 752.09| 4,178.3| 0.32| 1.2| +|fatfree-3.5 | 363.96| 2,022.0| 0.42| 1.6| +|slim-2.6 | 578.86| 3,215.9| 0.48| 1.8| +|ci-3.0 | 67.70| 376.1| 0.43| 1.6| +|nofuss-1.2 | 226.13| 1,256.3| 0.59| 2.2| +|slim-3.0 | 386.59| 2,147.7| 0.62| 2.4| +|bear-1.0 | 0.20| 1.1| 0.76| 2.9| +|lumen-5.1 | 178.44| 991.3| 0.00| 0.0| +|ze-1.0 | 136.61| 758.9| 0.79| 3.0| +|radar-1.0-dev | 153.33| 851.8| 0.71| 2.7| +|yii-2.0 | 252.91| 1,405.1| 1.34| 5.1| +|silex-1.3 | 327.53| 1,819.6| 0.00| 0.0| +|cygnite-1.3 | 72.30| 401.7| 0.74| 2.8| +|fuel-1.8-dev | 21.44| 119.1| 0.70| 2.7| +|phpixie-3.2 | 24.92| 138.4| 1.27| 4.8| +|aura-2.0 | 149.58| 831.0| 0.89| 3.4| +|cake-3.1 | 166.20| 923.3| 0.00| 0.0| +|symfony-2.7 | 51.79| 287.7| 0.00| 0.0| +|laravel-5.1 | 76.21| 423.4| 0.00| 0.0| +|zf-2.5 | 32.31| 179.5| 2.93| 11.1| +|typo3f-3.0 | 0.18| 1.0| 0.00| 0.0| ## PHP CLI 7.0.0 with opcode cache + + +|framework |requests per second|relative|peak memory|relative| +|-------------------|------------------:|-------:|----------:|-------:| +|phalcon-2.0 | 1,295.21| 7,618.9| 0.00| 0.0| +|ice-1.0 | 1,066.86| 6,275.6| 0.00| 0.0| +|tipsy-0.10 | 727.06| 4,276.8| 0.37| 1.0| +|fatfree-3.5 | 405.82| 2,387.2| 0.43| 1.2| +|slim-2.6 | 677.22| 3,983.6| 0.48| 1.3| +|ci-3.0 | 77.41| 455.4| 0.38| 1.0| +|nofuss-1.2 | 275.86| 1,622.7| 0.66| 1.8| +|slim-3.0 | 616.27| 3,625.1| 0.58| 1.6| +|bear-1.0 | 69.47| 408.6| 0.00| 0.0| +|lumen-5.1 | 310.64| 1,827.3| 0.00| 0.0| +|ze-1.0 | 212.23| 1,248.4| 0.67| 1.8| +|radar-1.0-dev | 196.84| 1,157.9| 0.62| 1.7| +|yii-2.0 | 274.29| 1,613.5| 1.00| 2.7| +|silex-1.3 | 252.21| 1,483.6| 0.00| 0.0| +|cygnite-1.3 | 65.33| 384.3| 0.64| 1.7| +|fuel-1.8-dev | 31.17| 183.4| 0.62| 1.7| +|phpixie-3.2 | 108.73| 639.6| 0.98| 2.7| +|aura-2.0 | 198.32| 1,166.6| 0.73| 2.0| +|cake-3.1 | 226.73| 1,333.7| 0.00| 0.0| +|symfony-2.7 | 120.97| 711.6| 0.00| 0.0| +|laravel-5.1 | 182.54| 1,073.8| 0.00| 0.0| +|zf-2.5 | 82.60| 485.9| 1.69| 4.6| +|typo3f-3.0 | 0.17| 1.0| 0.00| 0.0| +## HHVM CLI 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) + + +|framework |requests per second|relative|peak memory|relative| +|-------------------|------------------:|-------:|----------:|-------:| +|phalcon-2.0 | 544.20| 5,442.0| 0.00| 0.0| +|ice-1.0 | 596.84| 5,968.4| 0.00| 0.0| +|tipsy-0.10 | 104.15| 1,041.5| 0.04| 1.0| +|fatfree-3.5 | 109.40| 1,094.0| 0.07| 1.8| +|slim-2.6 | 64.33| 643.3| 0.04| 1.0| +|ci-3.0 | 24.78| 247.8| 0.05| 1.3| +|nofuss-1.2 | 91.14| 911.4| 0.05| 1.3| +|slim-3.0 | 28.95| 289.5| 0.07| 1.8| +|bear-1.0 | 0.23| 2.3| 0.11| 2.8| +|lumen-5.1 | 19.64| 196.4| 0.21| 5.3| +|ze-1.0 | 10.30| 103.0| 0.14| 3.5| +|radar-1.0-dev | 7.30| 73.0| 0.08| 2.0| +|yii-2.0 | 1.24| 12.4| 0.49| 12.4| +|silex-1.3 | 5.64| 56.4| 0.10| 2.5| +|cygnite-1.3 | 0.65| 6.5| 0.17| 4.3| +|fuel-1.8-dev | 6.06| 60.6| 0.12| 3.0| +|phpixie-3.2 | 0.19| 1.9| 0.27| 6.8| +|aura-2.0 | 5.67| 56.7| 0.16| 4.0| +|cake-3.1 | 0.28| 2.8| 0.16| 4.0| +|symfony-2.7 | 0.10| 1.0| 0.64| 16.2| +|laravel-5.1 | 0.33| 3.3| 0.00| 0.0| +|zf-2.5 | 0.14| 1.4| 0.58| 14.7| +|typo3f-3.0 | 0.17| 1.7| 0.00| 0.0| diff --git a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log index e34eb1990..9d30c96f0 100644 --- a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log +++ b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log @@ -1,19 +1,23 @@ -tipsy-0.10: 214.86: 41440: 0.008228: 18 -fatfree-3.5: 226.79: 74424: 0.005924: 9 -slim-2.6: 120.64: 45952: 0.009782: 24 -ci-3.0: 50.22: 48032: 0.029192: 26 -nofuss-1.2: 177.91: 47312: 0.007217: 6 -slim-3.0: 69.33: 73864: 0.024435: 56 -lumen-5.1: 108.27: 222768: 0.015289: 37 -ze-1.0: 57.80: 146744: 0.028795: 67 -radar-1.0-dev: 45.85: 87352: 0.030910: 73 -yii-2.0: 77.89: 512072: 0.015944: 49 -silex-1.3: 65.57: 101976: 0.022673: 64 -cygnite-1.3: 33.37: 175768: 0.047198: 70 -fuel-1.8-dev: 36.25: 123320: 0.042660: 54 -phpixie-3.2: 20.32: 286584: 0.076567: 164 -aura-2.0: 53.86: 166568: 0.032857: 68 -cake-3.1: 42.10: 170936: 0.043252: 84 -symfony-2.7: 23.23: 674344: 0.061641: 106 -zf-2.5: 16.68: 602648: 0.092867: 208 -typo3f-3.0: 10.50: : : +phalcon-2.0: 544.20: : : +ice-1.0: 596.84: : : +tipsy-0.10: 104.15: 41440: 0.008127: 18 +fatfree-3.5: 109.40: 74424: 0.052282: 9 +slim-2.6: 64.33: 45952: 0.110192: 24 +ci-3.0: 24.78: 48032: 0.029750: 26 +nofuss-1.2: 91.14: 47312: 0.007772: 6 +slim-3.0: 28.95: 73864: 0.023686: 56 +bear-1.0: 0.23: 119688: 0.145487: 98 +lumen-5.1: 19.64: 222768: 0.016555: 37 +ze-1.0: 10.30: 146744: 0.031079: 67 +radar-1.0-dev: 7.30: 87352: 0.059555: 73 +yii-2.0: 1.24: 512344: 0.082168: 49 +silex-1.3: 5.64: 102792: 0.054735: 64 +cygnite-1.3: 0.65: 175768: 0.174909: 70 +fuel-1.8-dev: 6.06: 123320: 0.050733: 54 +phpixie-3.2: 0.19: 286584: 0.098294: 164 +aura-2.0: 5.67: 166568: 0.036560: 68 +cake-3.1: 0.28: 170936: 0.041817: 84 +symfony-2.7: 0.10: 675160: 0.066494: 106 +laravel-5.1: 0.33: : : +zf-2.5: 0.14: 603176: 0.101500: 208 +typo3f-3.0: 0.17: : : diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index 896324e5e..2a806c9bc 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,23 +1,23 @@ -phalcon-2.0: 900.52: 284000: 0.009533: 5 -ice-1.0: 886.83: 276680: 0.002118: 4 -tipsy-0.10: 1247.81: 337464: 0.001201: 18 -fatfree-3.5: 596.53: 445608: 0.002086: 9 -slim-2.6: 929.21: 501296: 0.000886: 24 -ci-3.0: 121.91: 452408: 0.034529: 26 -nofuss-1.2: 383.68: 620432: 0.004703: 6 -slim-3.0: 616.10: 649672: 0.001381: 56 -bear-1.0: 219.58: 792728: 0.007820: 98 -lumen-5.1: 346.63: : : -ze-1.0: 280.52: 824496: 0.008403: 67 -radar-1.0-dev: 271.42: 740256: 0.005606: 73 -yii-2.0: 312.90: 1400440: 0.005621: 49 -silex-1.3: 322.96: : : -cygnite-1.3: 141.07: 780744: 0.019817: 70 -fuel-1.8-dev: 60.06: 731112: 0.053473: 55 -phpixie-3.2: 23.88: 1331088: 0.007039: 164 -aura-2.0: 134.19: 934240: 0.018275: 68 -cake-3.1: 162.97: : : -symfony-2.7: 67.06: : : -laravel-5.1: 112.99: : : -zf-2.5: 40.13: 3072104: 0.043973: 209 -typo3f-3.0: 0.30: : : +phalcon-2.0: 975.53: 283776: 0.001251: 5 +ice-1.0: 611.45: 276456: 0.001317: 4 +tipsy-0.10: 752.09: 337464: 0.000707: 18 +fatfree-3.5: 363.96: 445608: 0.001880: 9 +slim-2.6: 578.86: 501296: 0.000883: 24 +ci-3.0: 67.70: 452408: 0.064229: 26 +nofuss-1.2: 226.13: 620432: 0.004294: 6 +slim-3.0: 386.59: 649672: 0.001172: 56 +bear-1.0: 0.20: 792728: 0.018892: 98 +lumen-5.1: 178.44: : : +ze-1.0: 136.61: 824496: 0.005485: 67 +radar-1.0-dev: 153.33: 740256: 0.009210: 73 +yii-2.0: 252.91: 1400440: 0.004051: 49 +silex-1.3: 327.53: : : +cygnite-1.3: 72.30: 780744: 0.043982: 70 +fuel-1.8-dev: 21.44: 731112: 0.133750: 55 +phpixie-3.2: 24.92: 1331088: 0.009984: 164 +aura-2.0: 149.58: 934240: 0.014537: 68 +cake-3.1: 166.20: : : +symfony-2.7: 51.79: : : +laravel-5.1: 76.21: : : +zf-2.5: 32.31: 3072104: 0.039713: 209 +typo3f-3.0: 0.18: : : diff --git a/output/docker_nginx_php_7_0_0/results.hello_world.log b/output/docker_nginx_php_7_0_0/results.hello_world.log index c1370f2ff..164186629 100644 --- a/output/docker_nginx_php_7_0_0/results.hello_world.log +++ b/output/docker_nginx_php_7_0_0/results.hello_world.log @@ -1,20 +1,23 @@ -tipsy-0.10: 896.96: 387112: 0.001258: 18 -fatfree-3.5: 359.90: 456072: 0.003100: 9 -slim-2.6: 457.76: 507976: 0.000956: 24 -ci-3.0: 37.78: 399200: 0.071718: 26 -nofuss-1.2: 198.13: 696120: 0.014310: 6 -slim-3.0: 737.52: 606872: 0.000951: 56 -lumen-5.1: 453.18: : : -ze-1.0: 383.46: 701416: 0.004219: 67 -radar-1.0-dev: 392.29: 652144: 0.004078: 73 -yii-2.0: 526.52: 1045168: 0.002648: 49 -silex-1.3: 718.84: : : -cygnite-1.3: 183.64: 669056: 0.012864: 70 -fuel-1.8-dev: 75.33: 651536: 0.204399: 54 -phpixie-3.2: 148.18: 1022880: 0.005025: 159 -aura-2.0: 227.59: 770448: 0.006133: 68 -cake-3.1: 292.33: : : -symfony-2.7: 157.97: : : -laravel-5.1: 202.55: : : -zf-2.5: 91.57: 1766928: 0.016049: 209 -typo3f-3.0: 1.38: : : +phalcon-2.0: 1295.21: : : +ice-1.0: 1066.86: : : +tipsy-0.10: 727.06: 387112: 0.001016: 18 +fatfree-3.5: 405.82: 456072: 0.001699: 9 +slim-2.6: 677.22: 507976: 0.000566: 24 +ci-3.0: 77.41: 399200: 0.072517: 26 +nofuss-1.2: 275.86: 696120: 0.002886: 6 +slim-3.0: 616.27: 606872: 0.000727: 56 +bear-1.0: 69.47: : : +lumen-5.1: 310.64: : : +ze-1.0: 212.23: 701416: 0.012948: 67 +radar-1.0-dev: 196.84: 652144: 0.003725: 73 +yii-2.0: 274.29: 1045168: 0.002882: 49 +silex-1.3: 252.21: : : +cygnite-1.3: 65.33: 669056: 0.070915: 70 +fuel-1.8-dev: 31.17: 651536: 0.120565: 54 +phpixie-3.2: 108.73: 1022880: 0.005432: 159 +aura-2.0: 198.32: 770448: 0.007172: 68 +cake-3.1: 226.73: : : +symfony-2.7: 120.97: : : +laravel-5.1: 182.54: : : +zf-2.5: 82.60: 1766928: 0.019966: 209 +typo3f-3.0: 0.17: : : From d8abdcf6a867b2d5981716279b18230e362bd0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:59:35 +0200 Subject: [PATCH 29/43] Added script to run all benchmarks against all docker stacks --- docker/README.md | 6 ++---- docker/benchmark.sh | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100755 docker/benchmark.sh diff --git a/docker/README.md b/docker/README.md index bdcea7e1d..457946ebc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -45,11 +45,9 @@ Run the set-up script: # sh setup.sh ~~~ -Run benchmarks against each stack: +Run benchmarks against each docker stack: ~~~ -$ stack=docker_nginx_php_5_6_4 sh benchmark.sh -$ stack=docker_nginx_hhvm_3_10_1 sh benchmark.sh -$ stack=docker_nginx_php_7_0_0 sh benchmark.sh +$ docker/benchmark.sh ~~~ ### Check the results diff --git a/docker/benchmark.sh b/docker/benchmark.sh new file mode 100755 index 000000000..a3d754621 --- /dev/null +++ b/docker/benchmark.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +stack=docker_nginx_php_5_6_4 sh benchmark.sh +stack=docker_nginx_php_7_0_0 sh benchmark.sh +stack=docker_nginx_hhvm_3_10_1 sh benchmark.sh + +exit 0 From c342017c926cb9db2ca9df50aa7c8630d03297dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 12:59:52 +0200 Subject: [PATCH 30/43] Added note about source files for the used docker images --- docker/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index ea5996bde..b01ec2501 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,3 +1,5 @@ +# Note: The relevant Dockerfiles are available here: https://github.com/neam/docker-php-benchmark + # Shell to run benchmarks within shell: build: ./stack/php/shell From 0ddaf5a49afef5378a6bd0e70ad313b5c5585175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 13:06:13 +0200 Subject: [PATCH 31/43] Adjusted working directories for docker stack services --- docker/docker-compose.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b01ec2501..a27c056d6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -23,7 +23,7 @@ php_5_6_4: environment: stack: 'docker_nginx_php_5_6_4' php_framework_benchmark_path: /public - working_dir: '/repo' + working_dir: '/public' command: "/stack/php/run-php-fpm.sh" # HHVM 3.10.1 @@ -37,7 +37,7 @@ hhvm_3_10_1: environment: stack: 'docker_nginx_hhvm_3_10_1' php_framework_benchmark_path: /public - working_dir: '/repo' + working_dir: '/public' command: "/stack/php/run-hhvm.sh" # PHP 7.0.0 @@ -51,7 +51,7 @@ php_7_0_0: environment: stack: 'docker_nginx_php_7_0_0' php_framework_benchmark_path: /public - working_dir: '/repo' + working_dir: '/public' command: "/stack/php/run-php-fpm-7.sh" # Nginx configured to serve PHP 5.6.4 @@ -64,7 +64,7 @@ nginx_php_5_6_4: - ./stack/nginx/:/stack/nginx:rw ports: - "80" - working_dir: '/app' + working_dir: '/public' command: "/stack/nginx/run.sh" # Nginx configured to serve HHVM 3.10.1 @@ -77,7 +77,7 @@ nginx_hhvm_3_10_1: - ./stack/nginx/:/stack/nginx:rw ports: - "80" - working_dir: '/app' + working_dir: '/public' command: "/stack/nginx/run.sh" # Nginx configured to serve PHP 7.0.0 @@ -90,5 +90,5 @@ nginx_php_7_0_0: - ./stack/nginx/:/stack/nginx:rw ports: - "80" - working_dir: '/app' + working_dir: '/public' command: "/stack/nginx/run.sh" From 19d8bd7f22b6c309efb1c9091d0fa3ddd072107f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 13:44:39 +0200 Subject: [PATCH 32/43] Docker stacks use /php-framework-benchmark/ sub-directory as well --- benchmarks/hello_world.sh | 6 +++--- bin/docker-urls.sh | 6 +++--- docker/docker-compose.yml | 30 +++++++++++++++--------------- docker/stack/php/permissions.sh | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/benchmarks/hello_world.sh b/benchmarks/hello_world.sh index 13e46100d..a2499b883 100644 --- a/benchmarks/hello_world.sh +++ b/benchmarks/hello_world.sh @@ -13,13 +13,13 @@ if [ "$stack" = "local" ]; then base="http://127.0.0.1/php-framework-benchmark" fi if [ "$stack" = "docker_nginx_php_5_6_4" ]; then - base="http://nginx_php_5_6_4" + base="http://nginx_php_5_6_4/php-framework-benchmark" fi if [ "$stack" = "docker_nginx_hhvm_3_10_1" ]; then - base="http://nginx_hhvm_3_10_1" + base="http://nginx_hhvm_3_10_1/php-framework-benchmark" fi if [ "$stack" = "docker_nginx_php_7_0_0" ]; then - base="http://nginx_php_7_0_0" + base="http://nginx_php_7_0_0/php-framework-benchmark" fi output_dir="output/$stack" diff --git a/bin/docker-urls.sh b/bin/docker-urls.sh index 527b7f4c7..038817332 100755 --- a/bin/docker-urls.sh +++ b/bin/docker-urls.sh @@ -3,10 +3,10 @@ DIR=`dirname $0`; echo "PHP 5.6.4 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://') +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark" echo "HHVM 3.10.1 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://') +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark" echo "PHP 7.0.0 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://') +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark" exit 0 \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a27c056d6..b34db9b44 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -16,42 +16,42 @@ shell: php_5_6_4: image: neam/php-benchmark:ubuntu-15.04-fpm-5.6.4-hhvm-3.10.1-phalcon-2.0.9 volumes: - - ..:/public:rw + - ..:/public/php-framework-benchmark:rw - ./stack/php/:/stack/php:rw ports: - "9000" environment: stack: 'docker_nginx_php_5_6_4' - php_framework_benchmark_path: /public - working_dir: '/public' + php_framework_benchmark_path: /public/php-framework-benchmark + working_dir: '/public/php-framework-benchmark' command: "/stack/php/run-php-fpm.sh" # HHVM 3.10.1 hhvm_3_10_1: image: neam/php-benchmark:ubuntu-15.04-fpm-5.6.4-hhvm-3.10.1-phalcon-2.0.9 volumes: - - ..:/public:rw + - ..:/public/php-framework-benchmark:rw - ./stack/php/:/stack/php:rw ports: - "9000" environment: stack: 'docker_nginx_hhvm_3_10_1' - php_framework_benchmark_path: /public - working_dir: '/public' + php_framework_benchmark_path: /public/php-framework-benchmark + working_dir: '/public/php-framework-benchmark' command: "/stack/php/run-hhvm.sh" # PHP 7.0.0 php_7_0_0: image: neam/php-benchmark:ubuntu-15.04-fpm-7.0.0-hhvm-3.10.1-phalcon-2.0.9 volumes: - - ..:/public:rw + - ..:/public/php-framework-benchmark:rw - ./stack/php/:/stack/php:rw ports: - "9000" environment: stack: 'docker_nginx_php_7_0_0' - php_framework_benchmark_path: /public - working_dir: '/public' + php_framework_benchmark_path: /public/php-framework-benchmark + working_dir: '/public/php-framework-benchmark' command: "/stack/php/run-php-fpm-7.sh" # Nginx configured to serve PHP 5.6.4 @@ -60,11 +60,11 @@ nginx_php_5_6_4: links: - php_5_6_4:php volumes: - - ..:/public:rw + - ..:/public/php-framework-benchmark:rw - ./stack/nginx/:/stack/nginx:rw ports: - "80" - working_dir: '/public' + working_dir: '/public/php-framework-benchmark' command: "/stack/nginx/run.sh" # Nginx configured to serve HHVM 3.10.1 @@ -73,11 +73,11 @@ nginx_hhvm_3_10_1: links: - hhvm_3_10_1:php volumes: - - ..:/public:rw + - ..:/public/php-framework-benchmark:rw - ./stack/nginx/:/stack/nginx:rw ports: - "80" - working_dir: '/public' + working_dir: '/public/php-framework-benchmark' command: "/stack/nginx/run.sh" # Nginx configured to serve PHP 7.0.0 @@ -86,9 +86,9 @@ nginx_php_7_0_0: links: - php_7_0_0:php volumes: - - ..:/public:rw + - ..:/public/php-framework-benchmark:rw - ./stack/nginx/:/stack/nginx:rw ports: - "80" - working_dir: '/public' + working_dir: '/public/php-framework-benchmark' command: "/stack/nginx/run.sh" diff --git a/docker/stack/php/permissions.sh b/docker/stack/php/permissions.sh index feddaa0d7..f4bf88085 100755 --- a/docker/stack/php/permissions.sh +++ b/docker/stack/php/permissions.sh @@ -4,7 +4,7 @@ set -x # Work around permission errors locally by making sure that "www-data" uses the same uid and gid as the host volume -TARGET_UID=$(stat -c "%u" /public) +TARGET_UID=$(stat -c "%u" /public/php-framework-benchmark) usermod -o -u $TARGET_UID www-data -TARGET_GID=$(stat -c "%g" /public) +TARGET_GID=$(stat -c "%g" /public/php-framework-benchmark) groupmod -o -g $TARGET_GID www-data From b4d0e02419a8ff3f7943d8acd373609b417d7ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 13:47:46 +0200 Subject: [PATCH 33/43] Reversed changes that were made to support requests without the php-framework-benchmark sub-directory --- bear-1.0/var/www/index.php | 2 +- lumen-5.1/app/Http/routes.php | 4 ---- nofuss-1.2/cache/routes.all.php | 11 ++--------- nofuss-1.2/routes/web/_root.php | 9 --------- nofuss-1.2/routes/web/php-framework-benchmark.php | 2 +- phpixie-3.2/assets/config/http.php | 2 +- radar-1.0-dev/web/index.php | 7 +------ ze-1.0/config/autoload/routes.global.php | 8 +------- zf-2.5/public/index.php | 8 -------- 9 files changed, 7 insertions(+), 46 deletions(-) delete mode 100644 nofuss-1.2/routes/web/_root.php diff --git a/bear-1.0/var/www/index.php b/bear-1.0/var/www/index.php index 974a8ee4a..c764fdf9c 100644 --- a/bear-1.0/var/www/index.php +++ b/bear-1.0/var/www/index.php @@ -3,7 +3,7 @@ // Adhoc fix for benchmarking // Remove sub directories from URI $_SERVER['REQUEST_URI'] = preg_replace( - ['!/php-framework-benchmark/bear-1.0/var/www/index.php!', '!/bear-1.0/var/www/index.php!'], + '!/php-framework-benchmark/bear-1.0/var/www/index.php!', '', $_SERVER['REQUEST_URI'] ); diff --git a/lumen-5.1/app/Http/routes.php b/lumen-5.1/app/Http/routes.php index 6212eff3f..c9ec04e68 100644 --- a/lumen-5.1/app/Http/routes.php +++ b/lumen-5.1/app/Http/routes.php @@ -20,8 +20,4 @@ '/php-framework-benchmark/lumen-5.1/public/index.php/hello/index', 'HelloController@index' ); - $group->get( - '/lumen-5.1/public/index.php/hello/index', - 'HelloController@index' - ); }); diff --git a/nofuss-1.2/cache/routes.all.php b/nofuss-1.2/cache/routes.all.php index f246ea9e8..d300f6c79 100644 --- a/nofuss-1.2/cache/routes.all.php +++ b/nofuss-1.2/cache/routes.all.php @@ -4,17 +4,10 @@ array ( '*' => array ( - 'home-subdirectory' => - array ( - 'name' => 'home-subdirectory', - 'regexp' => 'php-framework-benchmark/nofuss-1.2/html/index.php/hello/index', - 'controller' => 'home/index/index', - 'inheritableRegexp' => 'nofuss-1.2/html/index.php/hello/index', - ), - 'home' => + 'home' => array ( 'name' => 'home', - 'regexp' => 'nofuss-1.2/html/index.php/hello/index', + 'regexp' => 'php-framework-benchmark/nofuss-1.2/html/index.php/hello/index', 'controller' => 'home/index/index', 'inheritableRegexp' => 'nofuss-1.2/html/index.php/hello/index', ), diff --git a/nofuss-1.2/routes/web/_root.php b/nofuss-1.2/routes/web/_root.php deleted file mode 100644 index aeb7b591d..000000000 --- a/nofuss-1.2/routes/web/_root.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -return array( - array( - 'name' => 'home', - 'regexp' => 'nofuss-1.2/html/index.php/hello/index', - 'controller' => 'home/index/index' - ) -); diff --git a/nofuss-1.2/routes/web/php-framework-benchmark.php b/nofuss-1.2/routes/web/php-framework-benchmark.php index a4c6710dc..aeb7b591d 100755 --- a/nofuss-1.2/routes/web/php-framework-benchmark.php +++ b/nofuss-1.2/routes/web/php-framework-benchmark.php @@ -2,7 +2,7 @@ return array( array( - 'name' => 'home-subdirectory', + 'name' => 'home', 'regexp' => 'nofuss-1.2/html/index.php/hello/index', 'controller' => 'home/index/index' ) diff --git a/phpixie-3.2/assets/config/http.php b/phpixie-3.2/assets/config/http.php index a4ad49aa0..4dd8be910 100644 --- a/phpixie-3.2/assets/config/http.php +++ b/phpixie-3.2/assets/config/http.php @@ -2,7 +2,7 @@ return array( 'translator' => array( - 'basePath' => (strpos($_SERVER['REQUEST_URI'], '/php-framework-benchmark') !== false ? '/php-framework-benchmark' : '') . '/phpixie-3.2/web/index.php/' + 'basePath' => '/php-framework-benchmark/phpixie-3.2/web/index.php/' ), 'resolver' => array( 'type' => 'pattern', diff --git a/radar-1.0-dev/web/index.php b/radar-1.0-dev/web/index.php index ae10a496b..9d29fb41c 100644 --- a/radar-1.0-dev/web/index.php +++ b/radar-1.0-dev/web/index.php @@ -30,14 +30,9 @@ /** * Routes */ -$adr->get( - 'Hello.Subdirectory', - '/php-framework-benchmark/radar-1.0-dev/web/index.php/hello/index', - 'Domain\Hello\HelloApplicationService' -); $adr->get( 'Hello', - '/radar-1.0-dev/web/index.php/hello/index', + '/php-framework-benchmark/radar-1.0-dev/web/index.php/hello/index', 'Domain\Hello\HelloApplicationService' ); diff --git a/ze-1.0/config/autoload/routes.global.php b/ze-1.0/config/autoload/routes.global.php index e6a231e64..13d630ce5 100644 --- a/ze-1.0/config/autoload/routes.global.php +++ b/ze-1.0/config/autoload/routes.global.php @@ -20,15 +20,9 @@ 'middleware' => App\Action\PingAction::class, 'allowed_methods' => ['GET'], ], - [ - 'name' => 'hello.subdirectory', - 'path' => '/php-framework-benchmark/ze-1.0/public/index.php/hello/index', - 'middleware' => App\Action\HelloAction::class, - 'allowed_methods' => ['GET'], - ], [ 'name' => 'hello', - 'path' => '/ze-1.0/public/index.php/hello/index', + 'path' => '/php-framework-benchmark/ze-1.0/public/index.php/hello/index', 'middleware' => App\Action\HelloAction::class, 'allowed_methods' => ['GET'], ], diff --git a/zf-2.5/public/index.php b/zf-2.5/public/index.php index b8b0aa594..7522ca27f 100644 --- a/zf-2.5/public/index.php +++ b/zf-2.5/public/index.php @@ -5,14 +5,6 @@ */ chdir(dirname(__DIR__)); -// Adhoc fix for benchmarking -// Remove sub directories from URI -$_SERVER['REQUEST_URI'] = preg_replace( - ['!/php-framework-benchmark/zf-2.5/public/index.php!', '!/zf-2.5/public/index.php!'], - '', - $_SERVER['REQUEST_URI'] -); - // Decline static file requests back to the PHP built-in webserver if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { return false; From 0f210a6f55cc403e46aafe6b415314f96bec834b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 13:54:58 +0200 Subject: [PATCH 34/43] Added docker results export script --- bin/docker-results.sh | 18 ++++++++++++++++++ docker/README.md | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 bin/docker-results.sh diff --git a/bin/docker-results.sh b/bin/docker-results.sh new file mode 100755 index 000000000..551829387 --- /dev/null +++ b/bin/docker-results.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +DIR=`dirname $0`; + +echo "## PHP-FPM 5.6.4 with opcode cache"; +echo +stack=docker_nginx_php_5_6_4 php $DIR/show_results_table.php +echo +echo "## PHP-FPM 7.0.0 with opcode cache"; +echo +stack=docker_nginx_php_7_0_0 php $DIR/show_results_table.php +echo +echo "## HHVM 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6)"; +echo +stack=docker_nginx_hhvm_3_10_1 php $DIR/show_results_table.php +echo + +exit 0 diff --git a/docker/README.md b/docker/README.md index 457946ebc..6183967d0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -52,7 +52,13 @@ $ docker/benchmark.sh ### Check the results -To see the results graph, run the following script from outside the docker shell, from the repository root: +To see the results tables in markdown, run the following from within the docker shell: + +~~~ +$ bin/docker-results.sh +~~~ + +To see the results graph, run the following script from **outside** the docker shell, from the repository root: ~~~ $ bin/docker-urls.sh From c41f14cbe636a57feac40dfd1c65473f79c8a925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 14:10:10 +0200 Subject: [PATCH 35/43] Zero out incomplete results and only allow valid results for enabled frameworks to affect the relative results --- libs/parse_results.php | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/libs/parse_results.php b/libs/parse_results.php index 88cc88bc2..ebc97eb57 100644 --- a/libs/parse_results.php +++ b/libs/parse_results.php @@ -12,6 +12,8 @@ function parse_results($file) $min_time = INF; $min_file = INF; + $frameworks = frameworks(); + foreach ($lines as $line) { $column = explode(':', $line); $fw = $column[0]; @@ -19,21 +21,40 @@ function parse_results($file) $memory = (float) trim($column[2])/1024/1024; $time = (float) trim($column[3])*1000; $file = (int) trim($column[4]); - - $min_rps = $rps > 0 ? min($min_rps, $rps) : $min_rps; - $min_memory = $memory > 0 ? min($min_memory, $memory) : $min_memory; - $min_time = $time > 0 ? min($min_time, $time) : $min_time; - $min_file = $file > 0 ? min($min_file, $file) : $min_file; - + + // Zero out incomplete results + if (empty($memory) || empty($time) || empty($file)) { + + $results[$fw] = [ + 'rps' => 0, + 'memory' => 0, + 'time' => 0, + 'file' => 0, + ]; + + // Prevent from affecting the relative results + continue; + + } + + // Only allow enabled frameworks to affect the relative results + if (array_search($fw, $frameworks)) { + + $min_rps = $rps > 0 ? min($min_rps, $rps) : $min_rps; + $min_memory = $memory > 0 ? min($min_memory, $memory) : $min_memory; + $min_time = $time > 0 ? min($min_time, $time) : $min_time; + $min_file = $file > 0 ? min($min_file, $file) : $min_file; + + } + $results[$fw] = [ 'rps' => $rps, 'memory' => round($memory, 2), 'time' => $time, 'file' => $file, ]; - } - $frameworks = frameworks(); + } $ordered_results = []; foreach ($frameworks as $fw) { From 22a0569145a1ba46294502324b25a470b4fd61ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 14:30:23 +0200 Subject: [PATCH 36/43] Updated docker stack results --- OTHER_RESULTS.md | 152 +++++++++--------- bin/docker-urls.sh | 8 +- index.php | 2 +- .../results.hello_world.log | 47 +++--- .../results.hello_world.log | 47 +++--- .../results.hello_world.log | 47 +++--- 6 files changed, 150 insertions(+), 153 deletions(-) diff --git a/OTHER_RESULTS.md b/OTHER_RESULTS.md index f7196ec7b..cd1c0b4c5 100644 --- a/OTHER_RESULTS.md +++ b/OTHER_RESULTS.md @@ -24,90 +24,84 @@ By sharing underlying software stacks, the benchmark results vary only according ## PHP-FPM 5.6.4 with opcode cache - - |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| -|phalcon-2.0 | 975.53| 5,419.6| 0.27| 1.0| -|ice-1.0 | 611.45| 3,396.9| 0.26| 1.0| -|tipsy-0.10 | 752.09| 4,178.3| 0.32| 1.2| -|fatfree-3.5 | 363.96| 2,022.0| 0.42| 1.6| -|slim-2.6 | 578.86| 3,215.9| 0.48| 1.8| -|ci-3.0 | 67.70| 376.1| 0.43| 1.6| -|nofuss-1.2 | 226.13| 1,256.3| 0.59| 2.2| -|slim-3.0 | 386.59| 2,147.7| 0.62| 2.4| -|bear-1.0 | 0.20| 1.1| 0.76| 2.9| -|lumen-5.1 | 178.44| 991.3| 0.00| 0.0| -|ze-1.0 | 136.61| 758.9| 0.79| 3.0| -|radar-1.0-dev | 153.33| 851.8| 0.71| 2.7| -|yii-2.0 | 252.91| 1,405.1| 1.34| 5.1| -|silex-1.3 | 327.53| 1,819.6| 0.00| 0.0| -|cygnite-1.3 | 72.30| 401.7| 0.74| 2.8| -|fuel-1.8-dev | 21.44| 119.1| 0.70| 2.7| -|phpixie-3.2 | 24.92| 138.4| 1.27| 4.8| -|aura-2.0 | 149.58| 831.0| 0.89| 3.4| -|cake-3.1 | 166.20| 923.3| 0.00| 0.0| -|symfony-2.7 | 51.79| 287.7| 0.00| 0.0| -|laravel-5.1 | 76.21| 423.4| 0.00| 0.0| -|zf-2.5 | 32.31| 179.5| 2.93| 11.1| -|typo3f-3.0 | 0.18| 1.0| 0.00| 0.0| - -## PHP CLI 7.0.0 with opcode cache - - +|phalcon-2.0 | 965.16| 53.7| 0.27| 1.0| +|ice-1.0 | 887.56| 49.4| 0.26| 1.0| +|tipsy-0.10 | 1,186.60| 66.0| 0.32| 1.2| +|fatfree-3.5 | 549.20| 30.5| 0.43| 1.6| +|slim-2.6 | 839.07| 46.7| 0.48| 1.8| +|ci-3.0 | 114.04| 6.3| 0.43| 1.6| +|nofuss-1.2 | 282.49| 15.7| 0.59| 2.2| +|slim-3.0 | 578.63| 32.2| 0.62| 2.3| +|bear-1.0 | 50.19| 2.8| 0.77| 2.9| +|lumen-5.1 | 0.00| 0.0| 0.00| 0.0| +|ze-1.0 | 270.54| 15.0| 0.80| 3.0| +|radar-1.0-dev | 271.33| 15.1| 0.71| 2.7| +|yii-2.0 | 316.65| 17.6| 1.36| 5.1| +|silex-1.3 | 0.00| 0.0| 0.00| 0.0| +|cygnite-1.3 | 129.65| 7.2| 0.76| 2.9| +|fuel-1.8-dev | 56.63| 3.1| 0.71| 2.7| +|phpixie-3.2 | 82.51| 4.6| 1.30| 4.9| +|aura-2.0 | 139.26| 7.7| 0.90| 3.4| +|cake-3.1 | 0.00| 0.0| 0.00| 0.0| +|symfony-2.7 | 0.00| 0.0| 0.00| 0.0| +|laravel-5.1 | 0.00| 0.0| 0.00| 0.0| +|zf-2.5 | 17.98| 1.0| 3.22| 12.2| +|typo3f-3.0 | 0.00| 0.0| 0.00| 0.0| + +## PHP-FPM 7.0.0 with opcode cache |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| -|phalcon-2.0 | 1,295.21| 7,618.9| 0.00| 0.0| -|ice-1.0 | 1,066.86| 6,275.6| 0.00| 0.0| -|tipsy-0.10 | 727.06| 4,276.8| 0.37| 1.0| -|fatfree-3.5 | 405.82| 2,387.2| 0.43| 1.2| -|slim-2.6 | 677.22| 3,983.6| 0.48| 1.3| -|ci-3.0 | 77.41| 455.4| 0.38| 1.0| -|nofuss-1.2 | 275.86| 1,622.7| 0.66| 1.8| -|slim-3.0 | 616.27| 3,625.1| 0.58| 1.6| -|bear-1.0 | 69.47| 408.6| 0.00| 0.0| -|lumen-5.1 | 310.64| 1,827.3| 0.00| 0.0| -|ze-1.0 | 212.23| 1,248.4| 0.67| 1.8| -|radar-1.0-dev | 196.84| 1,157.9| 0.62| 1.7| -|yii-2.0 | 274.29| 1,613.5| 1.00| 2.7| -|silex-1.3 | 252.21| 1,483.6| 0.00| 0.0| -|cygnite-1.3 | 65.33| 384.3| 0.64| 1.7| -|fuel-1.8-dev | 31.17| 183.4| 0.62| 1.7| -|phpixie-3.2 | 108.73| 639.6| 0.98| 2.7| -|aura-2.0 | 198.32| 1,166.6| 0.73| 2.0| -|cake-3.1 | 226.73| 1,333.7| 0.00| 0.0| -|symfony-2.7 | 120.97| 711.6| 0.00| 0.0| -|laravel-5.1 | 182.54| 1,073.8| 0.00| 0.0| -|zf-2.5 | 82.60| 485.9| 1.69| 4.6| -|typo3f-3.0 | 0.17| 1.0| 0.00| 0.0| - -## HHVM CLI 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) - - +|phalcon-2.0 | 0.00| 0.0| 0.00| 0.0| +|ice-1.0 | 0.00| 0.0| 0.00| 0.0| +|tipsy-0.10 | 1,497.81| 35.7| 0.37| 1.0| +|fatfree-3.5 | 664.94| 15.9| 0.44| 1.2| +|slim-2.6 | 1,174.32| 28.0| 0.49| 1.3| +|ci-3.0 | 120.21| 2.9| 0.38| 1.0| +|nofuss-1.2 | 332.31| 7.9| 0.66| 1.8| +|slim-3.0 | 907.03| 21.6| 0.58| 1.6| +|bear-1.0 | 0.00| 0.0| 0.00| 0.0| +|lumen-5.1 | 0.00| 0.0| 0.00| 0.0| +|ze-1.0 | 407.75| 9.7| 0.68| 1.8| +|radar-1.0-dev | 395.55| 9.4| 0.62| 1.7| +|yii-2.0 | 497.33| 11.9| 1.02| 2.8| +|silex-1.3 | 0.00| 0.0| 0.00| 0.0| +|cygnite-1.3 | 169.69| 4.0| 0.65| 1.8| +|fuel-1.8-dev | 69.26| 1.7| 0.63| 1.7| +|phpixie-3.2 | 158.76| 3.8| 1.01| 2.7| +|aura-2.0 | 202.28| 4.8| 0.74| 2.0| +|cake-3.1 | 0.00| 0.0| 0.00| 0.0| +|symfony-2.7 | 0.00| 0.0| 0.00| 0.0| +|laravel-5.1 | 0.00| 0.0| 0.00| 0.0| +|zf-2.5 | 41.94| 1.0| 1.88| 5.1| +|typo3f-3.0 | 0.00| 0.0| 0.00| 0.0| + +## HHVM 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| -|phalcon-2.0 | 544.20| 5,442.0| 0.00| 0.0| -|ice-1.0 | 596.84| 5,968.4| 0.00| 0.0| -|tipsy-0.10 | 104.15| 1,041.5| 0.04| 1.0| -|fatfree-3.5 | 109.40| 1,094.0| 0.07| 1.8| -|slim-2.6 | 64.33| 643.3| 0.04| 1.0| -|ci-3.0 | 24.78| 247.8| 0.05| 1.3| -|nofuss-1.2 | 91.14| 911.4| 0.05| 1.3| -|slim-3.0 | 28.95| 289.5| 0.07| 1.8| -|bear-1.0 | 0.23| 2.3| 0.11| 2.8| -|lumen-5.1 | 19.64| 196.4| 0.21| 5.3| -|ze-1.0 | 10.30| 103.0| 0.14| 3.5| -|radar-1.0-dev | 7.30| 73.0| 0.08| 2.0| -|yii-2.0 | 1.24| 12.4| 0.49| 12.4| -|silex-1.3 | 5.64| 56.4| 0.10| 2.5| -|cygnite-1.3 | 0.65| 6.5| 0.17| 4.3| -|fuel-1.8-dev | 6.06| 60.6| 0.12| 3.0| -|phpixie-3.2 | 0.19| 1.9| 0.27| 6.8| -|aura-2.0 | 5.67| 56.7| 0.16| 4.0| -|cake-3.1 | 0.28| 2.8| 0.16| 4.0| -|symfony-2.7 | 0.10| 1.0| 0.64| 16.2| -|laravel-5.1 | 0.33| 3.3| 0.00| 0.0| -|zf-2.5 | 0.14| 1.4| 0.58| 14.7| -|typo3f-3.0 | 0.17| 1.7| 0.00| 0.0| +|phalcon-2.0 | 0.00| 0.0| 0.00| 0.0| +|ice-1.0 | 0.00| 0.0| 0.00| 0.0| +|tipsy-0.10 | 180.92| 1,292.3| 0.04| 1.0| +|fatfree-3.5 | 200.91| 1,435.1| 0.07| 1.7| +|slim-2.6 | 124.64| 890.3| 0.05| 1.2| +|ci-3.0 | 41.37| 295.5| 0.05| 1.2| +|nofuss-1.2 | 156.60| 1,118.6| 0.05| 1.2| +|slim-3.0 | 38.04| 271.7| 0.07| 1.7| +|bear-1.0 | 0.22| 1.6| 0.13| 3.2| +|lumen-5.1 | 47.54| 339.6| 0.24| 5.9| +|ze-1.0 | 20.85| 148.9| 0.16| 4.0| +|radar-1.0-dev | 22.95| 163.9| 0.09| 2.2| +|yii-2.0 | 31.43| 224.5| 0.51| 12.6| +|silex-1.3 | 26.85| 191.8| 0.11| 2.7| +|cygnite-1.3 | 10.27| 73.4| 0.18| 4.4| +|fuel-1.8-dev | 14.93| 106.6| 0.13| 3.2| +|phpixie-3.2 | 0.21| 1.5| 0.31| 7.7| +|aura-2.0 | 21.55| 153.9| 0.17| 4.2| +|cake-3.1 | 4.95| 35.4| 0.18| 4.4| +|symfony-2.7 | 0.16| 1.1| 0.72| 17.8| +|laravel-5.1 | 0.00| 0.0| 0.00| 0.0| +|zf-2.5 | 0.14| 1.0| 0.66| 16.3| +|typo3f-3.0 | 0.00| 0.0| 0.00| 0.0| diff --git a/bin/docker-urls.sh b/bin/docker-urls.sh index 038817332..8cc1974ef 100755 --- a/bin/docker-urls.sh +++ b/bin/docker-urls.sh @@ -3,10 +3,10 @@ DIR=`dirname $0`; echo "PHP 5.6.4 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark" -echo "HHVM 3.10.1 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark" +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/" echo "PHP 7.0.0 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark" +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/" +echo "HHVM 3.10.1 Stack:"; +echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/" exit 0 \ No newline at end of file diff --git a/index.php b/index.php index 65de74c12..ebed9b4e9 100644 --- a/index.php +++ b/index.php @@ -35,7 +35,7 @@ } } -$max_rps = 2300; +$max_rps = 3000; $max_memory = 3; $max_time = 500; $max_file = 300; diff --git a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log index 9d30c96f0..d1a3492e8 100644 --- a/output/docker_nginx_hhvm_3_10_1/results.hello_world.log +++ b/output/docker_nginx_hhvm_3_10_1/results.hello_world.log @@ -1,23 +1,24 @@ -phalcon-2.0: 544.20: : : -ice-1.0: 596.84: : : -tipsy-0.10: 104.15: 41440: 0.008127: 18 -fatfree-3.5: 109.40: 74424: 0.052282: 9 -slim-2.6: 64.33: 45952: 0.110192: 24 -ci-3.0: 24.78: 48032: 0.029750: 26 -nofuss-1.2: 91.14: 47312: 0.007772: 6 -slim-3.0: 28.95: 73864: 0.023686: 56 -bear-1.0: 0.23: 119688: 0.145487: 98 -lumen-5.1: 19.64: 222768: 0.016555: 37 -ze-1.0: 10.30: 146744: 0.031079: 67 -radar-1.0-dev: 7.30: 87352: 0.059555: 73 -yii-2.0: 1.24: 512344: 0.082168: 49 -silex-1.3: 5.64: 102792: 0.054735: 64 -cygnite-1.3: 0.65: 175768: 0.174909: 70 -fuel-1.8-dev: 6.06: 123320: 0.050733: 54 -phpixie-3.2: 0.19: 286584: 0.098294: 164 -aura-2.0: 5.67: 166568: 0.036560: 68 -cake-3.1: 0.28: 170936: 0.041817: 84 -symfony-2.7: 0.10: 675160: 0.066494: 106 -laravel-5.1: 0.33: : : -zf-2.5: 0.14: 603176: 0.101500: 208 -typo3f-3.0: 0.17: : : +no-framework: 1205.32: 32048: 0.002414: 1 +phalcon-2.0: 964.93: : : +ice-1.0: 1008.56: : : +tipsy-0.10: 180.92: 42448: 0.011267: 18 +fatfree-3.5: 200.91: 75896: 0.008017: 9 +slim-2.6: 124.64: 47376: 0.008052: 24 +ci-3.0: 41.37: 49104: 0.029595: 26 +nofuss-1.2: 156.60: 47984: 0.009850: 6 +slim-3.0: 38.04: 78024: 0.021763: 56 +bear-1.0: 0.22: 133064: 0.040398: 98 +lumen-5.1: 47.54: 256848: 0.013870: 37 +ze-1.0: 20.85: 164336: 0.027278: 67 +radar-1.0-dev: 22.95: 92312: 0.032300: 73 +yii-2.0: 31.43: 538008: 0.020172: 49 +silex-1.3: 26.85: 115256: 0.027681: 64 +cygnite-1.3: 10.27: 190056: 0.047878: 70 +fuel-1.8-dev: 14.93: 132424: 0.043295: 54 +phpixie-3.2: 0.21: 324800: 0.082325: 164 +aura-2.0: 21.55: 174888: 0.028607: 68 +cake-3.1: 4.95: 192776: 0.042986: 84 +symfony-2.7: 0.16: 756680: 0.060777: 106 +laravel-5.1: 0.59: : : +zf-2.5: 0.14: 692056: 0.093432: 208 +typo3f-3.0: 0.18: : : diff --git a/output/docker_nginx_php_5_6_4/results.hello_world.log b/output/docker_nginx_php_5_6_4/results.hello_world.log index 2a806c9bc..b05510e3b 100644 --- a/output/docker_nginx_php_5_6_4/results.hello_world.log +++ b/output/docker_nginx_php_5_6_4/results.hello_world.log @@ -1,23 +1,24 @@ -phalcon-2.0: 975.53: 283776: 0.001251: 5 -ice-1.0: 611.45: 276456: 0.001317: 4 -tipsy-0.10: 752.09: 337464: 0.000707: 18 -fatfree-3.5: 363.96: 445608: 0.001880: 9 -slim-2.6: 578.86: 501296: 0.000883: 24 -ci-3.0: 67.70: 452408: 0.064229: 26 -nofuss-1.2: 226.13: 620432: 0.004294: 6 -slim-3.0: 386.59: 649672: 0.001172: 56 -bear-1.0: 0.20: 792728: 0.018892: 98 -lumen-5.1: 178.44: : : -ze-1.0: 136.61: 824496: 0.005485: 67 -radar-1.0-dev: 153.33: 740256: 0.009210: 73 -yii-2.0: 252.91: 1400440: 0.004051: 49 -silex-1.3: 327.53: : : -cygnite-1.3: 72.30: 780744: 0.043982: 70 -fuel-1.8-dev: 21.44: 731112: 0.133750: 55 -phpixie-3.2: 24.92: 1331088: 0.009984: 164 -aura-2.0: 149.58: 934240: 0.014537: 68 -cake-3.1: 166.20: : : -symfony-2.7: 51.79: : : -laravel-5.1: 76.21: : : -zf-2.5: 32.31: 3072104: 0.039713: 209 -typo3f-3.0: 0.18: : : +no-framework: 2383.49: 235880: 0.000233: 1 +phalcon-2.0: 965.16: 284616: 0.001392: 5 +ice-1.0: 887.56: 277160: 0.001462: 4 +tipsy-0.10: 1186.60: 338904: 0.000574: 18 +fatfree-3.5: 549.20: 447440: 0.002262: 9 +slim-2.6: 839.07: 503176: 0.001056: 24 +ci-3.0: 114.04: 453904: 0.031100: 26 +nofuss-1.2: 282.49: 620496: 0.006243: 6 +slim-3.0: 578.63: 653440: 0.001141: 56 +bear-1.0: 50.19: 805232: 0.004470: 98 +lumen-5.1: 311.50: : : +ze-1.0: 270.54: 837576: 0.006913: 67 +radar-1.0-dev: 271.33: 743288: 0.013237: 73 +yii-2.0: 316.65: 1424640: 0.005067: 49 +silex-1.3: 374.50: : : +cygnite-1.3: 129.65: 793256: 0.017212: 70 +fuel-1.8-dev: 56.63: 740656: 0.061522: 55 +phpixie-3.2: 82.51: 1364776: 0.010931: 164 +aura-2.0: 139.26: 941408: 0.018264: 68 +cake-3.1: 151.16: : : +symfony-2.7: 59.80: : : +laravel-5.1: 101.94: : : +zf-2.5: 17.98: 3379704: 0.063729: 230 +typo3f-3.0: 0.19: : : diff --git a/output/docker_nginx_php_7_0_0/results.hello_world.log b/output/docker_nginx_php_7_0_0/results.hello_world.log index 164186629..6ea10b5db 100644 --- a/output/docker_nginx_php_7_0_0/results.hello_world.log +++ b/output/docker_nginx_php_7_0_0/results.hello_world.log @@ -1,23 +1,24 @@ -phalcon-2.0: 1295.21: : : -ice-1.0: 1066.86: : : -tipsy-0.10: 727.06: 387112: 0.001016: 18 -fatfree-3.5: 405.82: 456072: 0.001699: 9 -slim-2.6: 677.22: 507976: 0.000566: 24 -ci-3.0: 77.41: 399200: 0.072517: 26 -nofuss-1.2: 275.86: 696120: 0.002886: 6 -slim-3.0: 616.27: 606872: 0.000727: 56 -bear-1.0: 69.47: : : -lumen-5.1: 310.64: : : -ze-1.0: 212.23: 701416: 0.012948: 67 -radar-1.0-dev: 196.84: 652144: 0.003725: 73 -yii-2.0: 274.29: 1045168: 0.002882: 49 -silex-1.3: 252.21: : : -cygnite-1.3: 65.33: 669056: 0.070915: 70 -fuel-1.8-dev: 31.17: 651536: 0.120565: 54 -phpixie-3.2: 108.73: 1022880: 0.005432: 159 -aura-2.0: 198.32: 770448: 0.007172: 68 -cake-3.1: 226.73: : : -symfony-2.7: 120.97: : : -laravel-5.1: 182.54: : : -zf-2.5: 82.60: 1766928: 0.019966: 209 -typo3f-3.0: 0.17: : : +no-framework: 2535.15: 357640: 0.000296: 1 +phalcon-2.0: 1658.02: : : +ice-1.0: 1537.96: : : +tipsy-0.10: 1497.81: 387992: 0.000862: 18 +fatfree-3.5: 664.94: 457544: 0.001571: 9 +slim-2.6: 1174.32: 509064: 0.000574: 24 +ci-3.0: 120.21: 400048: 0.032637: 26 +nofuss-1.2: 332.31: 696736: 0.005861: 6 +slim-3.0: 907.03: 609320: 0.000836: 56 +bear-1.0: 6.59: : : +lumen-5.1: 449.65: : : +ze-1.0: 407.75: 717592: 0.004674: 67 +radar-1.0-dev: 395.55: 654080: 0.003226: 73 +yii-2.0: 497.33: 1071088: 0.002630: 49 +silex-1.3: 627.22: : : +cygnite-1.3: 169.69: 680392: 0.012109: 70 +fuel-1.8-dev: 69.26: 660384: 0.053142: 54 +phpixie-3.2: 158.76: 1056824: 0.006401: 159 +aura-2.0: 202.28: 776256: 0.008273: 68 +cake-3.1: 235.30: : : +symfony-2.7: 128.59: : : +laravel-5.1: 179.46: : : +zf-2.5: 41.94: 1975456: 0.025934: 230 +typo3f-3.0: 0.20: : : From 84842c3f0655da43452b6d0a9b90eb354f82838c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 14:47:10 +0200 Subject: [PATCH 37/43] Moved parameters for cross-stack graph consistency to query string --- bin/docker-urls.sh | 18 +++++++++++++++--- index.php | 9 +++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/bin/docker-urls.sh b/bin/docker-urls.sh index 8cc1974ef..4029b8a37 100755 --- a/bin/docker-urls.sh +++ b/bin/docker-urls.sh @@ -2,11 +2,23 @@ DIR=`dirname $0`; +# Adjust to be able to compare the graphs across the stacks +query_string="max_rps=2800&max_memory=3&max_time=500&max_file=300" + +php_5_6_4_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" +php_7_0_0_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" +hhvm_3_10_1_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" + echo "PHP 5.6.4 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/" +echo "$php_5_6_4_url" echo "PHP 7.0.0 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/" +echo "$php_7_0_0_url" echo "HHVM 3.10.1 Stack:"; -echo "http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/" +echo "$hhvm_3_10_1_url" +echo +echo "Run to open the URLs in your browser:" +echo "open '$php_5_6_4_url'" +echo "open '$php_7_0_0_url'" +echo "open '$hhvm_3_10_1_url'" exit 0 \ No newline at end of file diff --git a/index.php b/index.php index ebed9b4e9..17a238f17 100644 --- a/index.php +++ b/index.php @@ -35,10 +35,11 @@ } } -$max_rps = 3000; -$max_memory = 3; -$max_time = 500; -$max_file = 300; +// Axis/scale settings +$max_rps = isset($_GET['max_rps']) ? $_GET['max_rps'] : null; +$max_memory = isset($_GET['max_memory']) ? $_GET['max_memory'] : null; +$max_time = isset($_GET['max_time']) ? $_GET['max_time'] : null; +$max_file = isset($_GET['max_file']) ? $_GET['max_file'] : null; // RPS Benchmark list($chart_rpm, $div_rpm) = make_graph('rps', 'Throughput', 'requests per second', $max_rps); From e720dd142933fed0ffe3247bce6874fa5d900668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Thu, 10 Dec 2015 15:54:22 +0200 Subject: [PATCH 38/43] Including graphs to current results (including "no-framework") --- OTHER_RESULTS.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/OTHER_RESULTS.md b/OTHER_RESULTS.md index cd1c0b4c5..55988d74f 100644 --- a/OTHER_RESULTS.md +++ b/OTHER_RESULTS.md @@ -22,7 +22,11 @@ Running on a MacBook Pro (Retina, 15-inch, Mid 2014). By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. -## PHP-FPM 5.6.4 with opcode cache +Note: Frameworks that were currently not reporting complete benchmark results are zeroed out in the graphs + +#### PHP-FPM 5.6.4 with opcode cache + +<img width="1002" alt="php_framework_benchmark" src="https://cloud.githubusercontent.com/assets/793037/11716938/cf4d6c5e-9f55-11e5-90f3-c177a0f6f35c.png"> |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| @@ -50,7 +54,9 @@ By sharing underlying software stacks, the benchmark results vary only according |zf-2.5 | 17.98| 1.0| 3.22| 12.2| |typo3f-3.0 | 0.00| 0.0| 0.00| 0.0| -## PHP-FPM 7.0.0 with opcode cache +#### PHP-FPM 7.0.0 with opcode cache + +<img width="1002" alt="php_framework_benchmark" src="https://cloud.githubusercontent.com/assets/793037/11716920/c005b09e-9f55-11e5-8cb3-b932a435e725.png"> |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| @@ -78,7 +84,9 @@ By sharing underlying software stacks, the benchmark results vary only according |zf-2.5 | 41.94| 1.0| 1.88| 5.1| |typo3f-3.0 | 0.00| 0.0| 0.00| 0.0| -## HHVM 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) +#### HHVM 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6) + +<img width="1002" alt="php_framework_benchmark" src="https://cloud.githubusercontent.com/assets/793037/11716924/c83b4724-9f55-11e5-9a3f-a5cf7abf23e4.png"> |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| From e17124216ee40e7c69302def8cc55a5f954e54ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Fri, 11 Dec 2015 09:09:28 +0200 Subject: [PATCH 39/43] Moved docker-related shell scripts to docker/bin/ --- docker/README.md | 6 +++--- docker/{ => bin}/benchmark.sh | 0 bin/docker-results.sh => docker/bin/results.sh | 6 +++--- bin/docker-urls.sh => docker/bin/urls.sh | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename docker/{ => bin}/benchmark.sh (100%) rename bin/docker-results.sh => docker/bin/results.sh (52%) rename bin/docker-urls.sh => docker/bin/urls.sh (62%) diff --git a/docker/README.md b/docker/README.md index 6183967d0..17a4add71 100644 --- a/docker/README.md +++ b/docker/README.md @@ -47,7 +47,7 @@ Run the set-up script: Run benchmarks against each docker stack: ~~~ -$ docker/benchmark.sh +$ docker/bin/benchmark.sh ~~~ ### Check the results @@ -55,13 +55,13 @@ $ docker/benchmark.sh To see the results tables in markdown, run the following from within the docker shell: ~~~ -$ bin/docker-results.sh +$ docker/bin/results.sh ~~~ To see the results graph, run the following script from **outside** the docker shell, from the repository root: ~~~ -$ bin/docker-urls.sh +$ docker/bin/urls.sh ~~~ It echoes URLs, which you should open up in your browser. diff --git a/docker/benchmark.sh b/docker/bin/benchmark.sh similarity index 100% rename from docker/benchmark.sh rename to docker/bin/benchmark.sh diff --git a/bin/docker-results.sh b/docker/bin/results.sh similarity index 52% rename from bin/docker-results.sh rename to docker/bin/results.sh index 551829387..53dc138c8 100755 --- a/bin/docker-results.sh +++ b/docker/bin/results.sh @@ -4,15 +4,15 @@ DIR=`dirname $0`; echo "## PHP-FPM 5.6.4 with opcode cache"; echo -stack=docker_nginx_php_5_6_4 php $DIR/show_results_table.php +stack=docker_nginx_php_5_6_4 php $DIR/../../bin/show_results_table.php echo echo "## PHP-FPM 7.0.0 with opcode cache"; echo -stack=docker_nginx_php_7_0_0 php $DIR/show_results_table.php +stack=docker_nginx_php_7_0_0 php $DIR/../../bin/show_results_table.php echo echo "## HHVM 3.10.1 (Corresponding roughly to an up-to-date PHP 5.6)"; echo -stack=docker_nginx_hhvm_3_10_1 php $DIR/show_results_table.php +stack=docker_nginx_hhvm_3_10_1 php $DIR/../../bin/show_results_table.php echo exit 0 diff --git a/bin/docker-urls.sh b/docker/bin/urls.sh similarity index 62% rename from bin/docker-urls.sh rename to docker/bin/urls.sh index 4029b8a37..b1cac6c12 100755 --- a/bin/docker-urls.sh +++ b/docker/bin/urls.sh @@ -5,9 +5,9 @@ DIR=`dirname $0`; # Adjust to be able to compare the graphs across the stacks query_string="max_rps=2800&max_memory=3&max_time=500&max_file=300" -php_5_6_4_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" -php_7_0_0_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" -hhvm_3_10_1_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker/docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" +php_5_6_4_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker-compose.yml port nginx_php_5_6_4 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" +php_7_0_0_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker-compose.yml port nginx_php_7_0_0 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" +hhvm_3_10_1_url="http://"$(docker-machine ip default)":"$(docker-compose -f $DIR/../docker-compose.yml port nginx_hhvm_3_10_1 80 | sed 's/[0-9.]*://')"/php-framework-benchmark/?$query_string" echo "PHP 5.6.4 Stack:"; echo "$php_5_6_4_url" From 4e137a56c2bf0be9092f2d21a080302137dbb883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Fri, 11 Dec 2015 09:12:40 +0200 Subject: [PATCH 40/43] Reversed usage of php_framework_benchmark_path --- README.md | 1 - aura-2.0/web/index.php | 2 +- bear-0.10/bootstrap/contexts/prod.php | 2 +- bear-1.0/bootstrap/bootstrap.php | 2 +- cake-3.0/webroot/index.php | 2 +- cake-3.1/webroot/index.php | 2 +- ci-3.0/index.php | 2 +- cygnite-1.3/index.php | 2 +- docker/docker-compose.yml | 3 --- fatfree-3.5/index.php | 2 +- fuel-1.8-dev/public/index.php | 2 +- fuel-2.0-dev/public/index.php | 2 +- ice-1.0/public/index.php | 2 +- laravel-4.2/public/index.php | 2 +- laravel-5.0/public/index.php | 2 +- laravel-5.1/public/index.php | 2 +- lumen-5.0/public/index.php | 2 +- lumen-5.1/public/index.php | 2 +- no-framework/index.php | 2 +- nofuss-1.2/html/index.php | 4 ++-- phalcon-1.3/public/index.php | 2 +- phalcon-2.0/public/index.php | 2 +- phpixie-3.2/web/index.php | 2 +- radar-1.0-dev/web/index.php | 2 +- silex-1.2/web/index.php | 2 +- silex-1.3/web/index.php | 2 +- slim-2.6/index.php | 2 +- slim-3.0/index.php | 2 +- symfony-2.5/web/app.php | 2 +- symfony-2.6/web/app.php | 2 +- symfony-2.7/web/app.php | 2 +- tipsy-0.10/web/index.php | 2 +- yii-2.0/web/index.php | 2 +- ze-1.0/public/index.php | 2 +- zf-2.4/public/index.php | 2 +- zf-2.5/public/index.php | 2 +- 36 files changed, 35 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 6111c93c5..6a29d5c9d 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,6 @@ If you want to see current configuration, run `sudo sysctl -a`. ~~~ <VirtualHost *:80> DocumentRoot /home/vagrant/public - SetEnv php_framework_benchmark_path /home/vagrant/public/php-framework-benchmark </VirtualHost> ~~~ diff --git a/aura-2.0/web/index.php b/aura-2.0/web/index.php index f6bbdce5a..78a5551cf 100644 --- a/aura-2.0/web/index.php +++ b/aura-2.0/web/index.php @@ -16,4 +16,4 @@ ); $kernel(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/bear-0.10/bootstrap/contexts/prod.php b/bear-0.10/bootstrap/contexts/prod.php index f0abcd572..c8ed31fce 100644 --- a/bear-0.10/bootstrap/contexts/prod.php +++ b/bear-0.10/bootstrap/contexts/prod.php @@ -65,7 +65,7 @@ // OK: { $app->response->setResource($app->page)->render()->send(); - require getenv('php_framework_benchmark_path').'/libs/output_data.php'; + require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; exit(0); } diff --git a/bear-1.0/bootstrap/bootstrap.php b/bear-1.0/bootstrap/bootstrap.php index 678352a5b..1a43a7c62 100644 --- a/bear-1.0/bootstrap/bootstrap.php +++ b/bear-1.0/bootstrap/bootstrap.php @@ -31,7 +31,7 @@ // representation transfer $page()->transfer($app->responder, $_SERVER); - require getenv('php_framework_benchmark_path').'/libs/output_data.php'; + require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; exit(0); } catch (\Exception $e) { $app->error->handle($e, $request)->transfer(); diff --git a/cake-3.0/webroot/index.php b/cake-3.0/webroot/index.php index d64c65f60..19cef45a8 100644 --- a/cake-3.0/webroot/index.php +++ b/cake-3.0/webroot/index.php @@ -36,4 +36,4 @@ new Response() ); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/cake-3.1/webroot/index.php b/cake-3.1/webroot/index.php index d64c65f60..19cef45a8 100644 --- a/cake-3.1/webroot/index.php +++ b/cake-3.1/webroot/index.php @@ -36,4 +36,4 @@ new Response() ); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ci-3.0/index.php b/ci-3.0/index.php index 02b266370..86269334a 100755 --- a/ci-3.0/index.php +++ b/ci-3.0/index.php @@ -291,4 +291,4 @@ */ require_once BASEPATH.'core/CodeIgniter.php'; -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/cygnite-1.3/index.php b/cygnite-1.3/index.php index c7227615e..764eb6581 100644 --- a/cygnite-1.3/index.php +++ b/cygnite-1.3/index.php @@ -59,4 +59,4 @@ */ require_once CF_BOOTSTRAP.DS.'start'.EXT; -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b34db9b44..cedb5d355 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -22,7 +22,6 @@ php_5_6_4: - "9000" environment: stack: 'docker_nginx_php_5_6_4' - php_framework_benchmark_path: /public/php-framework-benchmark working_dir: '/public/php-framework-benchmark' command: "/stack/php/run-php-fpm.sh" @@ -36,7 +35,6 @@ hhvm_3_10_1: - "9000" environment: stack: 'docker_nginx_hhvm_3_10_1' - php_framework_benchmark_path: /public/php-framework-benchmark working_dir: '/public/php-framework-benchmark' command: "/stack/php/run-hhvm.sh" @@ -50,7 +48,6 @@ php_7_0_0: - "9000" environment: stack: 'docker_nginx_php_7_0_0' - php_framework_benchmark_path: /public/php-framework-benchmark working_dir: '/public/php-framework-benchmark' command: "/stack/php/run-php-fpm-7.sh" diff --git a/fatfree-3.5/index.php b/fatfree-3.5/index.php index 63adbd8b7..a0af1b1b2 100644 --- a/fatfree-3.5/index.php +++ b/fatfree-3.5/index.php @@ -9,4 +9,4 @@ $f3->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/fuel-1.8-dev/public/index.php b/fuel-1.8-dev/public/index.php index 6cb040bcb..c370280b5 100644 --- a/fuel-1.8-dev/public/index.php +++ b/fuel-1.8-dev/public/index.php @@ -101,4 +101,4 @@ class_alias('Fuel\\Core\\Autoloader', 'Autoloader'); $response->send(true); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/fuel-2.0-dev/public/index.php b/fuel-2.0-dev/public/index.php index 64a68f02f..dcf5e9e9c 100644 --- a/fuel-2.0-dev/public/index.php +++ b/fuel-2.0-dev/public/index.php @@ -159,4 +159,4 @@ echo $response; } -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ice-1.0/public/index.php b/ice-1.0/public/index.php index a5550d9b2..782bf0d11 100644 --- a/ice-1.0/public/index.php +++ b/ice-1.0/public/index.php @@ -13,4 +13,4 @@ echo $e->getMessage(); } -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/laravel-4.2/public/index.php b/laravel-4.2/public/index.php index 58d202bb2..d74006337 100644 --- a/laravel-4.2/public/index.php +++ b/laravel-4.2/public/index.php @@ -48,4 +48,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/laravel-5.0/public/index.php b/laravel-5.0/public/index.php index 1ef7e8de6..cb4732d5b 100644 --- a/laravel-5.0/public/index.php +++ b/laravel-5.0/public/index.php @@ -56,4 +56,4 @@ $kernel->terminate($request, $response); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/laravel-5.1/public/index.php b/laravel-5.1/public/index.php index 57d4255eb..b94d907c9 100644 --- a/laravel-5.1/public/index.php +++ b/laravel-5.1/public/index.php @@ -57,4 +57,4 @@ $kernel->terminate($request, $response); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/lumen-5.0/public/index.php b/lumen-5.0/public/index.php index 187d41560..743febbfa 100644 --- a/lumen-5.0/public/index.php +++ b/lumen-5.0/public/index.php @@ -27,4 +27,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/lumen-5.1/public/index.php b/lumen-5.1/public/index.php index 187d41560..743febbfa 100644 --- a/lumen-5.1/public/index.php +++ b/lumen-5.1/public/index.php @@ -27,4 +27,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/no-framework/index.php b/no-framework/index.php index 00a05fce4..6965db1db 100644 --- a/no-framework/index.php +++ b/no-framework/index.php @@ -2,4 +2,4 @@ echo 'Hello World!'; -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/nofuss-1.2/html/index.php b/nofuss-1.2/html/index.php index 03ca132a8..be3d06598 100755 --- a/nofuss-1.2/html/index.php +++ b/nofuss-1.2/html/index.php @@ -37,6 +37,6 @@ $bootstrap->go(); // The if statement is needed for setup.sh -if (getenv('php_framework_benchmark_path') !== '') { - require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +if ($_SERVER['DOCUMENT_ROOT'] !== '') { + require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; } diff --git a/phalcon-1.3/public/index.php b/phalcon-1.3/public/index.php index 812b17fcf..0692a1a0e 100644 --- a/phalcon-1.3/public/index.php +++ b/phalcon-1.3/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/phalcon-2.0/public/index.php b/phalcon-2.0/public/index.php index 812b17fcf..0692a1a0e 100644 --- a/phalcon-2.0/public/index.php +++ b/phalcon-2.0/public/index.php @@ -30,4 +30,4 @@ echo $e->getMessage(); } -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/phpixie-3.2/web/index.php b/phpixie-3.2/web/index.php index 2d971eb55..c26670e82 100644 --- a/phpixie-3.2/web/index.php +++ b/phpixie-3.2/web/index.php @@ -6,4 +6,4 @@ $framework->registerDebugHandlers(); $framework->processHttpSapiRequest(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/radar-1.0-dev/web/index.php b/radar-1.0-dev/web/index.php index 9d29fb41c..89f73f169 100644 --- a/radar-1.0-dev/web/index.php +++ b/radar-1.0-dev/web/index.php @@ -41,4 +41,4 @@ */ $adr->run(ServerRequestFactory::fromGlobals(), new Response()); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/silex-1.2/web/index.php b/silex-1.2/web/index.php index 555ffc58c..325c88efb 100644 --- a/silex-1.2/web/index.php +++ b/silex-1.2/web/index.php @@ -8,4 +8,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/silex-1.3/web/index.php b/silex-1.3/web/index.php index 555ffc58c..325c88efb 100644 --- a/silex-1.3/web/index.php +++ b/silex-1.3/web/index.php @@ -8,4 +8,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/slim-2.6/index.php b/slim-2.6/index.php index f8e0f578b..582160876 100644 --- a/slim-2.6/index.php +++ b/slim-2.6/index.php @@ -10,4 +10,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/slim-3.0/index.php b/slim-3.0/index.php index 1c181463b..d07cb7226 100644 --- a/slim-3.0/index.php +++ b/slim-3.0/index.php @@ -10,4 +10,4 @@ $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.5/web/app.php b/symfony-2.5/web/app.php index 9e56926ba..95518cfdc 100644 --- a/symfony-2.5/web/app.php +++ b/symfony-2.5/web/app.php @@ -28,4 +28,4 @@ $response->send(); $kernel->terminate($request, $response); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.6/web/app.php b/symfony-2.6/web/app.php index 656394a8e..090c587ea 100644 --- a/symfony-2.6/web/app.php +++ b/symfony-2.6/web/app.php @@ -29,4 +29,4 @@ $response->send(); $kernel->terminate($request, $response); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/symfony-2.7/web/app.php b/symfony-2.7/web/app.php index 656394a8e..090c587ea 100644 --- a/symfony-2.7/web/app.php +++ b/symfony-2.7/web/app.php @@ -29,4 +29,4 @@ $response->send(); $kernel->terminate($request, $response); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/tipsy-0.10/web/index.php b/tipsy-0.10/web/index.php index 1d0ab1678..fe37afb37 100644 --- a/tipsy-0.10/web/index.php +++ b/tipsy-0.10/web/index.php @@ -15,4 +15,4 @@ $t->start(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/yii-2.0/web/index.php b/yii-2.0/web/index.php index 6bf4a7e29..6dba3d685 100644 --- a/yii-2.0/web/index.php +++ b/yii-2.0/web/index.php @@ -11,4 +11,4 @@ (new yii\web\Application($config))->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/ze-1.0/public/index.php b/ze-1.0/public/index.php index 6d96cc873..c5139d8d7 100644 --- a/ze-1.0/public/index.php +++ b/ze-1.0/public/index.php @@ -17,4 +17,4 @@ $app = $container->get('Zend\Expressive\Application'); $app->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/zf-2.4/public/index.php b/zf-2.4/public/index.php index 7522ca27f..e47cc9c49 100644 --- a/zf-2.4/public/index.php +++ b/zf-2.4/public/index.php @@ -16,4 +16,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; diff --git a/zf-2.5/public/index.php b/zf-2.5/public/index.php index 7522ca27f..e47cc9c49 100644 --- a/zf-2.5/public/index.php +++ b/zf-2.5/public/index.php @@ -16,4 +16,4 @@ // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); -require getenv('php_framework_benchmark_path').'/libs/output_data.php'; +require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php'; From 98619493c0fb9cbdba57a9d50f7afe5b9c751fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Fri, 11 Dec 2015 09:15:09 +0200 Subject: [PATCH 41/43] Added docker-compose build command to readme to ensure that all dependencies are being installed --- docker/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/README.md b/docker/README.md index 17a4add71..b0faa0909 100644 --- a/docker/README.md +++ b/docker/README.md @@ -37,6 +37,7 @@ $ docker-compose up -d Start the supplied docker shell from within this repository's `docker` folder: ~~~ +$ docker-compose build shell $ docker-compose run shell ~~~ From d9af4aeef958377338ba780b6bc9b9ffc870cb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Fri, 11 Dec 2015 09:17:18 +0200 Subject: [PATCH 42/43] Removed docker stack info from main readme --- README.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/README.md b/README.md index 6a29d5c9d..1fb50e510 100644 --- a/README.md +++ b/README.md @@ -152,24 +152,6 @@ If you want to see current configuration, run `sudo sysctl -a`. </VirtualHost> ~~~ -## Benchmarking using the supplied Docker Stack - -Use the supplied Docker Stack in order to automatically set up the following benchmarking environments: - -* Ubuntu 15.04 64bit (Docker) - * Nginx 1.7.12 - * PHP-FPM 5.6.4 - * Zend OPcache 7.0.4-dev - * PhalconPHP 2.0.9 - * PHP-FPM 7.0.0 - * Zend OPcache 7.0.6-dev - * PhalconPHP 2.0.9 - * HHVM 3.10.1 - -By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations. - -See [docker/README.md](docker/README.md) - ## References * [Aura](http://auraphp.com/) ([@auraphp](https://twitter.com/auraphp)) From 1ebe534863ffa47342ce78dcb4e91db13c4e3941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= <fredrik@neam.se> Date: Fri, 11 Dec 2015 10:27:05 +0200 Subject: [PATCH 43/43] Updated show_fw_array.sh to use list.php directly --- bin/show_fw_array.sh | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/bin/show_fw_array.sh b/bin/show_fw_array.sh index b748b429a..a2f48a56a 100755 --- a/bin/show_fw_array.sh +++ b/bin/show_fw_array.sh @@ -3,17 +3,4 @@ cd `dirname $0` cd .. -# include framework list -. ./list.sh -targets="$list" - -echo '[' - -for fw in $targets -do - if [ -d "$fw" ]; then - echo "\t'$fw'," - fi -done - -echo ']' +php -r 'require("list.php"); var_export(frameworks());'