Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Nginx + PHP£¨FastCGI£©¡±Web·þÎñÆ÷

   ÏÂÃæÊÇÓÃ100¸ö²¢·¢Á¬½Ó·Ö±ðȥѹÉú²ú»·¾³ÖÐͬһ¸ºÔؾùºâÆ÷VIPÏ¡¢ÌṩÏàͬ·þÎñµÄÁ½Ì¨·þÎñÆ÷£¬Ò»Ì¨ÎªNginx£¬Áíһ̨ΪApache£¬NginxÿÃë´¦ÀíµÄÇëÇóÊýÊÇApacheµÄÁ½±¶¶à£¬Nginx·þÎñÆ÷µÄϵͳ¸ºÔØ¡¢CPUʹÓÃÂÊÔ¶µÍÓÚApache£º
¡¡¡¡Äã¿ÉÒÔ½«Á¬½ÓÊý¿ªµ½10000¡«30000£¬È¥Ñ¹NginxºÍApacheÉϵÄphpinfo.php£¬ÕâÊÇÓÃä¯ÀÀÆ÷·ÃÎÊNginxÉϵÄphpinfo.phpÒ»ÇÐÕý³££¬¶ø·ÃÎÊApache·þÎñÆ÷µÄphpinfo.php£¬ÔòÊǸÃÒ³ÎÞ·¨ÏÔʾ¡£4GÄÚ´æµÄ·þÎñÆ÷£¬¼´Ê¹ÔÙÓÅ»¯£¬ApacheÒ²ºÜÄÑÔÚ“webbench -c 30000 -t 60 http://xxx.xxx.xxx.xxx/phpinfo.php”µÄѹÁ¦Çé¿öÏÂÕý³£·ÃÎÊ£¬¶øµ÷Õû²ÎÊýÓÅ»¯ºóµÄNginx¿ÉÒÔ¡£
¡¡¡¡webbench ÏÂÔصØÖ·£ºhttp://blog.s135.com/post/288/
¡¡¡¡×¢Ò⣺webbench ×öѹÁ¦²âÊÔʱ£¬¸ÃÈí¼þ×ÔÉíÒ²»áÏûºÄCPUºÍÄÚ´æ×ÊÔ´£¬ÎªÁ˲âÊÔ׼ȷ£¬Ç뽫 webbench °²×°ÔÚ±ðµÄ·þÎñÆ÷ÉÏ¡£
¡¡¡¡²âÊÔ½á¹û£º##### Nginx + PHP #####
ÒýÓÃ
[root@localhost webbench-1.5]# webbench -c 100 -t 30 http://192.168.1.21/phpinfo.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.1.49/phpinfo.php
100 clients, running 30 sec.
Speed=102450 pages/min, 16490596 bytes/sec.
Requests: 51225 susceed, 0 failed.
top - 14:06:13 up 27 days,  2:25,  2 users,  load average: 14.57, 9.89, 6.51
Tasks: 287 total,   4 running, 283 sleeping,   0 stopped,   0 zombie
Cpu(s): 49.9% us,  6.7% sy,  0.0% ni, 41.4% id,  1.1% wa,  0.1% hi,  0.8% si
Mem:   6230016k total,  2959468k used,  3270548k free,   635992k buffers
Swap:  2031608k total,     3696k used,  2027912k free,  1231444k cached
¡¡¡¡²âÊÔ½á¹û£º#####  Apache + PHP #####
ÒýÓÃ
[root@localhost webbench-1.5]# webbench -c 100 -t 30 http://192.168.1.27/phpinfo.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.1.45/phpinfo.php
100 clients, running 30 sec.
Speed=42184 pages/min, 31512914 bytes/sec.
Requests: 2109


Ïà¹ØÎĵµ£º

9Ô±à³ÌÓïÑÔÅÅÐаñ£ºPHPµÄÀúÊ·ÐÔÍ»ÆÆ

9ÔÂ6ÈÕÏûÏ¢£¬Tiobe½ñÌì·¢²¼ÁË2009Äê9Ôµıà³ÌÓïÑÔÅÅÐаñ£¬PHPÔÚ±¾ÆÚ°ñµ¥ÖлñµÃÀúÊ·ÐÔÍ»ÆÆ£¬ÒÔ½üÒ»¸ö°Ù·ÖµãµÄÔö·ù³É¹¦½øÈëÇ°ÈýÃû£¬C++ϽµÒ»Î»£¬ÅÅÃûµÚËÄ¡£±¾ÆÚ±à³ÌÓïÑÔÅÅÐаñ£¬ÎÒÃǽ«»Ø¹ËPHPµÄ³É³¤£¬·ÖÎöPHPµÄ·¢Õ¹Ç°¾°¡£
±¾ÆÚ±à³Ì°ñÇ°¶þÊ®Ãû°ñµ¥
¼òµ¥Ö®µÀ
1994Ä꣬Rasmus Lerdorf²¢Ã»Ïëµ½×Ô¼ºÎªÁËά»¤¸öÈËÍøÒ³¶ø·¢Ã÷µÄ½Å ......

jsp,ASP,PHPµÄ±È½Ï

      ºÜ¶àSOHOER¶¼Ï£ÍûÓиö×Ô¼ºµÄÍøÕ¾,¶ø¶ÔÍøÕ¾½¨ÉèÒ»ÎÞËùÖª,»òÕßÒ»Öª°ë½â.½ñÌìÎÒÏȽ²³ÌÐò·½ÃæµÄÇø±ð,ÏàÐźܶàÈËÅöµ½ÁËÓÐЩ¹«Ë¾Ëµphp±ÈAsp,Asp.Net¶¼ÒªºÃ,»òÕßAsp±ÈÆäËûÓïÑÔ¶¼ÒªºÃ¡£Æäʵ,³ÌÐòµÄÓÅÂÔÓëÍøÕ¾¿ª·¢ÈËÔ±µÄ¾­Ñé\¼¼ÊõˮƽÏà¹Ø£¬¶øÓïÑÔ±¾Éí²¢Ã»ÓÐʲôÓÅÂÔÖ®·Ö.¾­Ñé¶àµÄ³ÌÐòÔ±,²»¹ÜʹÓõÄÄ ......

php strip_tagsº¯Êý

strip_tags
È¥µô HTML ¼° PHP µÄ±ê¼Ç¡£
Óï·¨: string strip_tags(string str);
·µ»ØÖµ: ×Ö·û´®
±¾º¯Êý¿ÉÈ¥µô×Ö·û´®Öаüº¬µÄÈκΠHTML ¼° PHP µÄ±ê¼Ç×Ö·û´®¡£ÈôÊÇ×Ö·û´®µÄ HTML ¼° PHP ±êÇ©Ô­À´¾ÍÓÐ´í£¬ÀýÈçÉÙÁË´óÓڵķûºÅ£¬ÔòÒ²»á·µ»Ø´íÎ󡣶ø±¾º¯ÊýºÍ fgetss() ÓÐ×ÅÏàͬµÄ¹¦ÄÜ
//×¢
strip Ó¢[strip]
vi. 1. Íѹâ ......

PHP MKTIME

ͻȻÏëÆðÁËÔÚÒ»´ÎÃæÊÔµÄʱºòÒªÎÒд³öδÀ´Ò»ÌìÊÇÐÇÆÚ¼¸£¬µ±Ê±Ã»Óиøд³öÀ´¡£ÏÖÔÚÏëÏ뻹ÊǾõµÃ¶ÔdateºÍmktimeµÄ¸ÅÄîºÜÄ£ºý£¬ÔÚÕâÀï¼Ç¼ÏÂÒÔ±¸ºóÓ㺳ÌÐòÈçÏÂ
<?php
echo date( "l dS 0f F Y h£ºi£ºs A" );
echo "<br>";
print("July 1, 2010 is on a " . date("l", mktime(0,0,0,7,11,2010)));
?>
Êä³ö½á¹û ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ