Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 11 17:43
    keywan-ghadami-oxid commented #539
  • Apr 01 17:02
    Jonas18175 opened #552
  • Mar 16 10:45
    andig closed #549
  • Mar 16 10:45
    andig commented #549
  • Mar 16 10:44

    andig on 2.4.0

    (compare)

  • Mar 16 10:01

    andig on andig-patch-1

    (compare)

  • Mar 16 10:00

    andig on master

    Upgrade fixer (#550) (compare)

  • Mar 16 10:00
    andig closed #550
  • Mar 16 05:30
    javaDeveloperKid commented #549
  • Mar 04 16:44
    javaDeveloperKid commented #549
  • Mar 04 16:38
    andig review_requested #550
  • Mar 04 16:38

    andig on master

    Fix trim(nil) deprecated causin… (compare)

  • Mar 04 16:38
    andig closed #551
  • Mar 04 16:19
    andig labeled #549
  • Mar 04 16:09
    javaDeveloperKid opened #551
  • Mar 04 16:00
    andig commented #549
  • Mar 04 15:51
    javaDeveloperKid commented #549
  • Mar 04 15:22
    andig commented #547
  • Mar 04 15:11
    javaDeveloperKid commented #549
  • Mar 04 15:10
    javaDeveloperKid commented #549
Marc J. Schmidt
@marcj
its completely user land related
you re welcome, i'm currently on the phone at a quite place xD
Matthieu Napoli
@mnapoli
right! OK then we are on the same page. And to me it seems like a big issue: it's hard to rewrite all frameworks, libraries and especially applications to work with PHP-PM. That's why I'm wondering if there's not a solution were we could keep the "1 process handles only 1 request" (so no memory issue/global shared) while also avoid bootstrap time in the response time
so the idea is basically let PHP scripts "do something" (bootstrap) before being made available to PHP-FPM (or any other handler)
Marc J. Schmidt
@marcj
one process = one request basically destroys the whole approach and the speed gain
and one process =one request is already what php-fpm is doing
Matthieu Napoli
@mnapoli
that's what I don't understand: the speed gain is due to the fact that we don't do the bootstrap of the application anymore right?
oh ok
now I'm lost again
I knew you could have one process = one request in PHP-PM but I thought it wasn't really the best setup, I need to re-read again the docs then
Marc J. Schmidt
@marcj
yeah the fact that all of your services are eager loaded, as in java for exame
Matthieu Napoli
@mnapoli
then I don't see where the memory leak is with PHP-PM if a process only handles one request
that's what you said above:
memory leaks only happen if the developer of a library/the application is not aware that the app is handling several request over linger time. php itself does t have issue with it
so if PHP-PM processes only handle 1 request no memory issue?
ahhhh nevermind!

and one process =one request is already what php-fpm is doing

I read that as php-pm

damn sorry!
Marc J. Schmidt
@marcj
php-pm itself has no memory leaks nor php has, but if your applications loads tons of services and never cleans up then you built memory leaks
Matthieu Napoli
@mnapoli
right
Marc J. Schmidt
@marcj
for example internal caches which could be useful for one process=one request use cases need to be resetted after each request in php-pm ( for example in the onTerminate event of symfony) but most user are not aware of this event
Matthieu Napoli
@mnapoli
yeah I definitely see what you mean
Marc J. Schmidt
@marcj
and thats how most memory leaks happen
Matthieu Napoli
@mnapoli

so do you think it would make sense to try to find a middleground between PHP-FPM and PHP-PM? Like this:

  • keep one process = one request (to simplify everything, avoid memory issues)
  • but keep the perf improvement by running the bootstrap before the process handles the request

?
I can see several options for how, but I want to make sure the premise is all right?

Marc J. Schmidt
@marcj
I tried hard but haven't found that golden way. the biggest improvement comes really when you work with php as you would with java where your whole apllication is in memory prepared waiting for incoming requests
Matthieu Napoli
@mnapoli
here are ideas, I have no idea if they are doable:
  1. add a new feature in PHP-FPM so that PHP scripts can be run when PHP processes are spawned, until a special instruction that signals to PHP-FPM that the process is now fully initialized and can be added to the pool of PHP processes (i.e. an inverse of fastcgi_finish_request(), maybe like fastcgi_request_ready()) -> PHP-FPM stops the process and waits for a request -> when a request comes in, PHP-FPM populates the global variables ($_GET, etc.) and resumes the execution of the PHP script right were it stopped
  2. implement a FCGI server (much like PHP-PM, that's why I'm asking you today) where the "LoadBalancer" process inits the framework, then loops for each incoming request -> on each request it forks -> the fork handles the request and then dies (1 process == 1 request), while the original process (LoadBalancer) waits for the next request
in both cases we keep one process == one request, but each process only handles 1 request so no memory issue (and we have the perf improvement because bootstrap is not part of the response time)
Matthieu Napoli
@mnapoli
I'm also wondering if there's a solution n°3 with pthreads, but I'll need to read more about that extension
Luke Rotherfield
@LRotherfield
Hi Guys, has anyone had any success running Oro Platform with php-pm?
Marc J. Schmidt
@marcj
@LRotherfield I don't think so
Luke Rotherfield
@LRotherfield
OK, fair enough, thanks for the response
kugu
@kugu

[www-data@sp-prod1 backend]$ composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1

- php-pm/php-pm dev-master requires react/http dev-master#cd15204bd15d106d7832c680e4fb0ca0ce2f5e30 -> satisfiable by react/http[dev-master].
- php-pm/php-pm dev-master requires react/http dev-master#cd15204bd15d106d7832c680e4fb0ca0ce2f5e30 -> satisfiable by react/http[dev-master].
- Removal request for react/http == 9999999-dev
- Installation request for php-pm/php-pm dev-master -> satisfiable by php-pm/php-pm[dev-master].
kugu
@kugu
--- Worker 5501 stderr ---
PHP Fatal error: Class 'React\Http\RequestParser' not found in /git/backend.fb/vendor/php-pm/php-pm/React/RequestParser.php on line 8
Fatal Error: Class 'React\Http\RequestParser' not found in /git/backend.fb/vendor/php-pm/php-pm/React/RequestParser.php:8
part of the problem
current composer install/update - broken
Marc J. Schmidt
@marcj
yeah I guess they broke something
kugu
@kugu
dunno why, but it's installing latest version of react/http
where React\Http\RequestParser are deleted
Martin Lonský
@visitek
\React\Socket\Connection has bufferSize to default 4096... There is no way to set it to higher value... POST data is stripped now
$data = stream_socket_recvfrom($stream, $this->bufferSize);
We send json data, but is is truncated while it is bigger tahn 4096 :(
Martin Lonský
@visitek
Ohh.. it is not needed finally
data are emitted multiply ... incoming data are reading from stream by buffer size.. So before running app in handleRequest should be data collected with reflecting Content-Length
..solved, sorry
Jury
@lcjury
Hi, is php-pm still alive?
Franz Liedke
@franzliedke
@lcjury Yeah, big things are happening here right now: php-pm/php-pm#226
apocello2008
@apocello2008
Hello! I write issue about "Attempted to load class "AppKernel" from the global namespace." 2 weeks ago, but for now don't have any answers. Maybe somebody can help with this error?
apocello2008
@apocello2008

So, i trying setup basic app, based on PSR-7 and Zend\Stratigility. I repeat example from php-pm/php-pm-psr7 but i have error:

 Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to Zend\Stratigility\MiddlewarePipe::process() must be an instance of Interop\Http\ServerMiddleware\DelegateInterface, null given, called in php-pm/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php on line 86 in php-pm/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php:99

Pls. i need help =(

Adil Houmadi
@AdilHoumadi
Hello, is there any implementation of php-pm for apigility ?
Marc J. Schmidt
@marcj
@AdilHoumadi no, I don’t think so