æ§æ
[appãµã¼ã] -> [lvs] -> [MySQL]群
- DRã§MySQLã®ã¹ã¬ã¼ã群ã«ãã¼ããã©ã³ã¹
- appãµã¼ãã¯DBã³ãã¯ã·ã§ã³ã®ãã¼ãªã³ã°ãæ°¸ç¶åããã¦ãã
åé¡ã®ç¾è±¡
DBãµã¼ãä¸ã§ã¯mysqldã¸ã®ã³ãã¯ã·ã§ã³ãåå¨ããã®ã«ãappãµã¼ãä¸ã§ã¯ã³ãã¯ã·ã§ã³ãåå¨ããªãã(netstat調ã¹)
âç¡ç¨ãªã³ãã¯ã·ã§ã³ãæ®çããããã§ãMySQLã®max_connectionsã«éãã¦ãã¾ãã
åå
MySQLã®ä¸çã®ç¡éä¿¡æã®ã³ãã¯ã·ã§ã³ã®ã¿ã¤ã ã¢ã¦ãã¯ããã©ã«ã㧠28800ç§ (8æé)ãä¸æ¹ãIPVSã®ä¸çã®ç¡éä¿¡æã®ã¿ã¤ã ã¢ã¦ãã¯ESTABLISHEDãªã³ãã¯ã·ã§ã³ã§900ç§ (15å)ã
# ipvsadm -Ln --timeout Timeout (tcp tcpfin udp): 900 120 300
ãªã®ã§ãDBã³ãã¯ã·ã§ã³ã®æ°¸ç¶åçã§ã³ãã¯ã·ã§ã³ãå¼µãã£ã±ãªãããã¤ãSQLã®ããã¨ãããªã(ç¡éä¿¡ç¶æ )å ´åãIPVSçã«ã¿ã¤ã ã¢ã¦ããè¿ãã¦ã³ãã¯ã·ã§ã³ãåããããMySQLçã«ã¯ã¾ã ã¿ã¤ã ã¢ã¦ãã«ãªã£ã¦ããªãã®ã§ã³ãã¯ã·ã§ã³ãæ®ã£ã¦ãã¾ããã¨ããã®ãåå ã
対å¿
ããã®ããããã§ã
å½æèªåã¯æå¾ã®ãD. MySQLã®ä¸çã®ã¿ã¤ã ã¢ã¦ããçãããããæ¡ãã¾ãããæè¿ã¯Aã®é½åº¦æ¥ç¶ãã¦ã¾ãã
A. ã³ãã¯ã·ã§ã³ã®ãã¼ãªã³ã°ãæ°¸ç¶åãããã¦ãé½åº¦æ¥ç¶ã«ãã
B. å®æçã«éä¿¡ãã
- ãã¼ãªã³ã°ã®æ©æ§ã«ãSELECT 1çã®ã¯ã¨ãªãæãã¦ã³ãã¯ã·ã§ã³ã®validationãããæ©è½ãããã°ãIPVSã®ã¿ã¤ã ã¢ã¦ãããçãééã§ç¢ºèªããããã«ããã
- IPVSã®ã¿ã¤ã ã¢ã¦ã以å ã«ã¯ã¨ãªãçºãããããããªãµã¼ãã¹ã«ããã°ã£ã¦è²ã¦ãã
C. IPVSã®ä¸çã®ã¿ã¤ã ã¢ã¦ããé·ããã
--set tcp tcpfin udp Change the timeout values used for IPVS connections. This com- mand always takes 3 parameters, representing the timeout values (in seconds) for TCP sessions, TCP sessions after receiv- ing a FIN packet, and UDP packets, respectively. A timeout value 0 means that the current timeout value of the correspond- ing entry is preserved.
ã§è¨å®å¯è½ã
D. MySQLã®ä¸çã®ã¿ã¤ã ã¢ã¦ããçããã
DBãµã¼ãã®my.cnfã®[mysqld]ã»ã¯ã·ã§ã³ã«ä»¥ä¸ã®ããã«è¨å®ãããè¨å®å¤ã¯IPVSã®ã¿ã¤ã ã¢ã¦ã(ããã©ã«ã900ç§)ããå°ããå¤ã«ããã
interactive_timeout = 780 wait_timeout = 780
ãããããããçµæãè¿ãå§ããã¾ã§ã«780ç§ä»¥ä¸ãããã¯ã½éãã¯ã¨ãªã¯ã¿ã¤ã ã¢ã¦ããã¡ããããããããªãã®ã§å¿é ãªäººã¯ç¢ºèªãã¦ããè¨å®ããã»ããããã§ããã©ããããªã¯ã¨ãªæãã¦ãã¨ã¤ã¹ãé£ãã§ãããããããªãã®ã§æ°ãã¤ãã¾ãããã
è¬è¾
æIRCãã£ã³ãã«ã®ãããã§é ¼ãã仲éãã¡ã