Skip to content

About PHP #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asadkn opened this issue Mar 28, 2013 · 7 comments
Closed

About PHP #1

asadkn opened this issue Mar 28, 2013 · 7 comments

Comments

@asadkn
Copy link

asadkn commented Mar 28, 2013

One thing you have to understand about PHP is nobody except the shared webhosts use the technologies you're using.

First of all, any serious PHP app should be using APC by default. It's the nature of how PHP works by default vs other language deployments. Second, use php-fpm + nginx web server (or at least worker mpm in Apache 2.4 with php-fpm or fastcgi).

@CHH
Copy link

CHH commented Mar 28, 2013

+1

@hassankhan
Copy link

And add Zend benchmarks too, please 😄

@Nazariy
Copy link

Nazariy commented Mar 29, 2013

I understand that purpose of this benchmark was to compare your library with other solutions, but I believe PHP was not tested fairly.

  1. 5.3 has reached end of life and 5.4 or 5.5 branch should be used instead. From my observation, applications on 5.4 perform much better and consume less memory comparing to 5.3 version, I have not tested 5.5 but it should not be worst than previous.
  2. PDO is a bit slower, as it has higher abstraction layer comparing to MySQLi, which is more suitable to be called RAW.
  3. It's important to state how do you run PHP on Apache server, as performance may vary, in my case DSO was 5 times faster than FastCGI.
  4. Why did you chose a CakePHP? It's cute but it is not that type of framework that can be considered as good choice for a serious project. Instead I would look in to Zend, Symfony or YII.

@onigoetz
Copy link

I also think the choice of cakePHP is very bad. it's quite well known that it's one of the slowest framework in the php world.

these benchmarks are not really recent but they give a good idea : http://symfony2.openthinklabs.com/home/cepat
(based on this code : https://github.com/fabpot/framework-benchs)

I also made a more up-to-date version : https://github.com/onigoetz/framework-benchs and found that codeIgniter is even faster.

I did not update these benchmarks for a long time but I think running them now would give more or less the same results.

I would also test Laravel 4 as I heard it is faster than codeIgniter

@alexbilbie
Copy link

+1

@TechEmpower
Copy link
Collaborator

Thanks for all the comments, we're currently looking into many of your suggestions. We're going to try both PHP 5.4 with APC and 5.5 with Zend optimizer, as well as use php-fpm on Apache (nginx will be next on the list). We're hoping to have updated results sometime next week.

@TechEmpower
Copy link
Collaborator

We're putting together the next round of numbers now, and we're going to be using PHP 5.4 with APC, php-fpm, and nginx. We're hoping to have updated results later this week.

We created some new issues to address the other recommendations.

pfalls1 pushed a commit that referenced this issue Apr 23, 2013
mirob2005 pushed a commit that referenced this issue Oct 12, 2013
msmith-techempower pushed a commit that referenced this issue Jan 16, 2014
mcocciaTE pushed a commit that referenced this issue Jun 12, 2014
msmith-techempower pushed a commit that referenced this issue Jun 4, 2015
Updated script to initialize Haywire properly to match the latest in the Haywire repository
msmith-techempower pushed a commit that referenced this issue Jun 12, 2015
ssmith-techempower pushed a commit that referenced this issue Mar 11, 2016
NateBrady23 pushed a commit that referenced this issue Jul 1, 2016
Merging latest commits from base repository
NateBrady23 pushed a commit that referenced this issue Aug 31, 2016
NateBrady23 pushed a commit that referenced this issue Feb 6, 2017
* correct with randomNumber is returned by 'update'

* Aiohttp faster (#1)

marginal performance improvements and cleanup

[ci fw-only Python/aiohttp]
NateBrady23 pushed a commit that referenced this issue Nov 4, 2017
* Setup GC Threads on Amber

* Setup GC threads on Kemal/Postgres

* Setup GC Threads on Kemal/Redis

* Setup GC Thread on Crystal server

* Remove GC_NPROCS

It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.

* Remove GC_NPROCS

It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.

* Remove GC_NPROCS

It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.

* Remove GC_NPROCS

It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.

* Minify HTML

* Minify HTML

* Remove extra variable

* Minify HTML

* Minify HTML

* Update amber dependencies

* Update shard.lock

* Remove env

* Add AMBER_ENV to enable production mode

* Format html view

* Format html view

* Format html view

* Format html view

* Ensure type is String

Convert type from (String | Nil) to String

* Change data to fortunes

* Defines amber pipeline

* Set production env (#1)

* Set production environments on Kemal and Amber

* Remove unnedded require
michaelhixson added a commit to michaelhixson/FrameworkBenchmarks that referenced this issue Jan 30, 2018
I think we are running into this problem:

  facebook/hhvm#8111

We don't solve that problem, but we avoid it by specifying utf8 in a
different fashion.  I also took the opportunity to use the "TFB-database"
hostname instead of the DBHOST environment variable because it's simpler
that way.

Here are the steps I took in a local TFB environment that make me think
we're running into the same issue as that GitHub issue:

 - Run toolset/run-tests.py --mode verify --test hvm, see that it fails
   all tests with error messages that look like the application server
   simply isn't there
 - Enable logging in PHP/hhvm/deploy/config.hdf (basically copy the
   "Log" section over from config-debug.hdf), run the test again
 - Look at the log file it spit out, PHP/hhvm/error.log, notice messages
   like this:

    Core dumped: Segmentation fault
    Stack trace in /tmp/stacktrace.28653.log

 - /tmp is cleared by the TFB toolset each run, so I comment out that
   part of benchmarker.py that clears /tmp
 - Run the test again, look at the stacktrace file in /tmp, notice a
   stack trace referring to our implementation code like this:

    #0  PDO->__construct() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:14]
    TechEmpower#1  Benchmark->setup_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:31]
    TechEmpower#2  Benchmark->bench_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:10]
    TechEmpower#3  main() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:13]

 - Google a bit, come across a GitHub issue talking about a similar
   problem when they used "SET NAMES"
 - Comment the part of PHP/hhvm/once.php.inc that uses SET NAMES, run
   test again and it worked, except for fortunes which failed because of
   character encoding problems
 - Google for a different way to specify utf8 in the PDO constructor,
   try it again, all tests pass locally
NateBrady23 pushed a commit that referenced this issue Jan 30, 2018
…3220)

I think we are running into this problem:

  facebook/hhvm#8111

We don't solve that problem, but we avoid it by specifying utf8 in a
different fashion.  I also took the opportunity to use the "TFB-database"
hostname instead of the DBHOST environment variable because it's simpler
that way.

Here are the steps I took in a local TFB environment that make me think
we're running into the same issue as that GitHub issue:

 - Run toolset/run-tests.py --mode verify --test hvm, see that it fails
   all tests with error messages that look like the application server
   simply isn't there
 - Enable logging in PHP/hhvm/deploy/config.hdf (basically copy the
   "Log" section over from config-debug.hdf), run the test again
 - Look at the log file it spit out, PHP/hhvm/error.log, notice messages
   like this:

    Core dumped: Segmentation fault
    Stack trace in /tmp/stacktrace.28653.log

 - /tmp is cleared by the TFB toolset each run, so I comment out that
   part of benchmarker.py that clears /tmp
 - Run the test again, look at the stacktrace file in /tmp, notice a
   stack trace referring to our implementation code like this:

    #0  PDO->__construct() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:14]
    #1  Benchmark->setup_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:31]
    #2  Benchmark->bench_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:10]
    #3  main() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:13]

 - Google a bit, come across a GitHub issue talking about a similar
   problem when they used "SET NAMES"
 - Comment the part of PHP/hhvm/once.php.inc that uses SET NAMES, run
   test again and it worked, except for fortunes which failed because of
   character encoding problems
 - Google for a different way to specify utf8 in the PDO constructor,
   try it again, all tests pass locally
michaelhixson added a commit to michaelhixson/FrameworkBenchmarks that referenced this issue Apr 23, 2018
Here's an example of the error output from before this change:

Unhandled exception:
Bad state: Stream was already listened to
#0      _RawServerSocket.listen (dart:io-patch/socket_patch.dart:1106)
TechEmpower#1      new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:123)
TechEmpower#2      _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:91)
TechEmpower#3      _ForwardingStream.listen (dart:async/stream_pipe.dart:86)
TechEmpower#4      _ServerSocket.listen (dart:io-patch/socket_patch.dart:1351)
TechEmpower#5      _HttpServer.listen (dart:io/http_impl.dart:2278)
TechEmpower#6      _startServer.<anonymous closure> (file:///server.dart:88:12)
TechEmpower#7      _RootZone.runUnary (dart:async/zone.dart:1371)
TechEmpower#8      _FutureListener.handleValue (dart:async/future_impl.dart:129)
TechEmpower#9      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
TechEmpower#10     _Future._propagateToListeners (dart:async/future_impl.dart:665)
TechEmpower#11     _Future._completeWithValue (dart:async/future_impl.dart:478)
TechEmpower#12     Future.wait.<anonymous closure> (dart:async/future.dart:362)
TechEmpower#13     _RootZone.runUnary (dart:async/zone.dart:1371)
TechEmpower#14     _FutureListener.handleValue (dart:async/future_impl.dart:129)
TechEmpower#15     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
TechEmpower#16     _Future._propagateToListeners (dart:async/future_impl.dart:665)
TechEmpower#17     _Future._completeWithValue (dart:async/future_impl.dart:478)
TechEmpower#18     Future.wait.<anonymous closure> (dart:async/future.dart:362)
TechEmpower#19     _RootZone.runUnary (dart:async/zone.dart:1371)
TechEmpower#20     _FutureListener.handleValue (dart:async/future_impl.dart:129)
TechEmpower#21     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
TechEmpower#22     _Future._propagateToListeners (dart:async/future_impl.dart:665)
TechEmpower#23     _Future._completeWithValue (dart:async/future_impl.dart:478)
TechEmpower#24     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:510)
TechEmpower#25     _microtaskLoop (dart:async/schedule_microtask.dart:41)
TechEmpower#26     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
TechEmpower#27     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:99)
TechEmpower#28     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:152)
NateBrady23 pushed a commit that referenced this issue Apr 24, 2018
Here's an example of the error output from before this change:

Unhandled exception:
Bad state: Stream was already listened to
#0      _RawServerSocket.listen (dart:io-patch/socket_patch.dart:1106)
#1      new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:123)
#2      _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:91)
#3      _ForwardingStream.listen (dart:async/stream_pipe.dart:86)
#4      _ServerSocket.listen (dart:io-patch/socket_patch.dart:1351)
#5      _HttpServer.listen (dart:io/http_impl.dart:2278)
#6      _startServer.<anonymous closure> (file:///server.dart:88:12)
#7      _RootZone.runUnary (dart:async/zone.dart:1371)
#8      _FutureListener.handleValue (dart:async/future_impl.dart:129)
#9      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
#10     _Future._propagateToListeners (dart:async/future_impl.dart:665)
#11     _Future._completeWithValue (dart:async/future_impl.dart:478)
#12     Future.wait.<anonymous closure> (dart:async/future.dart:362)
#13     _RootZone.runUnary (dart:async/zone.dart:1371)
#14     _FutureListener.handleValue (dart:async/future_impl.dart:129)
#15     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
#16     _Future._propagateToListeners (dart:async/future_impl.dart:665)
#17     _Future._completeWithValue (dart:async/future_impl.dart:478)
#18     Future.wait.<anonymous closure> (dart:async/future.dart:362)
#19     _RootZone.runUnary (dart:async/zone.dart:1371)
#20     _FutureListener.handleValue (dart:async/future_impl.dart:129)
#21     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
#22     _Future._propagateToListeners (dart:async/future_impl.dart:665)
#23     _Future._completeWithValue (dart:async/future_impl.dart:478)
#24     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:510)
#25     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#26     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#27     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:99)
#28     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:152)
NateBrady23 pushed a commit that referenced this issue Jun 1, 2018
msmith-techempower pushed a commit that referenced this issue Oct 8, 2019
johnaohara pushed a commit to johnaohara/FrameworkBenchmarks that referenced this issue Nov 4, 2019
NateBrady23 pushed a commit that referenced this issue Dec 17, 2020
* initial commit

* Updating README.md

* Update jdk image and donkey release version

* PR #6128 - Revision #1 - Reconstruct JSON response on each request

Co-authored-by: yaron.elyashiv <[email protected]>
andreasrueb pushed a commit to digitallyinduced/IHP-FrameworkBenchmarks that referenced this issue Apr 13, 2021
* initial commit

* Updating README.md

* Update jdk image and donkey release version

* PR TechEmpower#6128 - Revision TechEmpower#1 - Reconstruct JSON response on each request

Co-authored-by: yaron.elyashiv <[email protected]>
NateBrady23 pushed a commit that referenced this issue Nov 17, 2022
* upgrade kotlin, gradle, http4k

* upgrade libraries, replace Jackson with Argo

* upgrade libraries, replace Jackson with Argo

* upgrade libraries, replace Jackson with Argo

* upgrade libraries, replace Jackson with Argo, introduce GraalVM

* update graalvm server to contain database routes

* remove cached queries from graal because it isn't supported

* rename graalvm jarfile

* adding in loom

* build custom gradle image for Java 19 builds

* rename dockerfile to be correct with the value set in the config file

* rename jetty dockerfile to be correct, fix config files as well

* switched port to 8080

* remove database tests for graalvm for the moment

* upgrade cache2k

* fixes for Cache2k API upgrades

* upgrade http4k

* repoint at port 9000, remove duplicate code from GraalVM

* fix graalvm configuration options

* added reflection config

* fixing graalvm reflection

* cleanup

* tweak implementation of cache population on update... much more efficient!

* added pbl resources and reflection config for fortune endpoint classes

* readded urls for graalvm

* tweak config for graalvm

* Introduce multiple database drivers (PGclient and Hikari) (#1)

Co-authored-by: albertlatacz <[email protected]>
NateBrady23 pushed a commit that referenced this issue Jul 12, 2023
* [JavaScript] Add HyperExpress

* [HyperExpress] Create readme.md

* Rename readme.md to README.md

* [HyperExpress] Tidy up codes

* [HyperExpress] Add mysql

* [HyperExpress] Tweaking github actions for db pool max connections

* [HyperExpress] Instantiating json for each request (#1)

* [HyperExpress] Instantiating json for each request

* [HyperExpress] add max connections to postgres

* [HyperExpress] Removing postgres pool max connections

* [HyperExpress] Fix starting app in single instance

* [HyperExpress] Remove unused scripts

* [HyperExpress] Removing postgres pool max connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants