SwooleÓë¸ß¿ÉÓÃÐÔÖÐÐļþµÄ×ÛºÏÓ¦ÓÃ
Ëæ×Å»¥ÁªÍøÊÖÒÕµÄÒ»Ö±Éú³¤£¬¸ß¿ÉÓÃÐԺ͸߲¢·¢ÐÔÒѾ³ÉΪÁËÿ¸öӪҵϵͳ¶¼ÐèҪ˼Á¿µÄÎÊÌ⡣ΪÁËÖª×ã´ó¹æÄ£Óû§µÄÐèÇóÒÔ¼°ÊµÏÖÓªÒµµÄ¿ìËÙµü´ú£¬Ðí¶à¹«Ë¾×îÏȽÓÄÉÂþÑÜʽ¼Ü¹¹ºÍ΢ЧÀͼܹ¹¡£¶øÔÚÕâ¸öÀú³ÌÖУ¬ÖÐÐļþµÄÖ÷ÒªÐÔ½ûÖ¹ºöÊÓ¡£¶øËæ×ÅswooleÊÖÒÕµÄáÈÆð£¬Ô½À´Ô½¶àµÄÆóҵѡÔñ½«swooleÓë¸ß¿ÉÓÃÐÔÖÐÐļþ¾ÙÐÐ×ÛºÏÓ¦Óá£
Ò»¡¢SwooleÊÖÒÕ¼ò½é
SwooleÊÇÒ»¸öPHPµÄÀ©Õ¹£¬Ëü¿ÉÒÔ´ó·ù¶ÈÌáÉýPHPÓ¦ÓóÌÐòµÄÐÔÄÜ£¬Ê¹Æä¿ÉÒÔÖ§³Ö¸ß²¢·¢¡¢¸ß¸ºÔصÄÓ¦Óó¡¾°¡£ËüµÄ½¹µãÌصã°üÀ¨£º
Òì²½IO
¶àÀú³ÌÄ£×Ó
ÄÚ´æÕ¼ÓõÍ
¸ßÐÔÄÜ
Ö§³Ö¶à¼¶±ð»º´æÒÔ¼°¸ß¼¶±ðµÄËø
ÓÉÓÚÕâЩÌص㣬SwooleÖð½¥³ÉΪÁËPHPÓ¦ÓóÌÐò¿ª·¢¡¢ÔËάºÍÓÅ»¯µÄÖ÷Òª¹¤¾ß¡£
¶þ¡¢¸ß¿ÉÓÃÐÔÖÐÐļþ¼ò½é
¸ß¿ÉÓÃÐÔÖÐÐļþÊÇָΪӪҵϵͳÌṩ¸ß¿ÉÓÃÐÔ¡¢¸ßÐÔÄÜ¡¢¸ßÇå¾²ÐÔÒÔ¼°¸ß¿ÉÀ©Õ¹ÐԵĽ¹µã×é¼þ¡£ËüÊÇʵÏÖӪҵϵͳ¸ß¿ÉÓÃÐԵIJ»¶þ֮ѡ¡£±ÊÕßÕâÀïÖ÷ÒªÏÈÈÝÒ»ÏÂÁ½Öָ߿ÉÓÃÐÔÖÐÐļþ£º
ZooKeeper
ZooKeeperÊÇÒ»¸öÂþÑÜʽе÷ЧÀÍ£¬ÓÃÓÚ¹¹½¨´ó¹æÄ£µÄÂþÑÜʽϵͳ¡£ËüÊÇHadoopƽÂþÑÜʽÅÌËãÁìÓòÏîÄ¿ÖеÄÒ»¸öºÜÊÇÖ÷ÒªµÄ×é¼þ¡£
ZooKeeperÌṩÁËÒÔÏµĹ¦Ð§£º
ά»¤ÉèÖÃÐÅÏ¢
ά»¤ÃüÃû¿Õ¼ä
ά»¤ÏµÍ³µÄ״̬ÐÅÏ¢
Ìṩ¼¯ÖÐʽµÄЧÀÍ
Redis
RedisÊÇÒ»¿îÄÚ´æÐ͵ÄKey-ValueÀàÊý¾Ý¿â¡£ËüÖ§³ÖÊý¾Ý³¤ÆÚ»¯£¬¼¯Èº¼Ü¹¹£¬²¢ÇÒ¿ÉÒÔ×öÐÂÎÅÐÐÁС¢ÂþÑÜʽËø¡¢Ðû²¼¶©Ôĵȡ£
RedisµÄ½¹µãÌØÕ÷°üÀ¨£º
Ö§³Ö¶àÖÖÊý¾Ý½á¹¹
ÔËÐÐËÙÂʷdz£¿ì
Ö§³ÖÊý¾Ý³¤ÆÚ»¯
ÈÝÒ×À©Õ¹
Èý¡¢SwooleÓë¸ß¿ÉÓÃÐÔÖÐÐļþµÄ×ÛºÏÓ¦ÓÃ
½«SwooleÓëZooKeeperÍŽáʹÓÃ
ͨ¹ý½«SwooleºÍZooKeeper¾ÙÐÐÍŽᣬ¿ÉÒÔʵÏÖÒÔÏµĹ¦Ð§£º
ƾ֤²î±ðµÄЧÀÍÀàÐÍ£¬½«Ð§ÀÍ×¢²áµ½ZooKeeperÖÐÐÄ£¬ÊµÏÖЧÀ͵Ä×Ô¶¯·¢Ã÷¡£
ͨ¹ýSwooleµÄ¶àÀú³ÌºÍÒì²½IO»úÖÆ£¬ÊµÏָ߲¢·¢¡¢¸ßÐÔÄܵÄЧÀͼܹ¹¡£
ʵÏÖ»ùÓÚZooKeeperµÄ¸ºÔØƽºâ¼Æ»®£¬Ê¹µÃÇëÇó¿ÉÒÔÊèÉ¢µ½²î±ðµÄЧÀÍÆ÷ÉÏ¡£
½«SwooleÓëRedisÍŽáʹÓÃ
ÍŽáSwooleºÍRedis¿ÉÒÔʵÏÖÒÔÏµĹ¦Ð§£º
ʹÓÃRedisµÄÐÂÎÅÐÐÁй¦Ð§£¬ÊµÏÖʹÃü·Ö·¢¡¢Òì²½´¦ÀíµÈ¡£
ʹÓÃRedisµÄÂþÑÜʽËø¹¦Ð§£¬ÊµÏÖ²¢·¢¿ØÖÆ¡£
ʹÓÃRedisµÄÐû²¼¶©ÔÄ»úÖÆ£¬ÊµÏÖÂþÑÜʽÊÂÎñ´¦Àí¡£
ÆôÓÃRedis¼¯Èº£¬ÊµÏָ߿ÉÓÃÐÔ¡£
½áÓ
SwooleºÍ¸ß¿ÉÓÃÐÔÖÐÐļþµÄÍŽáÊÇʵÏָ߿ÉÓÃÐÔ¡¢¸ßÐÔÄÜ¡¢¸ß¿ÉÀ©Õ¹ÐÔÓ¦ÓõÄÖ÷Òª×é³É²¿·Ö¡£Í¨¹ýÕâÖÖ·½·¨£¬²»µ«Äܹ»ÊµÏÖÓªÒµµÄ¸ß²¢·¢´¦Àí£¬»¹Äܹ»ÌáÉýϵͳµÄ¸ß¿ÉÓÃÐÔºÍÎȹÌÐÔ¡£
ÒÔÉϾÍÊÇSwooleÓë¸ß¿ÉÓÃÐÔÖÐÐļþµÄ×ÛºÏÓ¦ÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡