Help me optimize

Started by Andrew, March 11, 2006, 04:36:27 PM

Previous topic - Next topic

Andrew

SMF Version: SMF 1.1 RC1
I'm still a novice when it comes to server configuration, and I've been having some trouble lately.  I know there are some things I can do to optimize my system, and I'm looking for recommendations and maybe some help with the more advanced tasks.

Here's some basics:
    * http://www.lawschooldiscussion.org/status.php
    * http://www.lawschooldiscussion.org/phpinfo.php
    * Nearly 1M posts
    * Typical number of users at peak times over 15 mins: 300ish

I've already upgraded my php, but I can't figure out how to upgrade MySQL (using Cpanel).  I haven't installed eAccelerator because I don't know how.  I believe I have converted at least some tables to InnoDB.

Server has 1GB of memory.  I would consider upgrading this if it would make a big difference.  I haven't tweaked any MySQL settings.

Any suggestions / help would be appreciated.  Thanks.

Andrew

I upgraded MySQL to 4.1.x.  It caused a huge problem (something went wrong in the upgrade) and my site was down for a torturous day.  It's working again now so I have a renewed ambition to optimize.  The site has been crashing lately and needs some tweaking I think.  Any help is much appreciated.

Ben_S

Will have a look tomorrow when MySQL have been running for a sufficiently long time to give decent readings.
Liverpool FC Forum with 14 million+ posts.

Ben_S

Can you post the answers to these questions

README: Requesting help with server configuration.

Also what is the current contents of your /etc/my.cnf
Liverpool FC Forum with 14 million+ posts.

Andrew

/etc/my.cnf says:

Quote[mysqld]
set-variable = max_connections=500
safe-show-database

    * A link to your forum:     http://www.lawschooldiscussion.org/prelaw/
    * A link to your status.php: http://www.lawschooldiscussion.org/status.php
    * a link to your phpinfo.php - http://www.lawschooldiscussion.org/phpinfo.php
    * Is this a dedicated server or shared host: Dedicated Dual Xeon 2.8GHz - 2GB RAM (I thought it was just 1, but I just checked) - RedHat 3.0.  The server runs a couple other sites, but they're low traffic and not processor intensive.
    * The Number of posts your forum has: almost 1M
    * The Average number of users you have online during peak time and over what time period that is over: today peaked at around 400
    * A list of mods which you have installed: none, but I use custom templates
    * Do you still have performance issues if you use the default theme: I can't test this - have to keep my theme
    * A list of the suggestions you have already implemented from the README: php upgrade to 5.0, MySQL upgrade to 4.1, InnoDB (I think, unless it gets reversed somehow, I did it once)

Problems continued today - I get this error frequently:
QuotePHP Fatal error:  Only variables can be passed by reference in /home/lawschoo/public_html/prelaw/Sources/Display.php on line 996

I also got several httpd failure errors - with automatic restarts that seem to work.

Ben_S

Try this as your my.cnf and see if it helps

[mysqld]
thread_cache_size=150
key_buffer=64M

sort_buffer_size=2M
join_buffer_size = 1M
read_buffer_size = 1M

skip-locking

query_cache_limit=4M
query_cache_size=128M
query_cache_type=1

max_connections=500
wait_timeout = 180
connect_timeout = 50

max_allowed_packet=64M
table_cache=1800


Also if you havent already, install eAccelerator or APC.

The error you are getting is a php5 problem, you may want to upgrade to 1.1 RC2, but it's a long upgrade and will take a lot of hours to complete, if you do it make sure to backup first.
Liverpool FC Forum with 14 million+ posts.

Andrew

Thanks - I tried this and I think it helped, but currently my httpd fails every day as traffic gets high.  That still happened today despite the change.  I haven't installed eAccelerator because it looks difficult (for me - a novice) to install.  I may have some time this weekend to try it.  I will also upgrade to RC2 to fix the PHP fatal error - I just have to wait until the weekend when traffic slows a little.

Any ideas as to why httpd is failing?

Ben_S

Anything in the apache error log?
Liverpool FC Forum with 14 million+ posts.

Andrew

I can only see the last 300 errors, and they're all too recent to be connected to the httpd failure problem. They're mostly 404s for a missing file required by an old style sheet.  The only other errors are the php error already mentioned.

Andrew

The httpd failures have stopped.

My site is running very well now.  I think the upgrade to 1.1 RC2 made the biggest difference.  I also installed APC and I think that has helped a lot.  I no longer have high server loads, httpd failures, or pages that take longer than 1 sec to create.  Most pages are created in .0x seconds.

Thanks for all the help!

Ben_S

Glad you got everything running well, if you havent already, enable caching through admin > server settings > caching
Liverpool FC Forum with 14 million+ posts.

Advertisement: