View Full Version : Freebsd for a very busy server?
arya6000
November 25th, 2008, 17:10
Hi
I currenttly have a busy website on a dedicated server running on Linux, and sometimes the site becomes extremely slow that it gets unusable. Would switching to freebsd make the site load faster at busy times compared to linux?
Thank You
anomie
November 25th, 2008, 17:18
I'd say: you need to identify the bottleneck first. ;)
cajunman4life
November 25th, 2008, 17:40
I'd first check the network. Is the network being saturated with requests?
I'd then try to keep a terminal open to the system with top running, and wait for the busy time to come. If your load average goes much higher than the number of processors you have, you'll need to look at a higher speced server.
Also, is this site dynamic (ie PHP with a MySQL back end) or static HTML files? This will make a huge difference.
SaveTheRbtz
November 25th, 2008, 17:55
Cache, replicate and shard, my friend. FreeBSD is not a solution, it's a tool.
PS. And don't forget profiling your code.
PPS. APC (http://ru2.php.net/apc) Memcahed (http://www.danga.com/memcached/) mysqlproxy (http://forge.mysql.com/wiki/MySQL_Proxy)
arya6000
November 25th, 2008, 18:01
I'd first check the network. Is the network being saturated with requests?
I'd then try to keep a terminal open to the system with top running, and wait for the busy time to come. If your load average goes much higher than the number of processors you have, you'll need to look at a higher speced server.
Also, is this site dynamic (ie PHP with a MySQL back end) or static HTML files? This will make a huge difference.
I can't find out what is casing the problem, sometimes the load is on 10 and paged load fast and other times the load is about 3 and pages load very slow. Is there any way to find out its network being saturated with requests?
businessgeeks
November 26th, 2008, 14:48
I've had some experience in configuring freebsd servers as webservers and from what i've different types of websites will require different ways of building the AMP (apache, mysql, php) stack or in some cases LMP (lighttpd, mysql, php) can you describe your webserver stack? and what type of site is it hosting? media sharing (ala youtube)? wiki?
SirDice
November 26th, 2008, 15:56
Is there any way to find out its network being saturated with requests?
Ask your hosting provider, they should be able to tell you.
arya6000
November 26th, 2008, 19:38
Ask your hosting provider, they should be able to tell you.
When I checked top, I noticed mysql uses 80% of the cpu some times, could that be the cause?
Mel_Flynn
November 26th, 2008, 20:05
Yep, that's a very good cause, especially with ext3 filesystems.
Look into MySQL's Slow query log (http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html).
Chances are one (or more) queries must use temporary tables to form an intermediate result set, for ordering and sorting.
If the result set is large, then this will be written to the tmpdir value in your my.cnf (or /tmp by default). This can cascade into more troubles with ext3 systems, cause it will try to memory journal the writes until out of memory, then flush everything blocking writes in the meantime.
gjournal is a bit smarter.
However, it can also be the number of connections. `mysqladmin processlist' at the time of high usage should give you an idea.
SirDice
November 26th, 2008, 20:30
When I checked top, I noticed mysql uses 80% of the cpu some times, could that be the cause?
Oh.. What type of databases do you use and on what type of filesystem?
MyISAM performs best on regular filesystem (with filesystem cache), while InnoDB performs best on a raw disk (no filesystem cache).
Search for a script called mytop. It's a top for mysql, quite handy to see what's going on.
As Mel_Flynn also noted check your slow query log.
danger@
November 26th, 2008, 21:47
Sounds like I/O bottleneck...
mirnshi
November 27th, 2008, 04:45
When I checked top, I noticed mysql uses 80% of the cpu some times, could that be the cause?
tune your mysql.
1. use mysqldumpslow to summarize the slowest sql.
2. tune the parameters in your my.cnf
Mel_Flynn
November 27th, 2008, 05:00
tune your mysql.
1. use mysqldumpslow to summarize the slowest sql.
2. tune the parameters in your my.cnf
Tune for what? I/O bottleneck is likely, so is bad queries, so is queries that require locking tables, combined with high volume site, cascading into a lot of connections continually having said tables locked.
For the latter, the best "tuning" is adding a second/third MySQL server, setup replication and distributing your reads across the slave server.
IT_Architect
January 2nd, 2009, 15:56
Hi
I currenttly have a busy website on a dedicated server running on Linux, and sometimes the site becomes extremely slow that it gets unusable. Would switching to freebsd make the site load faster at busy times compared to linux? Thank You
You best believe it. We learned the hard way. Start with FreeBSD and tweak from there. When it comes to performance under heavy load Linux is a joke. We made the switch and will NEVER go back. It's the learning curve you won't like. The shortcut is to read the FreeBSD manual. If anyone can make Linux perform like FreeBSD, please train Real Web Host, Rackspace, and Servstra. Also, the best tweaker for your server is YOU, not the "experts". You will get FAR more performance out of the hardware. It is not possible to tweak a server without it being under a real-world load. It's the only time you can KNOW the results of your changes and balance CPU to memory etc. Apache 2.2x will annihilate 1.3x, and if you are using PHP, eAccelerator is the fastest and most stable, not Xcache nor APC, and eAccelerator is the only one that will co-exist with Zend Optimizer and ionCube at the same time, important if you are doing hosting.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.