Advertisement:

Author Topic: What is eAccelerator?  (Read 121713 times)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
What is eAccelerator?
« on: September 19, 2005, 01:35:51 AM »
First, some background is necessary.  SMF is written in a very portable language called PHP, which is very commonly used for web software.  It has its advantages and disadvantages, and some people prefer it, and some do not.  But, regardless, it is what SMF (not unlike many other packages) requires.

As you know, you upload PHP files to your server, and type the URL to them in your browser.  Instead of seeing the file you uploaded, you see something generated by it - or, rather, by PHP.  You don't have to do anything (except installing PHP) to make this happen - just access the file.  When you do so, the following things happen:
  • The PHP source code (which looks like text) is analyzed and compiled to something the computer can understand; this is called "compiling."
  • The compiled code is ran, and generates output, runs queries, sends emails, etc.
  • Whatever response is generated by PHP is sent to the user (you.)

This is all well and good, and makes many things - like testing - easier.  However, for larger sites, the resources the first step (analyzing the sourecode and compiling it) takes becomes more and more of a problem.  Since this step is always done exactly the same way, it's possible to cache the resulting compiled code (either to disk or to memory) and avoid that first step.

Furthermore, once you start caching the compiled code, you can do one more thing: optimization.  Instead of optimization taking more time than it is worth on every page view, it can take that time only for the first page view, an investment for the future.  Optimization means removing parts of the code known not to be necessary on your server, calculating the result of mathematical equations, and such things.

This is what eAccelerator does for PHP.  There are other competing products available as well, such as Turck MMCache (which eAccelerator, as of this writing, is based on), PHP-Accelerator, Zend Optimizer, and APC.  Some of these only optimize code, or only cache it, or do both.  Currently, we recommend eAccelerator, because in our tests, production usage, and benchmarks it has shown to preform better than the others.  Most of the larger SMF forums use it, to great effect - it has even reversed the effects of a slashdotting.

In addition, SMF 1.1 can take advantage of eAccelerator (and other optimizers/accelerators) for a performance benefit, as well, by way of the caching it exposes to scripts for general data.  But that's for another topic.  Suffice it to say optimizers are good.

If you are on a dedicated server, you can install and test it for yourself.  Installation is fairly easy and straight-forward:

$ wget http://yourmirror.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.3.tar.gz
$ tar xvzf eaccelerator-0.9.3.tar.gz
$ cd eaccelerator-0.9.3
$ /usr/bin/phpize
$ ./configure --enable-eaccelerator=shared --with-eaccelerator-content-caching --with-php-config=/usr/bin/php-config
$ make
$ su
$ mkdir /tmp/eaccelerator
$ chown apache:apache-group /tmp/eaccelerator
$ chmod 1700 /tmp/eaccelerator
$ make install
(the italicized versions will vary on your system; Apache usually runs as "nobody".)

If you're on Windows, binaries are available at www.arnot.info.

After that, you need to add a line to php.ini for it to load this extension.  Typically, the line will look like this:

zend_extension=/path/to/eaccelerator.so

Depending on your platform, it may take a few more tries.  When you have it installed, running:

$ php -v

Will show the version of eAccelerator along with the PHP version.  After restarting Apache, you should see an immediate (although, depending on your server, perhaps not hugely noticeable) improvement in load times.  For more information and more thorough configuration, look at www.eaccelerator.net.

You may also want to check these topics, affected by using eAccelerator:
http://www.simplemachines.org/community/index.php?topic=50227.0
http://www.simplemachines.org/community/index.php?topic=50229.0

-[Unknown]
« Last Edit: October 29, 2006, 07:43:02 AM by Ben_S »

Offline junglecat

  • Full Member
  • ***
  • Posts: 439
  • Gender: Female
  • Geek Wannabe
Re: What is eAccelerator?
« Reply #1 on: September 19, 2005, 01:55:39 AM »
I have a question I've never really gotten a satisfactory answer to.

How compatible are zend and eAccelerator on the same server? Is there any particularly special configurations needed if you run both?

The reason I ask, is because I host some scripts that require zend. If I install eAccelerator, I don't want to break any sites.

I'm particularly interested because I would like to offer free SMF hosting, but I want to be very sure of what I'm doing before I make that offer.
PM me for affordable hosting. I will install your SMF forum with your choice of a theme for FREE.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Join us at Christian Discussions 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: What is eAccelerator?
« Reply #2 on: September 19, 2005, 02:09:31 AM »
Excellent stuff. Caching saved me a ton of headaches.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: What is eAccelerator?
« Reply #3 on: September 19, 2005, 02:09:58 AM »
I have a question I've never really gotten a satisfactory answer to.

How compatible are zend and eAccelerator on the same server? Is there any particularly special configurations needed if you run both?

That depends on what you mean by Zend, but I would assume you mean Zend Optimizer.

Zend Optimizer does what it says - it's an optimizer.  It does no bytecode caching (that's what I spent so much time talking about.)  It also loads encoded PHP scripts, which is an important feature for some servers to have (unfortuntely, in my opinion.)

Both Zend Optimizer and eAccelerator can work on the same server at the same time.  As far as I know, the only thing you have to keep in mind is that loading eaccelerator.so has to come before the ZendOptimizer.so file.  In other words, you'll have:

zend_extension=/path/to/ZendOptimizer.so

Just make sure eAccelerator is loaded BEFORE ZendOptimizer.so.  To be honest, I've never tried this, but I know a lot of people run them together, and have said this.  It may not be required, but it can't hurt even so.

From the distribution file, less verbose than I:

Code: [Select]
; eAccelerator is compatible with Zend Optimizer's loader. Zend Optimizer
; must be installed after eAccelerator in php.ini. If you don't use scripts
; encoded with Zend Encoder then we do not recommend you install Zend Optimizer
; with eAccelerator.

Quote
I'm particularly interested because I would like to offer free SMF hosting, but I want to be very sure of what I'm doing before I make that offer.

When offering free hosting, there are a few things you have to take into account:
  - free hosting means hackers can sign up to hack someone else's forum.  This means tighter security, rigorous screening, or both.
  - you'll want to restrict things using open_basedir, disabled_functions, and possibly even safe_mode (and I'd suggest using suExec if you use safe_mode.)

eAccelerator works best when you have a smaller collection of files.  If you have multiple installations of the same version of SMF, I would suggest pointing their $sourcedir's all to the same place.  This will mean that eAccelerator will cache all their files once, taking less memory and resources for the same benefit.  You will definitely want the package manager disabled.

-[Unknown]

Offline junglecat

  • Full Member
  • ***
  • Posts: 439
  • Gender: Female
  • Geek Wannabe
Re: What is eAccelerator?
« Reply #4 on: September 19, 2005, 02:22:05 AM »
That depends on what you mean by Zend, but I would assume you mean Zend Optimizer.
Sorry, yes, I meant Zend Optimizer

When offering free hosting, there are a few things you have to take into account:
  - free hosting means hackers can sign up to hack someone else's forum.  This means tighter security, rigorous screening, or both.
  - you'll want to restrict things using open_basedir, disabled_functions, and possibly even safe_mode (and I'd suggest using suExec if you use safe_mode.)
Yep, that's why I'm hanging out here,  :D I'm trying to learn all this stuff so I'll know what I'm doing. Eventually. 8)
One possibility I was thinking of was to make separate cpanel accounts for each forum to help keep people out of each other's accounts.
BUT I'm deciding on nothing yet until I explore ALL the possibilities.

eAccelerator works best when you have a smaller collection of files.  If you have multiple installations of the same version of SMF, I would suggest pointing their $sourcedir's all to the same place.  This will mean that eAccelerator will cache all their files once, taking less memory and resources for the same benefit.  You will definitely want the package manager disabled.
Whoa... GREAT idea (I would never have thought of that on my own).
PM me for affordable hosting. I will install your SMF forum with your choice of a theme for FREE.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Join us at Christian Discussions 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: What is eAccelerator?
« Reply #5 on: September 19, 2005, 06:23:34 AM »
I don't have "phpize" and can't find out much about it. i'm running on a server:
Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-15 4.1.11-Debian_4-log

I downloaded it fine.. but yeah not sure what to do now.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline Compuart

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,774
  • Gender: Male
  • ZĂ©eeeal
    • RealityNet
Re: What is eAccelerator?
« Reply #6 on: September 19, 2005, 06:55:01 AM »
Have you tried to locate phpize by typing
Code: [Select]
locate phpizein the shell?
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: What is eAccelerator?
« Reply #7 on: September 19, 2005, 07:33:23 AM »
I get nothing with that, so I guess I'll have to install it manually cause debian don't seem to know anything about it. Unless its in a later version of php, cause I'm planning on upgrading anyway.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline zmobie

  • Newbie
  • *
  • Posts: 5
Re: What is eAccelerator?
« Reply #8 on: September 19, 2005, 10:19:18 AM »
Thanks for the summary on eAccelerator!

I'm a little concerned about the current state of the project.  On the homepage, the status seems very up in the air.  What's your feelings on that?

Offline Webrunner

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
    • Vrouwenpower
Re: What is eAccelerator?
« Reply #9 on: September 19, 2005, 03:19:28 PM »
I don't have phpize on my server either :(
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Offline Webrunner

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
    • Vrouwenpower
Re: What is eAccelerator?
« Reply #10 on: September 19, 2005, 03:41:57 PM »
OK, i installed the php-dev package and now it is there :)
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: What is eAccelerator?
« Reply #11 on: September 20, 2005, 05:04:17 PM »
I don't have "phpize" and can't find out much about it. i'm running on a server:
Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-15 4.1.11-Debian_4-log

I downloaded it fine.. but yeah not sure what to do now.

You're using rpms, aren't you?  In that case, you need to either compile PHP from source or install php-devel/php-dev/etc.

Thanks for the summary on eAccelerator!

I'm a little concerned about the current state of the project.  On the homepage, the status seems very up in the air.  What's your feelings on that?

They wanted to start distributing eAccelerator with some other software.  However, the original creator of Turck MMCache was not willing to allow this (and he owns the original copyrights to much of the code.)  They plan to rewrite it, which I agree is dubious, but the current stable version is enough of a benefit.

I'm not sure we will recommend their new version, though - I won't until I see that it's as good as their current.  So, for now, I suggest the usage of 0.9.3.

-[Unknown]

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: What is eAccelerator?
« Reply #12 on: September 22, 2005, 03:41:33 AM »
I got phpize now. It displays this:
Quote
Configuring for:
PHP Api Version:         20020918
Zend Module Api No:      20020429
Zend Extension Api No:   20021010
And then stops. do you know what could be causing that?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: What is eAccelerator?
« Reply #13 on: September 22, 2005, 03:57:47 AM »
That's all phpize should do.  It's done its job, now on to the next step (configure)!

-[Unknown]

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: What is eAccelerator?
« Reply #14 on: September 22, 2005, 04:36:20 AM »
But should it take me back to the command prompt (it does not at the moment)? Or do i just type the configure lines without the prompt?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: What is eAccelerator?
« Reply #15 on: September 22, 2005, 04:53:49 AM »
Try hitting enter.  The phpize command may take a few seconds to finish.

-[Unknown]

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: What is eAccelerator?
« Reply #16 on: September 27, 2005, 04:47:10 AM »
A few minutes on this old computer :P

I'm pretty sure I have it all installed correctly, but i don't know if I have it correctly in php.ini
What's the easiest way to check if it's running?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline boogiedown

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
Re: What is eAccelerator?
« Reply #17 on: October 05, 2005, 09:33:24 PM »
what do i relace here? chown apache:apache-group /tmp/eaccelerator and with what?

Offline Ben_S

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,702
  • xxx
Re: What is eAccelerator?
« Reply #18 on: October 06, 2005, 11:55:12 AM »
What does your apache run as?
Liverpool FC Forum with 14 million+ posts.

Offline boogiedown

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
Re: What is eAccelerator?
« Reply #19 on: October 06, 2005, 02:37:49 PM »
ok, got it "nobody"
« Last Edit: October 06, 2005, 04:33:28 PM by stevebor1 »