[PHP] Free PHP runtime Accelerator for Linux available
All, After a frantic week of development and digging into the bowels of the PHP scripting engine, I've produced an initial version of a run time accelerator. This works for Linux only, and the current version was built with RedHat 7.0.1, PHP 4.0.6, and Apache 1.3.12 and 1.3.20. This is a shared library extension to the Zend engine with a one line config entry to the php.ini file to enable it. I put together a site this evening with some notes, a few performance indications, and the downloads at http://212.67.208.211 It is currently far from optimal, but it halved the processing time of the index.php file on that site for example so it's working in the right direction :-) I started this basically because I wanted it to speed up my own site code, but then thought that every one (well, us Linux users anyway), should be able to have it too. As I say on the site, this may not work 100% reliably yet, and it's only a week old, but now passes all my tests and some complex scripts, so is well on the way. I welcome any feedback. Nick _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Free PHP runtime Accelerator for Linux available
Hi. Yes, it caches the result of compiling scripts and loads the compiled code on subsequent runs, thus bypassing the parsing of source code entirely - unless the source code has changed and the compiled code is stale. Nick >From: Daniel Adams <[EMAIL PROTECTED]> >To: PHP Accelerator <[EMAIL PROTECTED]> >CC: <[EMAIL PROTECTED]> >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available >Date: Mon, 20 Aug 2001 22:06:51 -0400 (EDT) > >Is this different from the zend optimizer? > - Dan > >On Tue, 21 Aug 2001, PHP Accelerator wrote: > > > All, > > > > After a frantic week of development and digging into the bowels of the >PHP > > scripting engine, I've produced an initial version of a run time > > accelerator. This works for Linux only, and the current version was >built > > with RedHat 7.0.1, PHP 4.0.6, and Apache 1.3.12 and 1.3.20. This is a >shared > > library extension to the Zend engine with a one line config entry to the > > php.ini file to enable it. > > > > I put together a site this evening with some notes, a few performance > > indications, and the downloads at http://212.67.208.211 It is currently >far > > from optimal, but it halved the processing time of the index.php file on > > that site for example so it's working in the right direction :-) > > > > I started this basically because I wanted it to speed up my own site >code, > > but then thought that every one (well, us Linux users anyway), should be > > able to have it too. As I say on the site, this may not work 100% >reliably > > yet, and it's only a week old, but now passes all my tests and some >complex > > scripts, so is well on the way. > > > > I welcome any feedback. > > > > Nick > > > > > > _ > > Get your FREE download of MSN Explorer at >http://explorer.msn.com/intl.asp > > > > > > > >-- > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Free PHP runtime Accelerator for Linux available
Right, and neither is the accelerator at the moment, and it may very well never be, although there's no particular reason for that. But the scripting engine is as it's part of PHP, and that's what I explored in order to write the accelerator. And now that I've studied the engine pretty intensely I've a good idea for some of the optimisations that their optimiser is probably having a go at. It's been a few fun, late nigh, and at times intensely frustrating, evenings, but I'm happy with even the sub-optimal current performance gains. >From: Daniel Adams <[EMAIL PROTECTED]> >To: PHP Accelerator <[EMAIL PROTECTED]> >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available >Date: Mon, 20 Aug 2001 22:34:12 -0400 (EDT) > >Cool. :-) the zend optimizer is not open-source, right? > - Dan > >On Tue, 21 Aug 2001, PHP Accelerator wrote: > > > Hi. Yes, it caches the result of compiling scripts and loads the >compiled > > code on subsequent runs, thus bypassing the parsing of source code >entirely > > - unless the source code has changed and the compiled code is stale. > > _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re:
Yes, and it works fine. It basically replaces the parser/compiler with a cache lookup when it determines that it can, and so the real scope for error is if it doesn't correctly restore the original post compilation/pre execution state from when the compiler was run. But at the moment it seems to, at least enough so that things work. As an aside, and about dynanmic content - I also have client side code for transparent PHP database query caching, and display (e.g. HTML) rendering code that actually rewrites itself as more optimal code to a cache on the fly, all as an aid to get speed improvements. I wanted classes that implemented renderers, e.g. a label object, a block of html with a title, a border object that can put a border around other renderers. This makes page development much less an HTML writing job, and more a programming and component based job. This was great, but the cost of such dynamic generation was a performance hit, when in reality, most of what was now dynamically dynamically rendered HTML was really static, most, if not all the time. So I have a client side optimiser that can traverse a hierarchy of renderers, ask them whether they render statically, dynamically based on the state of data elements, or always dynamically. It then emits simpler code for the purely static elements, and either dynamic code or simpler code for the dynamic elements if their dependent data items are in a known state. PHP makes it really feasible to do this kind of stuff. So the dynamic display rendering works well, but it became clear that was really slowing things down was the fact that there was simply a lot of code to now parse and process, even with with conditional inclusion wherever it made logical sense. Hence the accelerator. Nick >From: "Christopher CM Allen" <[EMAIL PROTECTED]> >Reply-To: "Christopher CM Allen" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Date: Tue, 21 Aug 2001 01:27:28 -0500 > >Sounds great nick<> Did you sites run with dynamic content? IE database >querys, if so what did you find for results? _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Free PHP runtime Accelerator for Linux available
Thanks. If you're running Linux then have you tried it yet? I'm really keen for some folks to try and break it, and either find that they can't (which looks promising at the moment), and so start getting the benefit, or expose any remaining show-stoppers so that they can get resolved asap. There are no fancy graphics, and a simple goal - * If you install it * Your scripts run quicker That's it! I'll be updating the http://212.67.208.211 site over the next few days, give it a domain name, and most importantly be updating the accelerator to hopefully yield further performance gains. >From: Maxim Maletsky <[EMAIL PROTECTED]> >To: 'PHP Accelerator' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >CC: [EMAIL PROTECTED] >Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available >Date: Tue, 21 Aug 2001 13:49:42 +0900 > >Great work, Nick. >keep it this way! > >Maxim Maletsky > > >-Original Message- >From: PHP Accelerator [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 21, 2001 12:00 PM >To: [EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available > > >Right, and neither is the accelerator at the moment, and it may very well >never be, although there's no particular reason for that. But the scripting >engine is as it's part of PHP, and that's what I explored in order to write >the accelerator. > >And now that I've studied the engine pretty intensely I've a good idea for >some of the optimisations that their optimiser is probably having a go at. >It's been a few fun, late nigh, and at times intensely frustrating, >evenings, but I'm happy with even the sub-optimal current performance >gains. > > > >From: Daniel Adams <[EMAIL PROTECTED]> > >To: PHP Accelerator <[EMAIL PROTECTED]> > >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available > >Date: Mon, 20 Aug 2001 22:34:12 -0400 (EDT) > > > >Cool. :-) the zend optimizer is not open-source, right? > > - Dan > > > >On Tue, 21 Aug 2001, PHP Accelerator wrote: > > > > > Hi. Yes, it caches the result of compiling scripts and loads the > >compiled > > > code on subsequent runs, thus bypassing the parsing of source code > >entirely > > > - unless the source code has changed and the compiled code is stale. > > > > > >_ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Free PHP runtime Accelerator for Linux available
Actually it would be interesting to get a FreeBSD port. When I've made the immediate batch of changes that I have in mind, and if things are still looking good, then volunteers to contribute builds would be welcome. Right now, even though the accelerator provides a decent speed up, the Zend Cache is going to be faster - there's really no way that it couldn't be :-) But the accelerator should get faster too, and with the core code seemingly working, the first set of changes will be to simply do some things more sensibly. After that there are a number of things that I can imagine doing to really minimise the processing required in loading a given script, but I have other things I want to work on too. I also have ideas for a project that might slash execution time more than any other extensions currently available, but again for now this will remain a 'would like to start' project. Cheers Nick >From: Maxim Maletsky <[EMAIL PROTECTED]> >To: 'PHP Accelerator' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >CC: [EMAIL PROTECTED] >Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available >Date: Tue, 21 Aug 2001 18:45:13 +0900 > >Thanks, Nick. >Well, I am running FreeBSD machine, but can start up my old Linux box to >play with your accelerator. >I'll let you know when I do that, >I am kind of curious to compare it with Zend's Cache. > >Cheers, >Maxim Maletsky > > >-Original Message- >From: PHP Accelerator [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 21, 2001 4:53 PM >To: Maxim Maletsky; [EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available > > >Thanks. If you're running Linux then have you tried it yet? I'm really >keen > >for some folks to try and break it, and either find that they can't (which >looks promising at the moment), and so start getting the benefit, or expose >any remaining show-stoppers so that they can get resolved asap. > >There are no fancy graphics, and a simple goal - > > * If you install it > * Your scripts run quicker > >That's it! > >I'll be updating the http://212.67.208.211 site over the next few days, >give > >it a domain name, and most importantly be updating the accelerator to >hopefully yield further performance gains. > > >From: Maxim Maletsky <[EMAIL PROTECTED]> > >To: 'PHP Accelerator' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > >CC: [EMAIL PROTECTED] > >Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available > >Date: Tue, 21 Aug 2001 13:49:42 +0900 > > > >Great work, Nick. > >keep it this way! > > > >Maxim Maletsky > > > > > >-Original Message- > >From: PHP Accelerator [mailto:[EMAIL PROTECTED]] > >Sent: Tuesday, August 21, 2001 12:00 PM > >To: [EMAIL PROTECTED] > >Cc: [EMAIL PROTECTED] > >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available > > > > > >Right, and neither is the accelerator at the moment, and it may very well > >never be, although there's no particular reason for that. But the >scripting > >engine is as it's part of PHP, and that's what I explored in order to >write > >the accelerator. > > > >And now that I've studied the engine pretty intensely I've a good idea >for > >some of the optimisations that their optimiser is probably having a go >at. > >It's been a few fun, late nigh, and at times intensely frustrating, > >evenings, but I'm happy with even the sub-optimal current performance > >gains. > > > > > > >From: Daniel Adams <[EMAIL PROTECTED]> > > >To: PHP Accelerator <[EMAIL PROTECTED]> > > >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available > > >Date: Mon, 20 Aug 2001 22:34:12 -0400 (EDT) > > > > > >Cool. :-) the zend optimizer is not open-source, right? > > > - Dan > > > > > >On Tue, 21 Aug 2001, PHP Accelerator wrote: > > > > > > > Hi. Yes, it caches the result of compiling scripts and loads the > > >compiled > > > > code on subsequent runs, thus bypassing the parsing of source code > > >entirely > > > > - unless the source code has changed and the compiled code is stale. > > > > > > > > > >_ > >Get your FREE download of MSN Explorer at >http://explorer.msn.com/intl.asp > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >_ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Free PHP runtime Accelerator for Linux available
Hi Michael, Thanks a lot for your email! I must confess to, for once, not checking the web first and looking other products. I hadn't come across any others and was just aware of the Zend offering, hence putting together the accelerator. Now things are suddenly more interesting :-) I would be suprised if the accelerator didn't come bottom of the performance tables at the moment compared to the others to be honest. Seeing as I hadn't looked at a line of php-4.0.6/Zend code before last Monday, the first milestone was merely to get something that worked at all :-) 6 days later I reached the first version that ironed out all showstoppers that I'm aware of. Intellectual exercise? Of course, what else, but the reason was that I needed a cache. Had I looked at the others then... well I'd have probably still started anyway having seen Zend outstripping the others Looking at the performance stats from John Lim back in January, it seems likely that all non-Zend caches are missing a fundamental trick or two. What do you think? For example, and this may be poor one because apc,bw,bez might all be doing this in one way or another, but when restoring a compiled file it can be that only a fraction of the functions/methods, and even entire classes are ever used. Loading the never used functions and classes and restoring unused static vars initialisers would quite literally be a waste of time. Another thing that comes to mind is that you probably want to ensure that the usual cleaning up of memory that Zend does actually *doesn't* happen quite as completely as it does by default. I actually ask myself - do I want to restore compiled code from shared memory? Do I event want to restore compiled code from web server memory? And the answer is ideally no to both. And of course I don't want to restore from files. Bottom line, I actually don't want to *restore anything* if it requires any memory copying. Ideally I'd like the same hashtables, same function pointers, same static_variables, etc. etc. that were used last time a page was loaded. Not *copies of* these things. My ultimate goal, if I were making this a full time project, would be to 'get' all the state I needed by a single lookup for the value of compiler/executor_globals using the i-number for the root source file in a devno specific structure. No copying of anything. Of course this might be unrealistic, but I'd want to know why, and focus not just how can I speed things up, but how can I eliminate what is slowing me down! Another part of the engine that seems 'fair game' is the executor. One might perhaps reduce the size of CG(class_table) and CG(function_table) for example by switching between tables that contain just the likely or reachable items from certain points in the code. It's also possible to hijack what would normally be fatal errors, regard them as faults rather like a page fault, patch up what caused the error on the fly, such as a function lookup failure, and carry on as though nothing happened. Again, perhaps other cache developers are getting mileage from this, or perhaps there is no mileage in this, or perhaps there is and they are not? And then there's a zend_op->C->nativecode.so optimiser that produces .so files of your scripts when there's nothing else better to be getting on with :-) Nick >From: Michael Kimsal <[EMAIL PROTECTED]> >To: PHP Accelerator <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available >Date: Tue, 21 Aug 2001 09:27:53 -0400 > > >Hello Nick, > >First off, thanks for your contribution. We've not tested it as of yet, >but it's >always good to see more people getting involved at some level. :) > >Second, have you compared the mechanism(s) you use against APC or bware? >Have you considered perhaps helping with one of those projects instead of >starting from scratch? It sounds like this was primarily an >intellectual exercise for you >to begin with, so I can understand the DIY mindset. However, if you've >got many ideas >for improving things further (PHP code optimization, reduced CPU time, >etc) perhaps >helping out with a more established project would benefit everyone more >in the long run. > >Just some thoughts. :) > >Thanks again > > >Michael Kimsal >http://www.tapinternet.com/php/ >PHP Training Courses >734-480-9961 > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Accelerator cache update
A new version of the free PHP Accelerator for Linux is now available at www.php-accelerator.co.uk This release offers a substantial performance improvement over the first 'proof of concept' version, and initial performance tests show that the Accelerator now delivers approximately the same performance as the Zend Cache. Nick _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Accelerator cache update
Thanks Alex, I just realised too that there's a DNS problem. I'm running a DNS server so should probably bring the primary closer to home. You should be able to navigate ok using the IP http://212.67.208.211/ though. Cheers Nick >From: "Alex Shi" <[EMAIL PROTECTED]> >To: "PHP Accelerator" <[EMAIL PROTECTED]>, ><[EMAIL PROTECTED]> >Subject: Re: [PHP] PHP Accelerator cache update >Date: Wed, 5 Sep 2001 19:28:15 -0400 > >It seems like GRANITECANYON.COM temporarily down, so your >domain cannot be resolved. > > >- Original Message - >From: "PHP Accelerator" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, September 05, 2001 6:55 PM >Subject: [PHP] PHP Accelerator cache update > > > > A new version of the free PHP Accelerator for Linux is now available at > > www.php-accelerator.co.uk > > > > This release offers a substantial performance improvement over the first > > 'proof of concept' version, and initial performance tests show that the > > Accelerator now delivers approximately the same performance as the Zend > > Cache. > > > > Nick > > > > > > _ > > Get your FREE download of MSN Explorer at >http://explorer.msn.com/intl.asp > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]