Re: PHP as Application Server
| From: | Alessandro Pellizzari | Date: | Wed, 26 Sep 2012 15:47:31 +0000 |
| Subject: | Re: PHP as Application Server | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319264@lists.php.net to get a copy of this message | ||
Il Wed, 26 Sep 2012 17:23:35 +0200, Maciej Liżewski ha scritto:
> persistent application servers load resources only on startup (or when
> needed) and keep them in memory until programatically freed or until end
> of application (server shutdown).
You don't mention the downsides:
- every application must be structured to not overwrite session data (you
risk saving one user's data in another user's space)
- when changing even a single line in your code, you must restart
(shutdown and start up) the whole app, closing all user connections and
possibly losing all session data, forcing users to relogin.
- memory leaks are much more problematic
- you must manage threads, somehow, sometime.
Application servers have (IMHO) very little advantages (counters, and?)
and a lot of disadvantages.
All (or nearly all) the advantages of application server have been
superseded in PHP (precompiled caches, memcache, gearman, ... nodephp :)
without losing its advantages (you can change a single file in the app
and the precompiled cache auto-updates. You risk less with memory leaks,
etc.)
Yes, some things are easier in Java (threading, syncronizing, etc.) but
you can always write abstraction classes to do that for you.
I don't think I would use a PHP application server, even if it existed.
Bye.