MySQL SSLæ¥ç¶æã®ããã©ã¼ãã³ã¹ãè¨æ¸¬ãã¦ã¿ã
ãUbuntu 10.10のMySQLとSSL通信でJDBC接続するãã§MySQLã®SSLéä¿¡ã試ãã¦ã¿ãã®ã§ã次ã«SSLéä¿¡æã«ããã©ã¼ãã³ã¹ãã©ãã»ã©è½ã¡ãã®ã調æ»ãã¦ã¿ã¾ããã
ããã¥ã¡ã³ãã«ã¯30%ãã50%ããã©ã¼ãã³ã¹ãè½ã¡ãã¨ãããã¦ãã¾ãã
è¨æ¸¬ç°å¢
è¨æ¸¬ãã¼ã«ã¯æ¨æºã®mysqlslapã使ç¨ã
ãã·ã³ã¯ãMySQLãã¤ã³ã¹ãã¼ã«ããã¦ãããã¹ãã¨mysqlslapãå®è¡ãããã¹ãã®2å°ãç¨æãã¾ããã
ã¡ãªã¿ã«ãµã¼ãã¼ã¯ã©ã¡ããNIFTYã¯ã©ã¦ãã®Small1ã
è¨æ¸¬ããMySQLã®ãã¼ã¸ã§ã³ã¯5.0.77ãè¨å®ã¯CentOS 5.3ã«yumã§ã¤ã³ã¹ãã¼ã«ããããã©ã«ãã®ã¾ã¾ã§ãã
ãªã¢ã¼ãããã®æ¥ç¶ã®è¨±å¯ã¨æ¥ç¶ç¢ºèª
ãã¹ããªã®ã§å
¨ãã¹ãããã¢ã¯ã»ã¹å¯è½ã«è¨å®ã
http://rfs.jp/server/mysql/02/02.html
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'password' WITH GRANT OPTION;
mysqlã¯ã©ã¤ã¢ã³ãã§æ¥ç¶ç¢ºèª
cacert.pemãclient-cert.pemãclient-key.pemãã¯ã©ã¤ã¢ã³ããã¹ãã«ã³ãã¼ãã¦ãã
$ mysql -h <host_name> -uroot -p --ssl-ca=cacert.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem
mysqlslapãSSLæ¥ç¶ãªãã·ã§ã³ã¯åæ§ã®ãã®ãæå®ãã¾ãã
http://dev.mysql.com/doc/refman/5.1/ja/secure-using-ssl.html
è¨æ¸¬
å
¬å¼ããã¥ã¡ã³ãã®mysqlslapã®èª¬æ:
http://dev.mysql.com/doc/refman/5.1-olh/ja/mysqlslap.html
æ¸ãè¾¼ã¿ã¯IOå¾ ã¡ãå½±é¿ããããªã®ã§èªã¿è¾¼ã¿ã®ã¿ã§è¨æ¸¬ã
SSLãã
$ mysqlslap -h 10.100.xxx.yyy -uroot -p --ssl-ca=cacert.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem --concurrency=10 --iterations=10 --number-of-queries=10000 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-load-type=read Enter password: Benchmark Average number of seconds to run all queries: 4.136 seconds Minimum number of seconds to run all queries: 4.057 seconds Maximum number of seconds to run all queries: 4.341 seconds Number of clients running queries: 10 Average number of queries per client: 1000
read only SSLãªã
$ mysqlslap -h 10.100.xxx.yyy -uroot -p --concurrency=10 --iterations=10 --number-of-queries=10000 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-load-type=readEnter password: Benchmark Average number of seconds to run all queries: 4.174 seconds Minimum number of seconds to run all queries: 3.982 seconds Maximum number of seconds to run all queries: 4.404 seconds Number of clients running queries: 10 Average number of queries per client: 1000
ã»ã¼ãå½±é¿ãªãããã¼ã«ã«å士ã§è¨ã£ãå ´åãã»ã¼åãã ã£ãã®ã§SSLæ¥ç¶ã«ãã¦ãã»ã¨ãã©ãªã¼ãã¼ããããç¡ãã£ã¦ãã¨ã§ããããã
mysqlslapã®åä½ã«ã¤ãã¦ããå°ã調ã¹ã¦è¦ãªãã¨ãã®çµæã妥å½ãã¯å¤æã¤ããªããªã