QPS¡¢PVºÍÐèÒª²¿Êð»úÆ÷ÊýÁ¿¼ÆË㹫ʽ(ת)
ÊõÓï˵Ã÷£º
QPS = req/sec = ÇëÇóÊý/Ãë
¡¾QPS¼ÆËãPVºÍ»úÆ÷µÄ·½Ê½¡¿
QPSͳ¼Æ·½Ê½ [Ò»°ãʹÓà http_load ½øÐÐͳ¼Æ]
QPS = ×ÜÇëÇóÊý / ( ½ø³Ì×ÜÊý * ÇëÇóʱ¼ä )
QPS: µ¥¸ö½ø³ÌÿÃëÇëÇó·þÎñÆ÷µÄ³É¹¦´ÎÊý
µ¥Ì¨·þÎñÆ÷ÿÌìPV¼ÆËã
¹«Ê½1£ºÃ¿Ìì×ÜPV = QPS * 3600 * 6
¹«Ê½2£ºÃ¿Ìì×ÜPV = QPS * 3600 * 8
·þÎñÆ÷¼ÆËã
·þÎñÆ÷ÊýÁ¿ = ceil( ÿÌì×ÜPV / µ¥Ì¨·þÎñÆ÷ÿÌì×ÜPV )
¡¾·åÖµQPSºÍ»úÆ÷¼ÆË㹫ʽ¡¿
ÔÀí£ºÃ¿Ìì80%µÄ·ÃÎʼ¯ÖÐÔÚ20%µÄʱ¼äÀÕâ20%ʱ¼ä½Ð×ö·åֵʱ¼ä
¹«Ê½£º( ×ÜPVÊý * 80% ) / ( ÿÌìÃëÊý * 20% ) = ·åֵʱ¼äÿÃëÇëÇóÊý(QPS)
»úÆ÷£º·åֵʱ¼äÿÃëQPS / µ¥Ì¨»úÆ÷µÄQPS = ÐèÒªµÄ»úÆ÷
ÎÊ£ºÃ¿Ìì300w PV µÄÔÚµ¥Ì¨»úÆ÷ÉÏ£¬Õą̂»úÆ÷ÐèÒª¶àÉÙQPS£¿
´ð£º( 3000000 * 0.8 ) / (86400 * 0.2 ) = 139 (QPS)
ÎÊ£ºÈç¹ûһ̨»úÆ÷µÄQPSÊÇ58£¬ÐèÒª¼¸Ì¨»úÆ÷À´Ö§³Ö£¿
´ð£º139 / 58 = 3
¹ØÓÚ²¢·¢Óû§ÊýºÍQPS£¬×Ô¼ºÒ»Ö±±»ÕâÁ½¸ö¸ÅÄî¾À½á£¬ÔĶÁÁËÒ»ÏÂÏà¹Ø×ÊÁÏ£¬×ܽáÈçÏ£º²¢·¢Óû§ÊýºÍQPSÁ½¸ö¸ÅÄîûÓÐÖ±½Ó¹Øϵ£¬µ«ÊÇÈç¹ûҪ˵QPSʱ£¬Ò»¶¨ÐèÒªÖ¸Ã÷ÊǶàÉÙ²¢·¢Óû§ÊýϵÄQPS£¬·ñÔòºÀÎÞÒâÒ壬ÒòΪµ¥Óû§ÊýµÄ40QPSºÍ20²¢·¢Óû§ÊýϵÄ40QPSÊÇÁ½¸ö²»Í¬µÄ¸ÅÄǰÕß˵Ã÷¸ÃÓ¦ÓÿÉÒÔÔÚÒ»ÃëÄÚ´®ÐÐÖ´ÐÐ40¸öÇëÇ󣬶øºóÕß˵Ã÷ÔÚ²¢·¢20¸öÇëÇóµÄÇé¿öÏ£¬Ò»ÃëÄÚ¸ÃÓ¦ÓÃÄÜ´¦Àí40¸öÇëÇ󣬵±QPSÏàͬʱ£¬Ô½´óµÄ²¢·¢Óû§Êý£¬´ú±íÁËÍøÕ¾²¢·¢´¦ÀíÄÜÁ¦Ô½ºÃ¡£¶ÔÓÚµ±Ç°µÄweb·þÎñÆ÷£¬Æä´¦Àíµ¥¸öÓû§µÄÇëÇó¿Ï¶¨´Á´ÁÓÐÓ࣬Õâ¸öʱºò»á´æÔÚ×ÊÔ´À˷ѵÄÇé¿ö£¨Ò»·½Ãæ¸Ã·þÎñÆ÷¿ÉÄÜÓжà¸öcpu£¬µ«ÊÇÖ»´¦Àíµ¥¸ö½ø³Ì£¬ÁíÒ»·½Ã棬ÔÚ´¦ÀíÒ»¸ö½ø³ÌÖУ¬ÓÐЩ½×¶Î¿ÉÄÜÊÇIO½×¶Î£¬Õâ¸öʱºò»áÔì³ÉCPUµÈ´ý£¬µ«ÊÇÓÐûÓÐÆäËûÇëÇó½ø³Ì¿ÉÒÔ±»´¦Àí£©¡£¶øµ±²¢·¢ÊýÉèÖõĹý´óʱ£¬Ã¿ÃëÖÓ¶¼»áÓкܶàÇëÇóÐèÒª´¦Àí£¬»áÔì³É½ø³Ì£¨Ị̈߳©Æµ·±Çл»£¬·´ÕýÕæÕýÓÃÓÚ´¦ÀíÇëÇóµÄʱ¼ä±äÉÙ£¬Ã¿ÃëÄܹ»´¦ÀíµÄÇëÇóÊý·´¶ø±äÉÙ£¬Í¬Ê±Óû§µÄÇëÇóµÈ´ýʱ¼äÒ²»á±ä´ó£¬ÉõÖÁ³¬¹ýÓû§µÄÐÄÀíµ×Ïß¡£ËùÒÔÔÚ×îС²¢·¢ÊýºÍ×î´ó²¢·¢ÊýÖ®¼ä£¬Ò»¶¨ÓÐÒ»¸ö×îºÏÊʵIJ¢·¢ÊýÖµ£¬ÔÚ²¢·¢ÊýÏ£¬QPSÄܹ»´ïµ½×î´ó¡£µ«ÊÇ£¬Õâ¸ö²¢·¢²¢·ÇÊÇÒ»¸ö×î¼ÑµÄ²¢·¢£¬ÒòΪµ±QPSµ½´ï×î´óʱµÄ²¢·¢£¬¿ÉÄÜÒѾÔì³ÉÓû§µÄµÈ´ýʱ¼ä±äµÃ³¬¹ýÁËÆä×îÓÅÖµ£¬ËùÒÔ¶ÔÓÚÒ»¸öϵͳ£¬Æä×î¼ÑµÄ²¢·¢Êý£¬Ò»¶¨ÐèÒª½áºÏQPS£¬Óû§µÄµÈ´ýʱ¼äÀ´×ÛºÏÈ·¶¨¡£
ͼ1 ²¢·¢Óû§Êý£¬QPS£¬Óû§Æ½¾ùµÈ´ýʱ¼ä£¨ÏìӦʱ¼ä¹Øϵͼ£©
ÉÏÃæÕâÕÅͼÊÇÓ¦ÓÃÆäËûÈ˵ĹØÓÚ²¢·¢Óû§Êý£¬QPS£¬Óû§Æ½¾ùµÈ´ýʱ¼äµÄÒ»ÕŹØϵͼ£¬¶ÔÓÚʵ¼ÊµÄϵͳ£¬Ò²Ó¦¸ÃÊǶÔÓÚ²»Í¬µÄ²¢·¢Êý£¬½øÐжà´Î²âÊÔ£¬»ñÈ¡µ½ÕâЩÊýÖµºó£¬»³öÕâÑùÒ»ÕÅͼ³öÀ´£¬ÒÔ±ãÓÚ·ÖÎö³öϵͳµÄ×î¼Ñ²¢·¢Óû§Êý¡£
ת×Ô£ºhttp://www.blogjava.net/neverend/archive/2011/01/25/343514.html
ÍƼöÐÅÏ¢
- ¹¹½¨¸ß¿ÉÓú͵¯ÐÔÉìËõµÄKV´æ´¢ÏµÍ³
- ̸̸ÍøÕ¾¾²Ì¬»¯£¨¶þ£©
- ̸̸ÍøÕ¾¾²Ì¬»¯£¨Ò»£©
- Ðì¹úÏ飺΢²©ÊÇ·ñ»á²ÎÓëÍøÕ¾ÅÅÃû
- ApacheÔÚ±¾µØ½¨Á¢·ºÓòÃûÐéÄâÖ÷»ú¼ò·¨
- ÈçºÎ½øÐÐÍøÕ¾Õï¶Ï ΪÍøÕ¾½øÐÐÆÀ·Ö
- Ò»¸ö³É¹¦µÄÕ¾³¤Ó¦¸Ã¾ß±¸µÄËØÖÊ
- Ò»Ìõ΢²©Òý·¢µÄ·ÖÎö£ºÈçºÎÈÃ΢²©µÃµ½¹ã·º´«²¥
- ÈçºÎÈÃÒ»¸öÍøÕ¾ÓÐÇ¿´óÉúÃüÁ¦
- פ×ãIDCÃż÷³Ö±Ò¹ÛÍû Õ¾³¤Ñ¡¹º¿Õ¼ä³É¡°¼èÄѵľö¶¨¡±£¿
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
ÆÀÂÛ