Welcome Guest, Not a member yet? Register   Sign In
CI4 can be able to use full asynchronous features of php within the framework
#1

(This post was last modified: 12-14-2017, 05:25 AM by bawa_d.)

Dear CI devs congratulations for CI4 from the bottom of my heart.

As the php 7.1 have huge performance comparatively to php 5.x there is a new project for asynchronous php on github which is equivalent to Nodejs.

please find below official link
https://reactphp.org/

github repos:
https://github.com/reactphp

framework equivalent to express.js
https://github.com/CapMousse/React-Restify

please have a look so the CI4 can be able to use full asynchronous features of php within the framework.

you did nice job as always.

with regards,
deepak bawa
Reply
#2

Can you give an example of a benefit of asynchronous PHP?
Reply
#3

I've been looking for something to let me avoid Javascript in my designs.

I found this about asynchronous PHP.

https://www.phproundtable.com/episode/asynchronous-php

It is not yet supported in the PHP code, but it could be.
CI 3.1 Kubuntu 19.04 Apache 5.x  Mysql 5.x PHP 5.x PHP 7.x
Remember: Obfuscation is a bad thing.
Clarity is desirable over Brevity every time.
Reply
#4

Nice link twpmarketing! I'll have to watch it a bit later. Although as far as the original post goes - it looks like icicle might provide the drop-in solution he's looking for.

This definitely isn't something in the immediate roadmap for CodeIgniter. We've got enough on our plate just trying to get v4 out the door without adding to the complexity with something more like that.
Reply
#5

(This post was last modified: 12-08-2017, 02:42 AM by bawa_d.)

skunkbad
Can you give an example of a benefit of asynchronous PHP?
thanx for your reply dear.


Yes.
ReactPHP is very much inspired by node.js, which follows the same principle. The goal of such event-based patterns is not to exploit your server 16 CPU's, but to exploit fully your processor by processing HTTP request B while your controller for request A, which has made request to database, is paused until the 'database request success' event is called.
Your test is going exactly against the assumption made by node.js and ReactPHP: "computation is fast, I/O are slow", so if we do computation during I/O (and not between I/O), then CPU time will always be available in higher quantity than needed.
With node.js or ReactPHP if you want to use your server 16 CPU, you just launch 16 server process on 16 port and put a load balancer like nginx in front of them.
But keep in mind ReactPHP is still experimental and not ready for production.

please find below links
There's no denial, we've made use of our potential to achieve Super Speed: by converting our application into a HTTP server using ReactPHP we improved our Symfony application by 8!

Php
Requests per second: 273.76 #/sec
Time per request: 3.653 ms

Wall Time: 12.5ms
CPU Time: 11.4ms
I/O Time: 1.09ms
Memory: 2.2MB


ReactPhp
Requests per second: 2098.17 #/sec
Time per request: 0.477 ms

Wall Time: 1.51ms
CPU Time: 1.51ms
I/O Time: 0.001ms
Memory: 0.105MB

https://gnugat.github.io/2016/04/13/supe...t-php.html


You’ll get with this approach almost 2.000 requests/s instead of 130 on a large Symfony app.
http://marcjschmidt.de/blog/2014/02/08/p...mance.html

A simple benchmark reported about an 800% performance increase, which is a rather obvious result considering that each request now executes a far less amount a code.
https://phpixie.com/blog/increasing-phpi...ctphp.html

Benchmarks
https://philsturgeon.uk/php/2013/11/12/b...ejs-v-php/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB