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

³õ²½ÈÏʶmysqlµÄthread_cache¼°Table_cache

THREAD_CACHE MySQLÀïÃæÎªÁËÌá¸ß¿Í»§¶ËÇëÇó´´½¨Á¬½Ó¹ý³ÌµÄÐÔÄÜ,ÌṩÁËÒ»¸öÁ¬½Ó³ØÒ²¾ÍÊÇThread_Cache³Ø,½«¿ÕÏеÄÁ¬½ÓÏ̷߳ÅÔÚÁ¬½Ó³ØÖÐ,¶ø²»ÊÇÁ¢¼´Ïú»Ù.ÕâÑùµÄºÃ´¦¾ÍÊÇ,µ±ÓÖÓÐÒ»¸öеÄÇëÇóµÄʱºò,mysql²»»áÁ¢¼´È¥´´½¨Á¬½ÓÏß³Ì,¶øÊÇÏÈÈ¥Thread_CacheÖÐÈ¥²éÕÒ¿ÕÏеÄÁ¬½ÓÏß³Ì,Èç¹û´æÔÚÔòÖ±½ÓʹÓÃ,²»´æÔڲŴ´½¨ÐµÄÁ¬½ÓÏß³Ì. ÓйØThread_CacheÔÚMySQLÓм¸¸öÖØÒªµÄ²ÎÊý,¼òµ¥½éÉÜÈçÏÂ: thread_cache_size Thread_CacheÖдæ·ÅµÄ×î´óÁ¬½ÓÏß³ÌÊý.ÔÚ¶ÌÁ¬½ÓµÄÓ¦ÓÃÖÐThread_CacheµÄ¹¦Ð§·Ç³£Ã÷ÏÔ,ÒòΪÔÚÓ¦ÓÃÖÐÊý¾Ý¿âµÄÁ¬½ÓºÍ´´½¨ÊǷdz£Æµ·±µÄ,Èç¹û²»Ê¹ÓÃThread_CacheÄÇôÏûºÄµÄ×ÊÔ´ÊǷdz£¿É¹ÛµÄ!ÔÚ³¤Á¬½ÓÖÐËäÈ»´øÀ´µÄ¸ÄÉÆÃ»ÓжÌÁ¬½ÓµÄÄÇôÃ÷ÏÔ,µ«ÊǺô¦ÊÇÏÔ¶øÒ×¼ûµÄ.µ«²¢²»ÊÇÔ½´óÔ½ºÃ´óÁË·´¶øÀË·Ñ×ÊÔ´Õâ¸öµÄÈ·¶¨Ò»°ãÈÏΪºÍÎïÀíÄÚ´æÓÐÒ»¶¨¹ØÏµ,ÈçÏÂ: 1G  —> 8
2G  —> 16
3G  —> 32
>3G  —> 64 Èç¹û¶ÌÁ¬½Ó¶àµÄ»°¿ÉÒÔÊʵ±¼Ó´ó. thread_stack ÿ¸öÁ¬½Ó±»´´½¨µÄʱºò,mysql·ÖÅ䏸ËüµÄÄÚ´æ.Õâ¸öÖµÒ»°ãÈÏΪĬÈϾͿÉÒÔÓ¦ÓÃÓڴ󲿷ֳ¡¾°ÁË,³ý·Ç±ØÒª·ÇÔò²»Òª¶¯Ëü. thread_handing ÔËÓÃThread_Cache´¦ÀíÁ¬½ÓµÄ·½Ê½,5.1.19Ìí¼ÓµÄÐÂÌØÐÔ.ÓÐÁ½¸öÖµ¿ÉÑ¡[no-threads|one-thread-per-connection]¿´×ÖÃæÒâ˼´ó¼ÒÒ²¸Ã²Â³ö°Ë¾Å·ÖÁË,ºÇºÇ,no-threads ·þÎñÆ÷ʹÓÃÒ»¸öÏß³Ì,one-thread-per-connection ·þÎñÆ÷Ϊÿ¸ö¿Í»§¶ËÇëÇóʹÓÃÒ»¸öÏß³Ì.Ô­ÊÖ²áÖÐÌáµ½,no-threadsÊÇÔÚLinuxϵ÷ÊÔÓõÄ.   mysql> show variables like 'thread%';
+-------------------+---------------------------+
| Variable_name     | Value                     |
+-------------------+---------------------------+
| thread_cache_size | 32                        |
| thread_handling   | one-thread-per-connection |
| thread_stack      | 196608                  &#


Ïà¹ØÎĵµ£º

LAMP(Linux+Apache+MySQL+PHP)·þÎñÆ÷µÄÐÔÄÜÓÅ»¯

ĿǰLAMP (Linux + Apache + MySQL + PHP) ½ü¼¸ÄêÀ´·¢Õ¹Ñ¸ËÙ£¬ÒѾ­³ÉΪWeb ·þÎñÆ÷µÄÊÂʵ±ê×¼¡£LAMP 
Õâ¸ö´ÊµÄÓÉÀ´×îÔçʼÓڵ¹úÔÓÖ¾“c't Magazine”£¬Michael KunzeÔÚ1990Äê×îÏȰÑÕâЩÏîÄ¿×éºÏÔÚÒ»Æð´´ÔìÁËLAMPµÄËõд×Ö¡£ÕâЩ×é¼þËäÈ»²¢²»ÊÇ¿ª¿ªÊ¼¾ÍÉè¼ÆÎªÒ»ÆðʹÓõ쬵«ÊÇ£¬ÕâЩ¿ªÔ´Èí¼þ¶¼¿ÉÒԺܷ½±ã µÄË ......

MySQLÊÖ¼Ç002

1¡¢´´½¨Ò»¸öÊý¾Ý¿â
create database Êý¾Ý¿âÃû
2¡¢´´½¨Ò»¸öÊý¾Ý±í
create table Êý¾Ý±íÃû(
×Ö¶ÎÃû ÀàÐÍ(³¤¶È),
×Ö¶ÎÃû ÀàÐÍ(³¤¶È),
×Ö¶ÎÃû ÀàÐÍ(³¤¶È),
×Ö¶ÎÃû ÀàÐÍ(³¤¶È),
......
×Ö¶ÎÃû ÀàÐÍ(³¤¶È)
);
3¡¢²é¿´Êý¾Ý±í½á¹¹
describe Êý¾Ý±íÃû;
4¡¢²åÈëÒ»ÌõмǼ
insert into Êý¾Ý±íÃû values(Öµ1,Öµ2,....Öµn ......

¹¹½¨¸ßÐÔÄܵÄMYSQLÊý¾Ý¿â(¶þ) °ÑÄÇЩƿ¾±¸øÕÒ³öÀ´

Ò»¡¢´ÓÄÄÀïÈëÊÖ
     µ±Ò»Ì¨MYSQL·þÎñÆ÷´î½¨Íê³É²¢¿ÉÒÔÕý³£ÔËÐÐʱ£¬ÊDz»ÊÇÎÒÃǵĽŲ½¾ÍÍ£Ö¹ÁË£¬×ÔÒÔΪ¿ÉÒÔ¿ªÊ¼Ê¹ÓÃÁË£¬¶ÔרҵÈËÊ¿À´ËµÆäʵ»¹ÐèÒª¸ü¶àµÄÏà¹ØÓÅ»¯ºÍÉèÖá£ÔõôȥÓÅ»¯£¿ÔõôȥÉèÖã¿Ê×ÏÈÎÒÃǵÃÕÒµ½ËüµÄÆ¿¾±£¬ÎÒÏÖÔÚËùÁ˽âµÄÓÐÁ½ÖÖ·½·¨£¬Ò»ÊÇ»ù×¼²âÊÔ£¬¶þ¾ÍÊdzÌÐò·ÖÎö£¬ËûÃÇÓÐ×ÅÃÜÇеÄÁªÏµ ......

MySql ÅжϺº×Ö¡¢ÈÕÆÚ¡¢Êý×ֵĺ¯Êý

¼¸¸öƽ³£ÓõÄmysqlº¯Êý
/*****************************************************
1.ÅжÏ×Ö·û´®ÊÇ·ñΪºº×Ö ·µ»ØÖµ£º1-ºº×Ö 0-·Çºº×Ö
*****************************************************/
DROP FUNCTION IF EXISTS fc_is_hanzi;
CREATE FUNCTION  fc_is_hanzi(
p_str VARCHAR(1024)
)
    ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ