Welcome to WebmasterWorld Guest from 107.22.87.205

Forum Moderators: open

Message Too Old, No Replies

one server or two servers

for my website

     
2:17 pm on Dec 17, 2006 (gmt 0)

10+ Year Member



I am hosting a fairly busy website from a single box for about an year. That is the only website residing on this server and serves about 3 million pages a month with upto 250-800 online users at any given point of time.

With some recent outages due to high load, I am considering upgrading the hardware (along with software optimisation). I am stuck between the options of having a new single more powerful box or to split the database server and webserver. If I go for the latter I am considering using the current box as database server and getting a new cheap webserver.

My current box is Dual AMD Opteron 244 with 4 GB RAM and SCSI drives in RAID 0.

Any advice would be much appreciated.

4:55 pm on Dec 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you be sure if the hardware box is dropping out or is it the network?

Have you done any tuning of the O/S, Apache and MySQL? (assumed this is what you have)

Out of the box those apps are not efficient. You may need to adjust parameters for best effect.

There are many simple things you can do such as turning off atime for the disks. This is often on by default and is a damn crazy thing to have.

Have a secondary disk in there for all your temp and log files. If a database is reading from the same disk that it creates temp files and / or apache is writing log files this is another crazy situation.

Assuming PHP where are your session files stored? The disk? Again - crazy! Set the sessions to use /dev/shm.

Presumably you have looked at your indexes and caching of MySQL?

So much could be done via tuning before the need to upgrade. I'm not saying you don't need to upgrade just that you need to ensure your server is set up efficiently first.

1:25 am on Dec 18, 2006 (gmt 0)

10+ Year Member



What software package(s) are you running?
2:35 am on Dec 18, 2006 (gmt 0)

10+ Year Member



Can you be sure if the hardware box is dropping out or is it the network?

I am with a very reliable host with well connected datacenter, so network should not be a problem.

Have you done any tuning of the O/S, Apache and MySQL?

I am running php as an apache module with MMcache and zend optimiser. I might replace MMCache with eaccelerator as MMcache is no longer supported, though I am not sure whether it would give me any extra speed advantages. I am also using second level cache system for the html output. Most of the dynamic pages in my website are served from this html cache. Without it the site would just freeze under the load.

There are many simple things you can do such as turning off atime for the disks. This is often on by default and is a damn crazy thing to have.

Thanks for the suggestion. I am quite naive in hardware issues. This is the first time I am hearing about this. Perhaps I should ask my host about it.

Have a secondary disk in there for all your temp and log files. If a database is reading from the same disk that it creates temp files and / or apache is writing log files this is another crazy situation.

Assuming PHP where are your session files stored? The disk? Again - crazy! Set the sessions to use /dev/shm.

Interesting suggestions. I don't think I am doing this. May be this is something I should be looking into straight away.

Presumably you have looked at your indexes and caching of MySQL?

Thats the first thing I did as my CMS generates a lot of select queries and it did result in a noticeable improvement in server load.

2:40 am on Dec 18, 2006 (gmt 0)

10+ Year Member



What software package(s) are you running?

Well it is a highly customised CMS based on a popular open source php/my sql cms. A moderately sized phpbb forum (350k records) and a moderately sized phorum (100k records) is integrated in the system. Thats the only thing I have on the box.

10:46 am on Dec 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would definitely recommend having a secondary disk put in there. This would not be part of the raid channel - it doesn't need to be raid itself. This disk would be purely for all the ancillary stuff like temp files and logs.
Move all your system log files to /secondary/var/log

e.g.

/secondary/var/log/syslog
/secondary/var/log/secure
/secondary/var/log/messages
/secondary/var/log/httpd/access_log
/secondary/var/log/httpd/error_log

create /secondary/temp and /secondary/tmp directories

in your my.cnf file set mysql to use the /secondary/tmp dir Note that you may have to ensure the dirs have the correct rights else mysql will stop.

eaccelerator is fine but again don't let it create it's caches on disk - use shm. In php.ini set

eaccelerator.shm_only="1"

Google for articles such as

optimizing linux
In particular you want to make sure your file system is not slowing you down doing things like recording atime. Previously it was advantageous to check the results of hdparm to see if your disk could be tuned but with more modern disks, motherboards and recent O/S's this has already been done.

optimizing php, apache, mysql etc.

Most of these will be concerned with memory. The tendancy is to to give MySQL all the memory but that then reduces the amount of memory Linux has for caching which can cause too much swapping.

Install MySysop available from forge.mysql.com This is a great app which shows your main variable and suggests how they should be tweaked.

I'm pretty sure you will see performance gains just by adding the ancillary disk and by these simple tweaks. You still may need to upgrade in the future but at least you will know that your hardware is working more efficiently for you.

[edited by: Frank_Rizzo at 10:49 am (utc) on Dec. 18, 2006]

1:33 pm on Dec 21, 2006 (gmt 0)

10+ Year Member



I've been running a forum based site with 5.5 million pageviews per month, 2000 members online at any time on a P3 1.6Ghz machine with only a few problems. We've now upgraded to a Xeon 3Ghz machine with 2Gb and its flying!

Highly tuned, mysql optimised loads (this makes the most difference in my opinion).

Ben

2:42 am on Dec 30, 2006 (gmt 0)

10+ Year Member



I don't really have anything constructive to add other than to ask why you settled on RAID 0? This essentially doubles your exposure to drive failure, and complete loss of data. I know that the I/O is higher, but at such risk...

If it was a typo, please ignore me. :)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month