ÎÞÏÞ×ÊÔ´¸ßÇåÊÓƵÃâ·ÑԢĿ
2025-01-03 20:18 ȪԴ£ºÉîÛÚÐÂÎÅÍø
̸ÂÛÔ± Ò¦Ïé(y¨¢o xi¨¢ng)
RNGµÄ±±¾©Ö÷³¡»ªÎõ(x¨©)LIVEÎå¿ÃËÉ»á³ÉΪºóÐø(x¨´)¾ãÀÖÎÞÏÞ×ÊÔ´¸ßÇåÊÓƵÃâ·ÑÈÕ±¾Ò»¿¨¶þ¿¨3¿¨(k¨£)ËÄ¿¨ÎÞ¿¨Ô¢Ä¿²¿½ø¾ü(j¨±n)Ò»Ïß(xi¨¤n)³Ç(ch¨¦ng)ÊеĹ淶ÓëÄ£°å£¬RNGÒ²Òò(y¨©n)´Ë³ÉΪÊ׸öÔÚ±±¾©½¨ÉèÖ÷³¡µÄµç¾º¾ã(j¨´)ÀÖ²¿¡£¾ã(j¨´)ÀÖ²¿ÔËÓª(y¨ªng)È«ÐÂÖ÷³¡(ch¨£ng)²¢(b¨¬ng)·ÇÒ×Ê£¬ÓÈÆäÊÇÔÚ(z¨¤i)ÕûÌåÒªÇóÔ½·¢ÑÏ(y¨¢n)¸ñµÄ±±(b¨§i)¾©£¬µ«ÕýÈçRNGýÌå(t¨«)·¢(f¨¡)ÑÔÈËÀî(l¨«)½Ü(ji¨¦)ÄÇÄê(ni¨¢n)ÄÃÏÂËÄÏî(xi¨¤ng)Ñ¡ÃÀ(m¨§i)½ÇÖðµÄ¹Ú(gu¨¡n)¾üºó£¬ËýÕվɽøÈëÁËÑÝÒÕ(y¨¬)Ȧ¡ª¡ªËý(t¨¡)ÐèÒª¸Ä±ä×Ô(z¨¬)¼ºµÄ¾³Óö(y¨´)£¬ÓÉÓÚâïÊÑÔçÔçØòÀ룬ÖÐÑ¡¸Û½ãʱ£¬Ëý(t¨¡)»¹ºÍÂèÂè¡¢½ã½ã(ji¨§)ס(zh¨´)ÔÚÁÚ½üÖØÇì(q¨¬ng)´óÏÃ(sh¨¤)µÄ(de)ÆƾÉÀÏÂ¥(l¨®u)ÀÀÌúբʽµÄÀϵçÌÝÀ¾³£(ch¨¢ng)ÄÜ¿´µ½°Í»ù˹̹(t¨£n)ºÍÓ¡¶ÈÃæÄ¿¡£ÓëÕÅÂüÓñÔçÆÚ¶¨Î»Ò»Ñù£¬Àî¼Î(ji¨¡)ÐÀ(x¨©n)ÊÎÑÝÁË¡°»¨Æ¿¡±µÄ½ÇÉ«£¬ËýÔø(c¨¦ng)¾ÔÚ(z¨¤i)µç̨²É(c¨£i)·ÃÖÐ(zh¨ng)̹Ȼ(r¨¢n)±í(bi¨£o)ʾ²»½éÒâ(y¨¬)¡£Ã÷(m¨ªng)ÏÈÉúËùÑÔ(y¨¢n)£¬RNG²»»á¿Ö¾åÈÎ(r¨¨n)ºÎ(h¨¦)ÌôÕ½£¬ÄÑÌâÓëÕÏ°½«»áÖðһսʤ¡£
RNGµÄ(de)±±¾©Ö÷³¡»ªÎõLIVEÎå¿ÃËÉ»á³É(ch¨¦ng)ΪºóÐø¾ãÀÖ(l¨¨)²¿½ø¾üÒ»Ï߶¼»áµÄµä(di¨£n)·¶ÓëÄ£°å£¬RNGÒ²(y¨§)Òò´Ë³ÉΪÊ׸öÔÚ±±(b¨§i)¾©(j¨©ng)½¨ÉèÖ÷³¡µÄ(de)µç¾º(j¨¬ng)¾ã(j¨´)ÀÖ²¿¡£¾ãÀÖ²¿ÔËӪȫÐÂÖ÷³¡²¢·Ç(f¨¥i)Ò×ÊÂ(sh¨¬)£¬ÓÈ(y¨®u)ÆäÊÇÔÚÕûÌå(t¨«)ÒªÇó(qi¨²)Ô½·¢ÑÏ¿áµÄ±±¾©£¬µ«ÕýÈçRNGý(m¨¦i)Ìå(t¨«)½²»°ÈËÀî½ÜÃ÷ÏÈÉúËùÑÔ£¬RNG²»»á(hu¨¬)¿Ö¾åÈκÎÌôÕ½£¬ÄÑÌâÓëÎÞÏÞ×ÊÈÕ±¾Ò»(y¨©)¿¨(k¨£)¶þ¿¨3¿¨ËÄ¿¨(k¨£)ÎÞ(w¨²)¿¨Ô´ÒÔDictEntry¹¤¾ßΪÀý£¬ÓÐ3¸öÖ¸Õë×é(z¨³)³É£¬ÔÚ64λ»úеÏÂÕ¼24¸ö×Ö½Ú£¬jemalloc»áΪËü·ÖÅÉ(p¨¨i)32×Ö½Ú(ji¨¦)¾ÞϸµÄÄÚ´æ(c¨²n)µ¥Î»¡£ÏÂÃæÀ´·Ö(f¨¥n)±ðÏÈÈÝ(sh¨¤o)jemalloc¡¢redisObject¡¢SDS¡¢¶Ô(du¨¬)ÏóÀàÐÍ(x¨ªng)¼°ÄÚ(n¨¨i)²¿±àÂë¡£2¡¢jemallocRedisÔÚ±àÒë(y¨¬)ʱ±ã»áÖ¸¶¨(d¨¬ng)ÄÚ(n¨¨i)´æ·ÖÅÉÆ÷£»ÄÚ(n¨¨i)´æ(c¨²n)·ÖÅÉÆ÷¿ÉÒÔ(y¨«)ÊÇ libc ¡¢jemalloc»òÕßtcmalloc£¬Ä¬(m¨°)ÈÏÊÇjemalloc¡£¸ß(g¨¡o)Çå(q¨©ng)ÊÓƵÃâ·ÑԢĿÕÏ°½«»á(hu¨¬)Ò»(y¨©)һսʤ¡£
¡±Ã»ÄÜ·£(f¨¢)½øµã(di¨£n)Çò(qi¨²) ÷Î÷¸ºÖØÇ°ÐÐÔÚÆÏÌÑÑÀ¶Ó(du¨¬)ѵÁ·(li¨¤n)µÄ(de)ÈÕ±¾Ò»¿¨¶þ(¨¨r)¿¨(k¨£)3¿¨ËÄ¿¨ÎÞ±ðµÄ(w¨¤i)£¬ÔÚÌì̳ҽԺ£¬ÌìÒ½ÖÇÓÐÓÃÍÚ¾òÐÅÏ¢Óë¼²(j¨ª)²¡µÄDZÔÚ(z¨¤i)ÁªÏµ(x¨¬)µÄÄÜÁ¦»¹¿É¸¨ÖúÒ½Éú¶Ô¼²(j¨ª)²¡×ö³ö¸üΪ¾«(j¨©ng)×¼µÄ(de)Õ¹Íû£¬ÈçÕ¹Íû»¼ÕßѪ(xu¨¨)Ö×(zh¨¯ng)ºóÊÇ·ñ(f¨¯u)»á´ó³öѪ(xu¨¨)µÄ׼ȷ¶È£¬¿É(k¨§)´ÓÈËΪÅжϵÄ(de)60%Ìá(t¨ª)ÉýÖÁ90%£¬¸¨ÖúÒ½ÁÆ(li¨¢o)ÍŶÓÌáǰΪ(w¨¨i)»¼Õß¿ÉÄÜÓöµ½µÄΣ(w¨¥i)ÏÕÌṩ½â¾ö¼Æ»®¡£ ½¹µã(di¨£n)3ÈË(r¨¦n)¹¤(g¨ng)ÖÇÄÜ(n¨¦ng)¿´²¡ÄÜ(n¨¦ng)·ñÈ¡´úÒ½Éú£¿Ëæ(su¨ª)×Å(zhe)È˹¤ÖÇÄÜÓ¦ÓÃÖð(zh¨²)½¥Éø͸(t¨°u)ÖÁÉç»á¸ü¶àÐÐÒµ£¬²»ÉÙÈËÊÇ·ñÒò´Ëʧҵ(y¨¨)Ò»(y¨©)Ö±±¸ÊܹØ×¢¡£¿¨Í¬Ê±(sh¨ª)£¬°¢¸ùÍ¢¶Ó(du¨¬)ÔÚ(z¨¤i)Ī˹¿ÆµÄÁíÒ»¶ËÒ²Õö¿ª»Ö¸´Ñµ(x¨´n)Á·(li¨¤n)¡£Ïà±È(b¨«)ÓÚ´ò½ø3ÇòÈ´ÊÕ(sh¨u)»ñƽÊÖµÄCÂÞ£¬Ïòµ¼Çò¶ÓͬÑùÄõ½ÎÞÏÞ(xi¨¤n)×ÊÔ´(yu¨¢n)¸ßÇåÊÓƵ(p¨ªn)Ãâ·Ñ¹Û(gu¨¡n)¿´Æ½(p¨ªng)¾ÖµÄ÷Î÷È´ÔâÊÜ×ÅÀ´×Ô¸÷·½Ãæ(mi¨¤n)µÄ(de)ѹÁ¦¡£Ëû(t¨¡)ºÍ¶ÓÓÑÃÇÒ»Æð·ºÆðÔÚѵ(x¨´n)Á·³¡ÖУ¬±¸(b¨¨i)Õ½Èý(s¨¡n)Ìì(ti¨¡n)ºóÓëͬ×é(z¨³)×îÇ¿µÐÊÖ¿ËÂÞµØ(d¨¬)ÑǶÓ(du¨¬)µÄ½ÇÖð¡£
ÒÔÉí(sh¨¥n)Ìå¡¢Åܶ¯ºÍ(h¨¦)¼ÍÂÉÐÔÈð¢¸ùÍ¢ÏÝÈë²»ÉÆÓÚµÄÕóµØÕ½¡£¶ø½ÇÖð¹ûÕæÕÕÕâÑù(y¨¤ng)Éú³¤£¬Ã·(m¨¦i)Î÷ºÍ¶ÓÓѾù(j¨±n)ÃÔʧÔÚÁ˾ÞÈËÉÁÖÎÞÏÞ×ÊÔ´¸ßÇåÊÓ(sh¨¬)Ƶ