News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Fresh SMF or Tweaking

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

Previous topic - Next topic

Filipina

Hello all. I have been having performance issues and decided to try many of the optimizing tips here. The results have been mixed and I am wondering whether to just do a fresh install of SMF and let an expert replace the 50 or so MODS one by one in the correct order. Well, I am going to to a fresh install at some point but until then can I do anything to improve my Server load?  Here is a little information.

VPS hosting Operating System: CentOS release 4.7 (Final) 
Processor: Dual-Core AMD Opteron(tm) Processor 2212 (488.442MHz)

112886 Posts in 10010 Topics by 3042 Members. Page views per month show at 900,000 but some of this must be bots. Highest users online is only like 35 or 40 at any single moment.  I do have SMF Gallery Pro with about 4500 images and Ajax Integrated chat with Shoutbox (disabled). I know the chat is an issue but my members like it and i was hoping to save it with other improvements.

What have I done so far? Here is what i have done based on the performance tips mentioned.

Move your uploaded avatars directory. YES
Disable hostname lookups. YES
Enable gzip compression. YES
Tune topics, members, and posts per page. YES
Run the mark read for inactive users script periodically. YES
Do you really need that many boards? YES/Decreased Boards
Converting Tables to InnoDB - YES/Host did it
"thread_cache_size=286" and "table_cache=1024" - Host did this for me.

Load Averages are usually hanging around 1.00 or less with no one in chat but once chat comes into play I see this type of Load

MY STATUS PAGE

Load averages: 4.66, 3.72, 2.70
33 people on the site
8 people in ajax chat

Load averages: 3.50, 3.53, 2.82
33 people on the site
6 people in ajax chat

Load averages: 4.24, 4.27, 3.62
31 people on site
7 people in ajax chat.

Load averages: 1.32, 1.47, 1.43
21 people on site
3 people in ajax chat.

So can anyone looking at my status page tell me if their is anything that they would try and adjust to improve performance? I understand only so much can be done when running chat but anything would help.  Thanks :)

showbiz2

You have something else going on, those load averages are very high.
Spam and insanity.

Filipina

chat now empty two recent checks  (Load averages: 1.19, 0.88, 1.09) and (Load averages: 0.62, 0.77, 1.04)

haschi

Hi!

Can you post your my.cnf and apache2.conf/httpd.conf?

Something like that

See if you can increase the speed of your CPU.

Filipina

#5
thanks haschi and Phalloidium for responding

1) my.cnf I believe this is below
2) I cannot locate this apache2.conf/httpd.conf can you give me a clue where it is?

EDIT: could it be ----->  /usr/local/apache/conf/httpd.conf  <<---- if that is it tell me what to display here because it is a lot of information :)   

3) Does my host increase the speed of my CPU?

Thanks again for any assistance

[mysqld]
skip-bdb
#skip-innodb
thread_cache_size=286
innodb_buffer_pool_size = 8M
max_connections = 150
safe-show-database
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 1024
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
wait_timeout = 30
query_cache_size=64M
table_cache=1024
long_query_time=5
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

Tiribulus

#6
You might get some hints about the performance impact of the construction of your site HERE

BTW, I know this isn't going to solve your problem, but just another possible wrench in the toolbox.

Something like that

I'd look into installing a PHP accelerator. That should dramatically reduce your load with AJAX Chat. I use APC, but I hear it's not the best when using Apache. Perhaps someone else can recommend something? Anyway, that should cut your load roughly in half.

I recommend changing
innodb_buffer_pool_size = 8M
to
innodb_buffer_pool_size = 64M
for your configuration. That will speed up quite a bit of things once you restart MySQL.

Tiribulus

This is just my view, but I would rather figure out how to boost this install before starting over if it were me. Otherwise you'll probably wind up in this same boat in the future.

Filipina

#9
Thanks for the input everyone. Well the loads are running good (under 0.50) with zero in chat. My host quickly changed the  innodb_buffer_pool_size = 64M as suggested and thanks for that. :)

However with about 35 users and 6 in chat I am getting these numbers Load averages: 3.67, 3.45, 2.79, 5 in chat Load averages: 2.94, 2.93, 2.82, 7 in chat Load averages: 2.56, 2.57, 2.70. i know this is still too high but not horrible. 

Any other tweaks to suggest?

Also, the PHP accelerator is something I am willing to try but you mentioned APC might not be good with Apache, so I am looking for more feedback on this from anyone?

Tiribulus thanks for the link it is another tool for me to use and try and improve things

Something like that

Remember that most users browsing your site will call PHP scripts about once a minute.

Each user using AJAX Chat calls an update at least every 2 seconds. Thus a user in AJAX Chat is roughly equivalent to 30 users browsing your site.

I believe eAccelerator works well with Apache. See if you can get your host to follow the instructions on this page for you: http://www.leigeber.com/2008/04/eaccelerator-php-accelerator/

I'd follow everything exactly, except the part when it comes to editing the php.ini file. Where the linked configuration document suggests eaccelerator.shm_size="16", use eaccelerator.shm_size="30". That'll make the cache a bit bigger so it can hold more stuff (especially handy if you have things other than SMF and AJAX Chat on your VPS).

I can't make any promises, but installing eAccelerator should cut your load in at least half.

Tiribulus

You mean to tell me that after everything I went through getting APC to run on this machine that isn't good for use with Apache? Say it ain't so or I'll jump :P It did undeniably give me an instant boost by quite a bit though.

Something like that

APC can be a little trickier from what I understand, regarding shared memory between Apache processes.

Tiribulus

Quote from: Phalloidium on March 25, 2009, 03:49:05 PM
APC can be a little trickier from what I understand, regarding shared memory between Apache processes.

Trickier to get running or trickier in the way it operates?

I don't wanna sidetrack this thread as there's no doubt that some PHP accelerator will be a huge improvement for this lady. I'm just wondering because somewhere on these boards they recommended APC for use with SMF, at least I thought that's what I read. I'm not arguing, you have way more experience with these things than I do, jist thinkin out loud.

Filipina

Phalloidium thanks again for the suggestion. I know one thing for sure without the Ajax Chat the server load is always pretty under control.  If I want to keep the chat then I need to try something like this. I have put in a ticket to my host and asked about it. They have been great (liquidweb) for my main site and I cannot say enough about their customer service. I just know at some point they might say "ok bud enough is enough you need some hired help" LOL but heck I doesn't hurt to ask. Maybe they have already had experience with eAccelerator and it will be a piece of cake for them. I will know shortly because they always respond in under 10 minutes :)   

Something like that

And so? What did they say?

It sounds like you've found yourself a decent host :)

Filipina

#16
They install it for me and even use the suggested eaccelerator.shm_size="30.  They are really great and will do anything for you. Additionally, I had someone fix a lot of coding errors which were piling up my error log 300 per minute :)  Last time I check no errors in an hour :)

Ok bad news is it does not seem to be working. Last check with 6 people in ajax chat and 30 people on the site I see numbers like these  Load averages: 3.57, 3.80, 3.19 ... or 5 people in chat plus 30 people on site Load averages: 2.57, 3.58, 3.34 ...... pretty much the same as before and too high I think. 

If you check my status page above I think you can see where they install it.  So not sure what else I can do :)

Something like that

Can you save this file and put it where I can access it? Call it phpinfo.php


<?php
phpinfo
();
?>



That will let us know if it's working.

Filipina

#18
Thanks Phalloidium you should have access to this now. It still looks like some of my caches are still underutilized to me.

Table cache usage:
(table_cache)  0.2334 (should be >= 0.5 and <= 0.9) 

Thread cache usage:
(thread_cache_size)  0.042 (should be >= 0.7 and <= 0.9)

Filipina

Phalloidium as far as I can tell it appears enabled in php.ini ?

[root@host log]# php -v
PHP 5.2.8 (cli) (built: Mar 26 2009 02:27:57) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd., and
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
[root@host log]#

Advertisement: