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

LinuxϵͳµÄƽ¾ù¸ºÔØ

תÔØ×Ô£ºhttp://hi.baidu.com/jinandpan/blog/item/dde4e31683ad4101c93d6d9b.html
Ò»¡¢Ê²Ã´ÊÇϵͳƽ¾ù¸ºÔØ(Load average)£¿
ÔÚLinuxϵͳÖУ¬uptime¡¢w¡¢topµÈÃüÁ»áÓÐϵͳƽ¾ù¸ºÔØload averageµÄÊä³ö£¬ÄÇôʲôÊÇϵͳƽ¾ù¸ºÔØÄØ£¿
ϵͳƽ¾ù¸ºÔر»¶¨ÒåΪÔÚÌض¨Ê±¼ä¼ä¸ôÄÚÔËÐжÓÁÐÖеÄƽ¾ù½ø³ÌÊý¡£Èç¹ûÒ»¸ö½ø³ÌÂú×ãÒÔÏÂÌõ¼þÔòÆä¾Í»áλÓÚÔËÐжÓÁÐÖУº
- ËüûÓÐÔڵȴýI/O²Ù×÷µÄ½á¹û
- ËüûÓÐÖ÷¶¯½øÈëµÈ´ý״̬(Ò²¾ÍÊÇûÓе÷ÓÃ'wait')
- ûÓб»Í£Ö¹(ÀýÈ磺µÈ´ýÖÕÖ¹)
ÀýÈ磺
[root@opendigest root]# uptime
7:51pm up 2 days, 5:43, 2 users, load average: 8.13, 5.90, 4.94
ÃüÁîÊä³öµÄ×îºóÄÚÈݱíʾÔÚ¹ýÈ¥µÄ1¡¢5¡¢15·ÖÖÓÄÚÔËÐжÓÁÐÖеÄƽ¾ù½ø³ÌÊýÁ¿¡£
Ò»°ãÀ´ËµÖ»ÒªÃ¿¸öCPUµÄµ±Ç°»î¶¯½ø³ÌÊý²»´óÓÚ3ÄÇôϵͳµÄÐÔÄܾÍÊÇÁ¼ºÃµÄ£¬Èç¹ûÿ¸öCPUµÄÈÎÎñÊý´óÓÚ5£¬ÄÇô¾Í±íʾÕą̂»úÆ÷µÄÐÔÄÜÓÐÑÏÖØÎÊÌâ¡£¶ÔÓÚÉÏ
ÃæµÄÀý×ÓÀ´Ëµ£¬¼ÙÉèϵͳÓÐÁ½¸öCPU£¬ÄÇôÆäÿ¸öCPUµÄµ±Ç°ÈÎÎñÊýΪ£º8.13/2=4.065¡£Õâ±íʾ¸ÃϵͳµÄÐÔÄÜÊÇ¿ÉÒÔ½ÓÊܵġ£
¶þ¡¢Load averageµÄËã·¨
ÉÏÃæµÄÊä³öÊý¾ÝÊÇÿ¸ô5ÃëÖÓ¼ì²éÒ»´Î»îÔ¾µÄ½ø³ÌÊý£¬È»ºó¸ù¾ÝÕâ¸öÊýÖµËã³öÀ´µÄ¡£Èç¹ûÕâ¸öÊý³ýÒÔCPUµÄÊýÄ¿£¬½á¹û¸ßÓÚ5µÄʱºò¾Í±íÃ÷ϵͳÔÚ³¬¸ººÉÔËתÁË¡£ÆäËã·¨(Õª×ÔLinux 2.4µÄÄں˴úÂë)ÈçÏ£º
Îļþ: include/linux/sched.h:
#define FSHIFT 11 /* nr of bits of precision */
#define FIXED_1 (1<#define LOAD_FREQ (5*HZ) /* 5 sec intervals */
#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point, 2048/pow(exp(1), 5.0/60) */
#define EXP_5 2014 /* 1/exp(5sec/5min), 2048/pow(exp(1), 5.0/300) */
#define EXP_15 2037 /* 1/exp(5sec/15min), 2048/pow(exp(1), 5.0/900) */
#define CALC_LOAD(load,exp,n) \
load *= exp; \
load += n*(FIXED_1-exp); \
load >>= FSHIFT;
/**********************************************************/
Îļþ: kernel/timer.c:
unsigned long avenrun[3];
static inline void calc_load(unsigned long ticks)
{
unsigned long active_tasks; /* fixed-point */
static int count = LOAD_FREQ;
count -= ticks;
if (count < 0) {
count += LOAD_FREQ;
active_tasks = count_active_tasks();
CALC_LOAD(avenrun[0], EXP_1, active_tasks);
CALC_LOAD(avenrun[1], EXP_5, active_tasks);
CALC_LOAD(avenrun[2], EXP_15


Ïà¹ØÎĵµ£º

Linux ±Ê¼Ç2

1¡£LinuxÁ´½Ó
LinuxĿ¼ÖÐÿ¸öÃû×ÖÖÁinodeµÄÓ³Éä±»³ÆΪÁ´½Ó£¬¼´Ä¿Â¼ÖÐÒ»¸öÖ¸ÏòinodeµÄÃû×Ö¡£LinuxµÄÎļþÁ´½Ó·ÖΪӲÁ´½ÓºÍÈíÁ´½Ó¡£
Ó²Á´½Ó±ØÐëλÓÚͬһ¸öÎļþϵͳ¡£Ê¹ÓÃlink()º¯ÊýʵÏÖ¡£
ÈíÁ´½Ó¼´·ûºÅÁ´½Ó£¬Ëü²»Ôö¼Ó¶îÍâµÄĿ¼Ï¶øÊÇÒ»ÖÖÌØÊâµÄÎļþÀàÐÍ¡£Ëü¿ÉÒÔ¿çÔ½Îļþϵͳ¡£
2¡£É豸½Úµã¡£
 É豸½ÚµãÊÇÓ¦Ó ......

linuxÏ°²×°apache+php


linuxÏ°²×°apache+php
                                      
1.apache
ÔÚÈçÏÂÒ³ÃæÏÂÔØapacheµÄfor linux µÄ ......

Linux VNCÔ¶³Ì×ÀÃæ

Linux VNCÔ¶³Ì×ÀÃæ
2009-07-27 09:46
VNC£¬È«³ÆΪVirtual Network Computing£¬ÊÇÒ»¸ö×ÀÃæ¹²Ïíϵͳ¡£ËüµÄ¹¦ÄÜ£¬ÀàËÆÓÚwindowsÖеÄÔ¶³Ì ×ÀÃ湦ÄÜ¡£VNCʹÓÃÁËRFB(Remote FrameBuffer£¬Ô¶³ÌÖ¡»º³å£©Ð­ÒéÀ´ÊµÏÖÔ¶³Ì¿ØÖÆÁíÍâһ̨¼ÆËã»ú¡£Ëü°Ñ¼üÅÌ¡¢Êó±ê¶¯×÷·¢Ë͵½Ô¶³Ì¼ÆËã»ú£¬²¢°ÑÔ¶³Ì¼ÆËã»úµÄÆÁÄ»·¢»Øµ½±¾µØ£¬ VNC Viewer¿ÉÒÔº ......

Linux Tomcat°²×°

Linux Tomcat°²×°
2009-12-10 15:35
ΪÁËѧϰjava£¬ÐèÒªÒ»¸ö·þÎñÆ÷£¬Òò´Ë¾ö¶¨ÓñȽÏÁ÷ÐеÄtomcat¡£¸ù¾ÝÍøÉ϶԰²×°tomcatµÄ½éÉÜ£¬×Ô¼º½øÐÐÁË°²×°£¬ÏÖÔÚÒѾ­³É¹¦ÁË£¬ÏÖÔÚ°Ñ°²×°µÄ¹ý³Ì½øÐмǼ£¬Ò²¹©´ó¼Òѧϰ²Î¿¼¡£
   Ò»¡¢´Ó¹Ù·½ÍøÕ¾ÉÏÏÂÔØtomcatÈí¼þ°ü¡£
    http://tomcat.apache.org/
  ......

linuxÏ°²×°Îļþ

linuxÏ°²×°Îļþ
2009Äê02ÔÂ20ÈÕ ÐÇÆÚÎå 16:18
1¡¢Ô´´úÂë°üµÄ°²×°
gzip -d apache_1.3.20.tar.gz £¨½âѹ£©
tar xvf apache_1.3.20.tar £¨½â°ü£©
cd apache_1.3.20
./configure £¨ÅäÖã© ----./configure --help£¨²é¿´configureÑ¡Ï
make £¨±àÒ룩
make install £¨°²×°£©
make clean £¨Ð¶ÔØ£©
×¢£ºµäÐ͵ÄÔ´´úÂë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ