Re: [PHP] Persistent PHP web application?

2005-01-09 Thread Xuefer Tinys
On Sat, 08 Jan 2005 12:03:10 -0800, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote: > > You greatly underestimate how slow unserialize is. > > -Rasmus > > you're right, but php-devs seems going to rewrite it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.ne

Re: [PHP] Persistent PHP web application?

2005-01-08 Thread Rasmus Lerdorf
Xuefer Tinys wrote: even apc/eAcc have to copy from shm to php-memory(alloc by emalloc), because $array might be modified anytime i'd guess this is almost same as serialize/unserialize You greatly underestimate how slow unserialize is. -Rasmus -- PHP General Mailing List (http://www.php.net/) To un

Re: [PHP] Persistent PHP web application?

2005-01-08 Thread Xuefer Tinys
even apc/eAcc have to copy from shm to php-memory(alloc by emalloc), because $array might be modified anytime i'd guess this is almost same as serialize/unserialize i doubt if there's anyway to have 1 memcpy $array<-from/to->shm, php will release 1 element of $array when the element is unset(refcou

RE: [PHP] Persistent PHP web application?

2005-01-08 Thread Lance Lovette
I wrote a PHP extension a while ago that implements "executor" persistence for scalar variables and constants. I never looked much into persisting objects, arrays or resources but it would be a useful addition to the extension if someone wants to contribute. I haven't updated the Web site with the

Re: [PHP] Persistent PHP web application?

2005-01-08 Thread Josh Whiting
On Thu, Jan 06, 2005 at 08:41:57PM -0500, Jason Barnett wrote: > >Does "not up to date" mean the code isn't working with current releases > >of php 4 or 5? I'd be interested in giving it a try. > > I believe this is the case. AFAIK the APC library doesn't support PHP5 > or at least it didn't when

Re: [PHP] Persistent PHP web application?

2005-01-07 Thread Rasmus Lerdorf
On Fri, 7 Jan 2005, William Lovaton wrote: > The phpbeans (or sockets) kind of solutions won't work as Josh Whiting > (original author of this thread) would expect. > > phpbeans is a good idea to share (complex) business logic and data > between many web servers but it will have to serialize and u

Re: [PHP] Persistent PHP web application?

2005-01-07 Thread William Lovaton
Hi everybody in this thread, The phpbeans (or sockets) kind of solutions won't work as Josh Whiting (original author of this thread) would expect. phpbeans is a good idea to share (complex) business logic and data between many web servers but it will have to serialize and unserialize the data to

Re: [PHP] Persistent PHP web application?

2005-01-07 Thread Josh Whiting
> > Call me crazy or ignorant, i'm both, but would it be possible to build > > an extension that, in its MINIT hook as you suggest, actually runs a > > separate PHP script that contains global definitions, then makes those > > definitions available to later scripts? this is basically my original >

Re: [PHP] Persistent PHP web application?

2005-01-07 Thread Jason Barnett
Does "not up to date" mean the code isn't working with current releases of php 4 or 5? I'd be interested in giving it a try. I believe this is the case. AFAIK the APC library doesn't support PHP5 or at least it didn't when I looked at it. If you want to pitch in support for APC you should just

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Josh Whiting
> I think I understand where you're coming from. I've had a similar > problem and the best solution I've found is eAccelerator (previously > known as Turck MMCache). What EA does is keep the bytecodes PHP compiles > inshared memory so next time you need that script PHP doesn't need to > recompi

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Adrian Madrid
http://eaccelerator.sourceforge.net/Home Go there, you'll find more about it. In short, Zend hired the lead programmer of MMCache and the project eventually died off. Other people picked it up and developed patches to update it. I believe eAccelerator is the most advanced and stable for me in PH

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread daniel
> I've done some benchmaring and it is quite fast, specially compared to > talking to the DB. Also, phpbeans provides a daemon that can give you > the solution you are looking for, I believe. > > Adrian Hey I just checked out phpbeans, it looks pretty intense, it does have a php deamon that runs a

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread daniel
>> >>>From my PHP library I use shm_put_var() and shm_get_var(). If >> serialization is done this way then it is implicit... right? > > Yes, these functions serialize/unserialize behing the scenes. > > -Rasmus Hi, has anyone got an example on howto use the shared memory functions ? I currently

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Manuel Lemos
Hello, on 01/06/2005 05:24 PM William Lovaton said the following: El jue, 06-01-2005 a las 10:26 -0700, Adrian Madrid escribió: I think I understand where you're coming from. I've had a similar problem and the best solution I've found is eAccelerator (previously known as Turck MMCache). Hold on a

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread William Lovaton
El jue, 06-01-2005 a las 10:52 -0800, Rasmus Lerdorf escribió: > William Lovaton wrote: > >From my PHP library I use shm_put_var() and shm_get_var(). If > > serialization is done this way then it is implicit... right? > > Yes, these functions serialize/unserialize behing the scenes. Rasmus, I a

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Adrian Madrid
I've done some benchmaring and it is quite fast, specially compared to talking to the DB. Also, phpbeans provides a daemon that can give you the solution you are looking for, I believe. Adrian Rasmus Lerdorf wrote: Adrian Madrid wrote: I think I understand where you're coming from. I've had a si

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread William Lovaton
El jue, 06-01-2005 a las 10:26 -0700, Adrian Madrid escribió: > I think I understand where you're coming from. I've had a similar > problem and the best solution I've found is eAccelerator (previously > known as Turck MMCache). Hold on a second! I use Turck MMCache but I didn't know about the c

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Jason Barnett
What you are talking about is opcode caching. While it certainly speeds things up, it can be done much faster. When you cache a file that contains a large PHP array definition, all you are caching are the instructions to create that array. On every request these instructions need to be loade

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Rasmus Lerdorf
Adrian Madrid wrote: I think I understand where you're coming from. I've had a similar problem and the best solution I've found is eAccelerator (previously known as Turck MMCache). What EA does is keep the bytecodes PHP compiles inshared memory so next time you need that script PHP doesn't need

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Rasmus Lerdorf
William Lovaton wrote: Rasmus, El jue, 06-01-2005 a las 08:23 -0800, Rasmus Lerdorf escribió: On Thu, 6 Jan 2005, William Lovaton wrote: This is great. In my high performance web app I created a PHP library that abstracted this to use several backends. For instance I have a File backend and a SHM

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Adrian Madrid
I think I understand where you're coming from. I've had a similar problem and the best solution I've found is eAccelerator (previously known as Turck MMCache). What EA does is keep the bytecodes PHP compiles inshared memory so next time you need that script PHP doesn't need to recompile, EA ret

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Rasmus Lerdorf
On Thu, 6 Jan 2005, Josh Whiting wrote: > > Anything you do in the MINIT hook is basically free, so it would be > > trivial to load the data for the array from somewhere. Like a database, > > an xml file, etc. So you wouldn't need to hardcode a complex array > > structure in your MINIT hook,

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Rasmus Lerdorf
On Thu, 6 Jan 2005, William Lovaton wrote: > Hi Rasmus, > > El lun, 03-01-2005 a las 14:13 -0500, Rasmus Lerdorf escribió: > > If you need to do something fancier you can stick things in shared > > memory. Many of the accelerators give you access to their shared memory > > segments. For examp

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread William Lovaton
Rasmus, El jue, 06-01-2005 a las 08:23 -0800, Rasmus Lerdorf escribió: > On Thu, 6 Jan 2005, William Lovaton wrote: > > This is great. In my high performance web app I created a PHP library > > that abstracted this to use several backends. For instance I have a > > File backend and a SHM backend

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Josh Whiting
> Anything you do in the MINIT hook is basically free, so it would be > trivial to load the data for the array from somewhere. Like a database, > an xml file, etc. So you wouldn't need to hardcode a complex array > structure in your MINIT hook, just have this generic little extension > that c

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread William Lovaton
Hi Rasmus, El lun, 03-01-2005 a las 14:13 -0500, Rasmus Lerdorf escribió: > If you need to do something fancier you can stick things in shared > memory. Many of the accelerators give you access to their shared memory > segments. For example, the CVS version of pecl/apc provides apc_store() >

Re: [PHP] Persistent PHP web application?

2005-01-05 Thread Rasmus Lerdorf
Richard Lynch wrote: Or you could pay a guy who knows C and PHP to do it in, what, a couple hours? Depends on how confusing your arrays are, and how heterogeneous they are, I guess. Once you do that, all your data is in PHP/Apache when it launches, and it's always available to your PHP script all

Re: [PHP] Persistent PHP web application?

2005-01-05 Thread Richard Lynch
>> So if what your application mostly does is load in all this data and >> respond to requests, you could write a *SINGLE* PHP application which >> listened on port 12345 (or whatever port you like) and responded with >> the >> data requested. Like writing your own web-server, only it's a >> _

Re: [PHP] Persistent PHP web application?

2005-01-04 Thread Josh Whiting
Thanks for taking the time for your comprehensive repsonse! > However, given your programming philosophy so far, and the fact that you > are worried about 7ms and that you specifically requested some kind of > shared memory space in PHP, you should Read This: > http://us4.php.net/manual/en/ref.sem

Re: [PHP] Persistent PHP web application?

2005-01-04 Thread Rasmus Lerdorf
Josh Whiting wrote: Wow thanks for the helpful breakdown. PHP's model is to be completely sandboxed such that every request is completely separate from every other. Having a persistent interpreter as you describe would break that rule and break the infinite horizontal scalability model of PHP.

Re: [PHP] Persistent PHP web application?

2005-01-04 Thread Josh Whiting
Wow thanks for the helpful breakdown. > PHP's model is to be completely sandboxed such that every request is > completely separate from every other. Having a persistent interpreter > as you describe would break that rule and break the infinite horizontal > scalability model of PHP. Understood

Re: [PHP] Persistent PHP web application?

2005-01-03 Thread Rasmus Lerdorf
Josh Whiting wrote: Dear list, My web application (an online classifieds server) requires a set of fairly large global arrays which contain vital information that most all the page scripts rely upon for information such as the category list, which fields belong to each category, and so on. Addition

Re: [PHP] Persistent PHP web application?

2005-01-03 Thread Richard Lynch
Josh Whiting wrote: > My web application (an online classifieds server) requires a set of > fairly large global arrays which contain vital information that most all > the page scripts rely upon for information such as the category list, > which fields belong to each category, and so on. For this,