News:

Wondering if this will always be free?  See why free is better.

Main Menu

Fresh SMF or Tweaking

Started by Filipina, March 23, 2009, 11:42:44 AM

Previous topic - Next topic

DavidX

I'm trying to help Filipina with some of the site problems. I know linux, I don't know SMF, PHP, etc.

I looked at php.ini in /usr/local/lib, and it seems to be configured properly, using extensions=, not zend_extension=. If I try it with zend_extension, it kills php. I also enabled debug and a log file, and though the log file gets created, nothing gets written into it. the directory where the logfile is is mode 777 (rw to everbody).

If you look at the sites PHP info page here: hxxp:www.melindaspenpals.com/penpal-community/phpinfo.php [nonactive]

zend thinks there is an eaccelerator extension, (which is the same output as php -v), and the configuration looks correct (though I was experimenting with some of the values, like the shmmax, which I set to zero, which is supposed to use a default), if you scroll further down on that page, it shows the eacclerator is not enabled, though in the next section, the config vars all look correct.

When I look at the cache dir, there's a ton of directories and sub-directories, but no regular files in the cache.

The site configuration is a bit odd, in that there's another php.ini file in /home/melin4/public_html, but that just looks like a stub there and the phpinfo script can clearly see that eaccelerator is loaded. What's odd is that it shows up under zend, but it's not using zend_extension or zend_extension_ts. If I try the former, php fails. With the latter, I think it's just ignored.

Here's the section the host put in (slightly modified by me) in /usr/local/lib/php.ini:



; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
zend_extension_ts="/usr/local/IonCube/ioncube_loader_lin_5.2_ts.so"
; zend_extension="/usr/local/lib/php/extensions/eaccelerator.so"
; zend_extension_ts="/usr/local/lib/php/extensions/eaccelerator.so"
extension="eaccelerator.so"
; eaccelerator.shm_size="32"
eaccelerator.shm_size="0"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="1"
eaccelerator.log_file="/tmp/ea/eaccelerator_log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"




Here's the entire contents of /home/melin4/public_html/php.ini:


register_globals = Off

[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.6
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.6
zend_optimizer.version=3.2.6
zend_extension = /usr/local/ioncube/ioncube_loader_lin_4.4.so
upload_max_filesize = 40M
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so


So, does eaccelerator get built differently depending on if you have zend installed or not? Did the host install the wrong .so file?

Why is there nothing in the log file, even with debug enabled?

Why is there more than one php.ini file?

And the big meta question is, why does ajax chat overload the system? I think he needs to enable the ruby socket extension, which should help with that. I don't think that's enabled. Maybe we should try that, but the eaccelerator thing is maddening.

This is entire thing is pretty bizarre because the site is not a very heavy traffic site, but no matter which chat we try, it just brings the server to it's knees.

So, I'm kind of lost and don't really know what to look for. I'd appreciate anything constructive that I can try.

-David




DavidX

ok, I found that they have the socketserver option set to false in ajax chat's lib/config.php, so I changed that to true

in socket, server and server.rb are both executable. There's a pid file, there, so I'll get rid of that. Will it start the server automatically on reboots, or do I need to do something else to get it to start the ruby socket server automatically?

Anyway, I started it as the correct user. Now to get them to re-enable chat to see if that helps. Did I miss anything there?

Thanks,
David



Something like that

Quote from: DavidX on March 30, 2009, 12:53:42 AM
I'm trying to help Filipina with some of the site problems. I know linux, I don't know SMF, PHP, etc.

I looked at php.ini in /usr/local/lib, and it seems to be configured properly, using extensions=, not zend_extension=. If I try it with zend_extension, it kills php. I also enabled debug and a log file, and though the log file gets created, nothing gets written into it. the directory where the logfile is is mode 777 (rw to everbody).

I believe nothing is written because the caching isn't being enabled for whatever reason.

Quote
If you look at the sites PHP info page here: http://www.melindaspenpals.com/penpal-community/phpinfo.php

zend thinks there is an eaccelerator extension, (which is the same output as php -v), and the configuration looks correct (though I was experimenting with some of the values, like the shmmax, which I set to zero, which is supposed to use a default), if you scroll further down on that page, it shows the eacclerator is not enabled, though in the next section, the config vars all look correct.

When I look at the cache dir, there's a ton of directories and sub-directories, but no regular files in the cache.

It's loaded, but not enabled. Why, I don't know. Zend is the internal PHP engine. It's showing that the eAccelerator extension is loaded.

Quote
The site configuration is a bit odd, in that there's another php.ini file in /home/melin4/public_html, but that just looks like a stub there and the phpinfo script can clearly see that eaccelerator is loaded. What's odd is that it shows up under zend, but it's not using zend_extension or zend_extension_ts. If I try the former, php fails. With the latter, I think it's just ignored.

i don't believe that file is being touched. I didn't see anything about it in the php info.

Quote
Here's the section the host put in (slightly modified by me) in /usr/local/lib/php.ini:



; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
zend_extension_ts="/usr/local/IonCube/ioncube_loader_lin_5.2_ts.so"
; zend_extension="/usr/local/lib/php/extensions/eaccelerator.so"
; zend_extension_ts="/usr/local/lib/php/extensions/eaccelerator.so"
extension="eaccelerator.so"
; eaccelerator.shm_size="32"
eaccelerator.shm_size="0"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="1"
eaccelerator.log_file="/tmp/ea/eaccelerator_log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"



So, does eaccelerator get built differently depending on if you have zend installed or not? Did the host install the wrong .so file?

It appears to be installed correctly. Looking at the trouble shooting information on the eAccelerator site, it says to make sure the eAccelerator stuff is loaded first in the php.ini file before the Zend Optimizer stuff.

Quote
Why is there nothing in the log file, even with debug enabled?

Why is there more than one php.ini file?

I believe the log files will show entries once things are working. I have no idea what the other php.ini is for. I imagine it's not used for anything.

Quote
And the big meta question is, why does ajax chat overload the system? I think he needs to enable the ruby socket extension, which should help with that. I don't think that's enabled. Maybe we should try that, but the eaccelerator thing is maddening.

This is entire thing is pretty bizarre because the site is not a very heavy traffic site, but no matter which chat we try, it just brings the server to it's knees.

So, I'm kind of lost and don't really know what to look for. I'd appreciate anything constructive that I can try.

As I mentioned earlier in the thread, AJAX Chat queries the server every 2 seconds to see if there are any new messages. If you have 20 users online, that's 10 hits a second. The average forum user loads a page about once every minute. A chat user takes 30 times the server resources, roughly.

The way to speed this up is to avoid recompiling the PHP scripts every time. This is what eAccelerator, etc., can do.

Another alternative is to use the ruby socket thing. That avoids all the PHP scripts and is more efficient. I've never played with that.

Something like that

Quote from: DavidX on March 30, 2009, 01:19:27 AM
ok, I found that they have the socketserver option set to false in ajax chat's lib/config.php, so I changed that to true

in socket, server and server.rb are both executable. There's a pid file, there, so I'll get rid of that. Will it start the server automatically on reboots, or do I need to do something else to get it to start the ruby socket server automatically?

Anyway, I started it as the correct user. Now to get them to re-enable chat to see if that helps. Did I miss anything there?

Thanks,
David

I haven't used the ruby server before. Yes, you will need to write a script to have it start on reboot.

DavidX

Thanks.

ok, I'll try re-ordering the lines in php.ini and see if it helps. php -v does show it first, if that matters, but I'll try anything.

I think I have the ruby socket server enabled now. We just have to wait for Stephanie to re-enable the chat button on the site so we can try it and monitor it.

The other day, when there were 6 or 7 people in chat and not much else going on the load was 29.something. It was ridiculous.

-David

DavidX

ok, you think I need to write a script to start the ruby socket server? That's easy enough to do, I guess I can just write an /etc/init.d script and start it from there.

Is there a better place to put shell commands that will run automatically when smf starts/stops/restarts?

Thanks again. Thanks for bearing with my lack of smf/php knowledge.

-David

DavidX

I moved the eaccelerator extension up, so it's first in that section, and it seems to make no difference.


; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"

; zend_extension="/usr/local/lib/php/extensions/eaccelerator.so"
; zend_extension_ts="/usr/local/lib/php/extensions/eaccelerator.so"
extension="eaccelerator.so"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
zend_extension_ts="/usr/local/IonCube/ioncube_loader_lin_5.2_ts.so"
eaccelerator.shm_size="32"
; eaccelerator.shm_size="0"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="1"
eaccelerator.log_file="/tmp/ea/eaccelerator_log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"



-David



青山 素子

Do you need Zend Optimnizer loaded? If you aren't running any scripts encoded with Zend Guard, you don't need it. Likewise, you don't need IonCube if you aren't running any IonCube encoded scripts.

The reason most accelerator products have problems with Zend Optmizer installed is because ZO has to protect itself from attempts to get an unencoded script source of an encoded script. That is why load order is often important.

As for multiple php.ini files, some installations allow a custom version to be loaded by the site itself, so the server could be configured that way. You need to know what file is being read, so make sure to load a phpinfo page via the site and check which one is being used for the website.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Filipina

#28
Thank you Motoko-chan, Phalloidium and DavidX.  The socket server appears to be having a definite impact on the server load. With 5 or 6 people in the Ajax Chat the load is hanging around 1.25 to 1.60 which is about half what is was before. I still want to get it lower however.

I gave my host a link to this thread for information and they have been working to try and get the eaccelerator working which should further improve things. They are still struggling with it but the fact that they are still trying and want to get it running is a good sign. I want to check back again after they get it running (if they get it running) to give a final report. :)   

Filipina

Final word from my host below on eAccelerator after spending a lot of time on it.  I guess that means they are done trying :)

After some research it looks like eAccelerator will not function properly when
suphp is enabled which is the case with your server.

Filipina

My host advised me to give apc a shot and forget the eAccelerator with suphp. So I have taken their advice and let them install the apc. So far so good and it doesn't seem to be causing any issues with apache. I will see what happens when the Ajax chat is in use. Thanks again for all the advice and assistance.

Tiribulus

I'm reading there may be issues with APC and suphp too, but I don't personally know. I posted this before, but removed it because I forgot you were dealing with eaccelerator and not APC. Put the attached file in the root of your forum if you haven't already and point your browser at it. It will tell you what APC is doing.


Vekseid

suPHP still suffers from the same limitation that standard CGI does - php processes do not persist between calls. In such instances APC, eAccelerator, and XCache are all worse than worthless - you load additional overhead, adding to an opcode cache that isn't going to stick around for the next call.

You can probably get some more performance out of your scripts by making sure that your appropriate partitions are mounted as noatime. MySQL may be tuned a bit further, but that's obviously not causing most of your load at this point.

You can get some more mileage by custom-compiling php, and ignoring my advice in my LAMP configuration - you may actually get significant benefit from -Os over -O2.
Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

Tyrsson

Is this issue solved or do you still require assistance?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Advertisement: