LinuxÖÐÈçºÎÊÍ·ÅcacheÄÚ´æ free
ÒòΪLINUX
µÄÄÚºË
»úÖÆ£¬Ò»°ãÇé¿öϲ»ÐèÒªÌØÒâÈ¥ÊÍ·ÅÒѾʹÓõÄcache¡£ÕâЩcacheÆðÀ´µÄÄÚÈÝ¿ÉÒÔÔö¼ÓÎļþÒÔ¼°µÄ¶ÁдËٶȡ£
ÏÈ˵ÏÂfreeÃüÁîÔõô¿´ÄÚ´æ
[root@ahsq proc]# free
total used free shared buffers cached
Mem: 515588 295452 220136 0 2060 64040
-/+ buffers/cache: 229352 286236
Swap: 682720 112 682608
ÆäÖеÚÒ»ÐÐÓÃÈ«¾Ö½Ç¶ÈÃèÊöϵͳʹÓõÄÄÚ´æ×´¿ö£º
total——×ÜÎïÀíÄÚ´æ
used——ÒÑʹÓÃÄڴ棬һ°ãÇé¿öÕâ¸öÖµ»á±È½Ï´ó£¬ÒòΪÕâ¸öÖµ°üÀ¨ÁËcache+Ó¦ÓóÌÐòʹÓõÄÄÚ´æ
free——Íêȫδ±»Ê¹ÓõÄÄÚ´æ
shared——Ó¦ÓóÌÐò¹²ÏíÄÚ´æ
buffers——»º´æ£¬Ö÷ÒªÓÃÓÚĿ¼·½Ãæ,inodeÖµµÈ£¨ls´óĿ¼¿É¿´µ½Õâ¸öÖµÔö¼Ó£©
cached——»º´æ£¬ÓÃÓÚÒÑ´ò¿ªµÄÎļþ
note:
total=used+free
used=buffers+cached (maybe add shared also)
µÚ¶þÐÐÃèÊöÓ¦ÓóÌÐòµÄÄÚ´æʹÓãº
Ç°¸öÖµ±íʾ-buffers/cache——Ó¦ÓóÌÐòʹÓõÄÄÚ´æ´óС£¬used¼õÈ¥»º´æÖµ
ºó¸öÖµ±íʾ+buffers/cache——ËùÓпɹ©Ó¦ÓóÌÐòʹÓõÄÄÚ´æ´óС£¬free¼ÓÉÏ»º´æÖµ
note:
-buffers/cache=used-buffers-cached
+buffers/cache=free+buffers+cached
µÚÈýÐбíʾswapµÄʹÓãº
used——ÒÑʹÓÃ
free——δʹÓÃ
cacheÊÍ·Å£º
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
˵Ã÷£¬ÊÍ·ÅÇ°×îºÃsyncһϣ¬·ÀÖ¹¶ªÊý¾Ý¡£
ÔÎĵØÖ·£ºhttp://www.9usb.net/200806/linux-cache.html
Ïà¹ØÎĵµ£º
¶ÔÓÚÒ»°ãÓû§À´Ëµ£¬Ö÷Ŀ¼£¨home directory£©ÊÇÓ²ÅÌÉÏΨһ¿ÉÒÔÔÀ´Ð´¶«Î÷µÄµØ·½¡£Ò»°ãµÄ·¾¶ÃûÊÇ/home/login_user_name¡£
Ö÷Ŀ¼ÓÃÓÚ´æ´¢¸÷ÖÖÓû§Îļþ£ºÉèÖÃÎļþ£¬³ÌÐòÅäÖÃÎļþ£¬Óû§Îĵµ£¬Êý¾Ý netscape µÄ»º´æ£¬ÓʼþµÈµÈ¡£×÷Ϊһ¸öÆÕͨÓû§£¬Äã¿ÉÒÔÔÚÖ÷Ŀ¼Ï½¨Á¢ÐµÄĿ¼°²ÅÅÄã×Ô¼ºµÄĿ¼½á¹¹¡£ÆäËûÓû§ÎÞ·¨ÔĶÁÄãµÄ ......
µçÄÔÖбز»¿ÉÉٵľÍÊDzÙ×÷ϵͳ¡£¶øLinuxµÄ·¢Õ¹·Ç³£Ñ¸ËÙ£¬Óиϳ¬Î¢ÈíµÄÇ÷ÊÆ¡£ÕâÀï½éÉÜLinuxµÄ֪ʶ£¬ÈÃÄãѧºÃÓ¦ÓÃLinuxϵͳ¡£±ÈÈçÒª°Ñ/etc/apache/binĿ¼Ìí¼Óµ½PATHÖУ¬·½·¨ÓÐÈý£º
1.#PATH=$PATH:/etc/apache/bin
ʹÓÃÕâÖÖ·½·¨,Ö»¶Ôµ±Ç°»á»°ÓÐЧ£¬Ò²¾ÍÊÇ˵ÿµ±µÇ³ö»ò×¢ÏúϵͳÒÔºó£¬PATH ÉèÖþͻáʧЧ
2.#vi /etc/profile
......
¡¡# fstabÎļþµÄ×÷ÓÃ
¡¡¡¡Îļþ/etc/fstab´æ·ÅµÄÊÇϵͳÖеÄÎļþϵͳÐÅÏ¢¡£µ±ÕýÈ·µÄÉèÖÃÁ˸ÃÎļþ£¬Ôò¿ÉÒÔͨ¹ý"mount /directoryname"ÃüÁîÀ´¼ÓÔØÒ»¸öÎļþϵͳ£¬Ã¿ÖÖÎļþϵͳ¶¼¶ÔÓ¦Ò»¸ö¶ÀÁ¢µÄÐУ¬Ã¿ÐÐÖеÄ×ֶζ¼Óпոñ»òtab¼ü·Ö¿ª¡£Í¬Ê±fsck¡¢ mount¡¢umountµÄµÈÃüÁÀûÓøóÌÐò¡£
¡¡¡¡# fstabÎļþ¸ñʽ
¡¡¡¡ÏÂÃæÊÇ/etc/fata ......
1¡¢È¨Ï޵IJ鿴
ls -l ÎļþÃû³Æ
2¡¢È¨ÏÞÐÞ¸Ä
chmod abc file
ÆäÖÐa,b,c¸÷Ϊһ¸öÊý×Ö£¬·Ö±ð±íʾUser¡¢Group¡¢¼°OtherµÄȨÏÞ¡£
r=4£¬w=2£¬x=1£¬x±êʾִÐÐȨÏÞ¡£ÈôÒªrwxÊôÐÔÔò4+2+1=7£»ÈôÒ ......
ÍøÉÏÕÒÁËÏÂLinux½ø³Ì¼ä»¥³âµÄʵÏÖ£¬Á½ÖÖ·½·¨£¬semaphore ºÍ ÎļþËø¡£¸Õ¿ªÊ¼Ò²³¢ÊÔÓÃsemaphoreÀ´ÊµÏÖ£¬µ«·¢ÏÖsem_waitºÍsingalÎÞ·¨ÊµÏÖWindowsÏÂCirtSec£¬¶ø²ÉÓÃÁ˺óÕßÎļþËø£»
µ«¶ÔÓÚ¶ÁдËøÀ´ËµÊµÓÃÎļþËøʵÏÖ£¬´æÔÚÒ»¶¨µÄ²»×㣬Ëü·Ö¿ªÁ˶ÁдËø£¬¶øûÓзֿª½â¶ÁдËø£¬ÀûÓÃUnLockÀ´Í³Ò»½â¶ÁдËø£¬¶ÔÓÚÕâ½ø³Ì¼ä¶ÁдËøµÄʵÏÖ£ ......