How to get a rough estimate of the capabilities of the LAMP application?

I have a LAMP application that works fine, however the number of users is increasing every day. One morning, I do not want to be surprised by surprise, and found that everything had broken due to overload. Is there any way to get a rough estimate of what capacity the LAMP is in?

I know that a full detailed report is a lot of books worth studying, but can I get a quick litmus test to make sure everything is working fine.

So tell me for the mysql component, how can I tell how much more load might be required? Is it 30% power, 50%? etc.

Same thing for my Apache. Although I feel like the DB will die before Apache.


Perhaps my original was not very good, as English is not my native language. What I'm really asking is a way to measure the load of current . And then you have a way to evaluate, based on this load, how far I can go before it fails. (And this needs to be done separately for each component, mysqld, httpd)

+6
source share
2 answers

For the current load, there are a few things you can do. The most expensive, but most detailed answers will be provided through a corporate application such as Gomez.

, , . , : htop, top, w Apache

:

, , .

, :

httpd ram + php + mysql =

, .

Apache "ab".

"ab - HTTP- Apache Hypertext Transfer Protocol (HTTP). , , Apache. , Apache ". http://httpd.apache.org/docs/2.0/programs/ab.html

"ab":

ab -n 10 -c 1 http://www.yoursite.com/
# qty 10 total requests, 1 request at a time

, () - . , AP Apache, PHP MySQL , .

, , , vmstat top iostat ps, .., , .

, Xdebug. php- . http://xdebug.org/

IBM Xdebug:

http://www.ibm.com/developerworks/opensource/library/os-php-fastapps2/

+4

ab , cookie .., ab .

, PHP-, :

1) MySQL

MySQL, Facebook Flickr, ( MySQL ), GOTCHAS, :

  • MyISAM, , 100 ( ),

, , , " ". , > 100 -, micro-half-pizzabox Via C7, , Celeron 300, , Xeon, .

, , MySQL, , :

  • 10 ( 300 -)
  • 0,1 - 0,2
  • MyISAM,

=> ( MyISAM) . 1 100%, 7 , loadavg> 1000 (, apache), > 30 , .

: , 2) , InnoDB, lighttpd. loadavg 0,02

2)

. 1 , . MyISAM . InnoDB, , -.

3) FULLTEXT

  • MyISAM - - .
  • MyISAM , ( , : , , MyISAM MySQL , " ", )
  • InnoDB
  • FULLTEXT ( , 400 )

==> , , Sphinx Xapian.

( ), Xapian 4 .

4) Apache.

.

, lighttpd, ( Via C7 100 HTTP-/, lighttpd 1% ), apache .

MySQL ( ), F5, 1000 Apache, PHP, PHP MySQL, MyISAM, , - , , - - 1000 apache 1000 php 1000 mysql.

Lighttpd . , lighttpd , - apachebench 20K /. Lighttpd , , 10 php-fcgi (2-4 - ), MySQL. , , .

, SQL. PHP-, ( ) , , PHP ( / ) - ).

( ) , MySQL 3 , PHP - 3 , . , PHP.

+5

All Articles