| 
	
 | 
 Posted by NC on 10/10/07 00:01 
On Oct 9, 9:10 am, Gilles Ganault <nos...@nospam.com> wrote: 
> 
> A friend of mine is running a LAMP (PHP, MySQL, Apache, 
> Debian) Web 2.0 site on a dedicated, hosted server with 
> about 300 connected users when it's really busy. 
> 
> The server is an Intel Celeron 2.4 GHz with 1GB of RAM, 
> a 40GB IDE drive, and a 10Mbps bandwith. 
> 
> Here's what top says: 
> 
> Tasks: 196 total, 6 running, 181 sleeping, 8 stopped, 1 zombie 
> Cpu(s): 71.6% us, 8.6% sy, 0.0% ni, 58.0% id, 0.8% wa, 0.3% hi, 
> 0.7% si 
> Mem: 1023656k total, 963348k used, 60308k free, 119612k buffers 
> Swap: 514040k total, 0k used, 514040k free, 484324k cached 
> 
> The site is too slow in the evenings, but we don't have 
> the skills to check why and what can be done about it. 
 
You should consider hiring someone with the skills to give you a 
definite answer.  Here in the newsgroup, we can hypothesize until we 
turn blue, but only actual hands-on work with your application can 
tell if the hypotheses we advance are anywhere near reality. 
 
> What things would you try to see where the bottlenecks are? 
> Is there some kind of check-list that we could go through? 
 
Since your problems seem to arise during peak hours, and neither 
memory nor CPU seems to be overloaded, a natural first guess is that 
the holdup is with disk I/O, more specifically, in the database 
interaction.  What to do about it will depend on your database usage 
patterns.  If your application is write-intensive, you may be nearing 
your hardware's capacity, and the only way to improve performance is 
to upgrade the hardware (do check the UPDATE queries though; you may 
be able to improve their performance by optimizing them).  If your 
application is not write-intensive, there are several possible avenues 
to pursue: (1) optimize SELECT queries (adding an index here and there 
may be necessary), (2) turn on query cache (which may help if you have 
a news site, but not likely to improve things if you have a social 
networking site), (3) increase mysql.max_links (which in turn will 
increase your memory requirements).  Do check your MySQL connection 
method just in case; the best performance on a single server is 
achieved by using socket connection rather than a TCP/IP connection. 
 
Cheers, 
NC
 
  
Navigation:
[Reply to this message] 
 |