第1åã«å¼ãç¶ãã"ãã¾ãã«ã¸ã¥ã¢ã«ã§ã¯ãªãï¼"ãå®èª¬ã¨ãªãã¤ã¤ããï½ãMySQL Casual Talksãã®第2回ãéå¬ãããã®ã§ãè¡ã£ã¦ãã¾ãããååã«å¼ãç¶ãé¢ç½ãã£ãã®ã§ãèªåã®ã¡ã¢æ¸ããè²¼ãä»ãã¦ããã¾ãã
(å
¨ç¶è¿½ãã¤ãã¦ãªãã¡ã¢ãå¤ãããã¹ãã¼ãæãã£ã·ãã ã£ãã®ã§ééã£ãè¨è¼ãããããã§ãããããã¯ãäºæ¿ã...)
# ä¾ã«ãã£ã¦ãçºè¡¨è³æãåºæã£ãããã¡ããè¦ã¦ããã ããæ¹ãè¯ãã§ãã
ã¡ãªã¿ã«ã第1åã®ã¡ã¢ã¨ã³ããªã¯ãã
追è¨
ãã®ã¨ã³ããªã§ãã¾ã¨ãçã«ãå
¬éãããè³æãç´¹ä»ããã¦ããã ãã¦ããã¾ãï½
MySQLã§NoSQL (@oinume)
- çæ²¼ãããå®ã¯MySQLã¯3.23ã®é ããããã£ã¦ãï¼
- è¬ç½ª: ä»åã¯Fusion-ioã®è©±ã¯ããªãw
ã¢ã¡ã¼ããã°
- ã¦ã¼ã¶æ°800ä¸äººè¶
- 2009/2ãµã¼ãã¹å ¬é
- ã¢ã¼ããã¯ãã£
- Webãµã¼ã x35å°ãSocketãµã¼ã x70å°ãmemcachedãµã¼ã x4å°ãFusion-ioï¼MySQL x6å°
- ãã©ãã£ãã¯: ç´2.1Gbps
- åææ¥ç¶æ°: 100000
- Webãµã¼ãã¸ã¯ã36000req/s
- Socketãµã¼ãã¸ã¯ã160000req/s
- DBã¸ã¯ã52000qps
ãã°ã§ã®MySQLã®ä½¿ãæ¹
- RDBMSã¨ãã¦ã¯ä½¿ã£ã¦ããªã
- IndexPersisterãå®è£
ãã¦ä½¿ã£ã¦ãã
- ã¢ããªã§ã¯SQLãæ¸ããªã
- fetch - è¤æ°ã¬ã³ã¼ãåå¾
- count, exists, remove, save...
ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°
- MySQLã®Slow Queryãã¿ã
- ã§ããããã ãã ã¨ããããã®ã§ã»ã»ã»
- ã¯ã©ã¤ã¢ã³ãå´ã§ãã¹ãã¼ã¯ã¨ãªçãªã®ãåºå
- Javaã®ã¹ã¿ãã¯ãã¬ã¼ã¹ãåºãã¦ãã
é ããã¿ã¼ã³ã®æ¹å
- 大éã®load(ç´°ãããã¼ã¿ã®åå¾)
- MySQLãµã¼ãã®Context Switchãæ¿ãã
- inå¥ããã¾ã使ã
- 大éãã¼ã¿ã®fetch
- key以å¤ã®ã«ã©ã ã§çµãè¾¼ããªã
- çµãè¾¼ã¿ããã«ã©ã ãå¥ãã¼ãã«ãä½ã£ã¦ä½æ
- å°æ¥çã«ã¯1åã®fetchã§åå¾ã§ãã件æ°ãå¶éããã
KVSã¨ãã¦ä½¿ãã¡ãªãã
- çSQLãæ¸ããªã
- JOINã§ããªã
- åºæ¬çã«INDEXã®å¹ããªãã¯ã¨ãªãæããããªã
- ALTER TABLEãã§ããªã
- MongoDBãªã©ã®KVSã«ç§»è¡ãããã
åãã¡ã失ã£ããã®
- ãã¼ä»¥å¤ã§ã®ã«ã©ã ã§ã®çµãè¾¼ã¿
- ç¹å®ã®ã«ã©ã ã§ã½ã¼ã
- æ¯åã¢ããªã§ã½ã¼ããã¸ãã¯ãæ¸ãã¦ãã
- ã«ã©ã ã®åå¤æ
ã¾ã¨ã
ã¡ãªããã»ãã¡ãªããããã¾ã
è¶ ã«ã¸ã¥ã¢ã«ã«ä½¿ãMySQL (@tasukuchan)
- ã°ãã£ã©ãã
- DeNA!!ã«è»¢è·ããã°ãã!
- åè·ã§ã¯ãSenna/groongaã®éçºã¨ã
MySQLããã£ã¨ã«ã¸ã¥ã¢ã«ã«ä½¿ãã
ã¾ãã¯MySQL
- æåã®é¸æè¢ã¨ãã¦
- éç¨å®ç¸¾ã®ãªãéç¨ã¯å¤§å¤
- ã·ã¹ãã ãç¶æãã人件費
- éç¨æ
å½è
ã®æ°æã¡ã«ãªã
- èªåã24h/365dãããã¦ãå®ããã§ããã
- MySQLã¯æ¯ãã¦ãã
- éç¨å®ç¸¾ã®ãªãéç¨ã¯å¤§å¤
ã«ã¸ã¥ã¢ã«ã¹ãã¼ã
- idã¯è´
æ²¢ã«BIGINT
- JSON/XMLãvalueã«ã©ã ã«ä¿å
- natural_key/created/updatedã¯å¥ã«ã©ã ã§
- ã¤ã³ããã¯ã¹å¿
è¦ã ã£ãããå¥ã®ãã¼ãã«ä½æãã
- FriendFeedæ¹å¼
ã¹ãã¼ãã®åçå¤æ´
- ã«ã©ã 追å ããã°ããããããï¼
- åçãªã«ã©ã 追å ã¯é
ã
- MySQLã®ALTER TABLEã¯é ã
ã«ã©ã ã®åç追å
- openarkkit
- MySQL便å©ã°ããºè©°ãåãã
- oak-online-alter-table
- å¥ã®ä¸æãã¼ãã«ãæ°ã¹ãã¼ãã§ä½æ
- å ãã¼ãã«ãããã¼ã¿ã³ãã¼
- å·®åè£æ£
- ãªãã¼ã
- OnlineSchemaChange.php by facebook
- åºæ¬çã«ã¯oak-online-alter-tableã¨åã
ã¡ãã£ã¨ãã工夫
- MessagePack+Snappy
- ãã¼ã¿å®¹éãå§ç¸®ã§ãã
- 6å²ããã縮ãããã
- I/Oãæ¸ã
ã¾ã¨ã
éç¨æ å½è ã大äºã«ããã
Performance Schemaæ´»ç¨å ¥é ([@nippondanji)
ã«ã¸ã¥ã¢ã«ã«ãã£ã¼ããªæ©è½ã使ãããªãã
Performance Schemaã£ã¦ï¼
- æ å ±ãåéããããã®ãã¼ã«
- MySQL5.5ããæè¼
- ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ãã¦å®è£
- ããç´°ãããªæ å ±ãæ¡åã§ãã
MySQLã®ç¶æ³ãç¥ããã
- ãã¾ãåããªãï¼æ§è½ãåºãªãï¼ã¯ã¨ãªçµæãããããï¼ãªã½ã¼ã¹æ¶è²»éãå¤ãï¼
ã©ããã¦æ°ããä»æããå¿ è¦ã
- éç ´å£æ¤æ»ã¯é£ãã
- åãã¦ããã·ã¹ãã ãæ¢ããã®ã¯NG
MySQLã«ãç¶æ³ã調ã¹ãæ¹æ³ã¯ãã
- ããã»ã¹ç£è¦
- ããã»ã¹ãåå¨ãããã©ãã
- pgrep -x mysqld
- mysqladmin ping
- ããã»ã¹ãåå¨ãããã©ãã
- STATUSã³ãã³ã
- æãåºæ¬çãªçµ±è¨æ å ±ãè¦ãã
- SHOWã³ãã³ã
- çµ±è¨æ å ±
- ç¾å¨ã®ã¹ãã¼ã¿ã¹
- ã¹ãã¢ãããã·ã¼ã¸ã£ã§ä½¿ããã°ã»ã»ã»
- INFORMATION_SCHEMA
- SQLæ¨æºã§å®ç¾©ãããæ å ±åå¾æ¹æ³
- SELECTã§æ å ±ã«ã¢ã¯ã»ã¹ã§ãã
- EXPLAIN
- ã¯ã¨ãªã®å®è¡çµæã表示ãã
- ãã¥ã¼ãã³ã°ã«å¿ é
- SHOW PROFILE
- ã¯ã¨ãªãã©ãã§æéãé£ã£ã¦ããããããã
- ãã°
- GDB
- ã©ããªæ
å ±ã§ãè¦ãã
- ç¹æ»´ã¯optimized away
- ãã ãæéãæ¢ã¾ã
- ãããã°æ å ±å¿ é
- ã©ããªæ
å ±ã§ãè¦ãã
- DTrace/SystemTap
- åçã«ããã»ã¹ããã¬ã¼ã¹ãã
- æ±ç¨çãªä»çµã¿
- ã¹ã¯ãªããã§ããç´°ãããªèª¿æ´ãã§ãã
- SolarisãLinuxã§ãã使ããªã
- åçã«ããã»ã¹ããã¬ã¼ã¹ãã
- DBUGãã¬ã¼ã¹
- ãããã°çãã«ãã§å©ç¨ã§ãããã¬ã¼ã¹æ©è½
- é¢æ°ã®å¼ã³åºãã¨ãªã¿ã¼ã³
- ãã®ä»å¿ è¦ã«å¿ãã¦æ å ±ãåºå
- MySQLã§åãããã¬ã¼ã¹ã¨ãã¦ã¯æå¼·ã ããæ å ±ãµã¤ãºãã§ãããã
PERFORMANCE_SCHEMA
- DTraceã®SDTã«ä¼¼ã¦ãã
- ã½ã¼ã¹ã³ã¼ãã«åãè¾¼ã¾ããInstrumentsã¨ãã観測ç¹ããæ å ±ãåé
- çµ±è¨æ å ±ã¨å±¥æ´ãæºãè¾¼ãã§SQLã§ã¢ã¯ã»ã¹
- Windowsã§ã使ãã
ãªã¼ããããã¯ï¼
- CPU
- è¥å¹²ãããç¡è¦ã§ããªã
- ææã¡ã®ãã¼ãPCã§ããã©è¨æ¸¬
- PSãªã: 2285.76tps
- PSãã: 1804.77tps
- ã¡ã¢ãª
- è¨å®ããã¼ã¸ã§ã³ã«ããããæ°ç¾MB
å©ç¨ã·ã¼ã³
- è¤æ°ã®ã¹ã¬ã¼ã群ã®ãã¡ã®1åã§ä½¿ã£ã¦ã¿ãã¨ã
- æ¯ãåãã®éã¿ä»ãã§èª¿æ´
è¨å®
- MySQL5.5以ä¸
- mysql_install_dbå®è¡ãããèªåã§ä½ããã
[mysqld]
performance_schema
â»åçã«ã¯å¤æ´ã§ããªã
mysql-5.6-labs-performane-schema
- MySQL5.6ã§æè¼ããããããããªãæ©è½ã追å ããã¦ããããå®é¨çãªãã¼ã¸ã§ã³
- ããªãå å®ãã¦ããããããå®è·µçã«ãªã£ã¦ãããã¨ã
ã«ã¸ã¥ã¢ã«ã«ä½¿ãã«ã¯ï¼
æ®å¿µãªãããããªæ¹æ³ã¯ãªãw
ãã¼ãã«ã®ç¨®é¡
- setup: å種è¨å®
- instance: mutexçã®ã¤ã³ã¹ã¿ã³ã¹æ å ±
- wait event: å種æä½ã«ããã£ãæé
- stage event: ãããã¡ã¤ãªã³ã°æ å ±
- statement event: ã³ãã³ãå®è¡å±¥æ´
- table io event: ãã¼ãã«ãã¨ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ãã¨ã®ãªã¯ã¨ã¹ã
- summary: å種統è¨æ å ±
- ãã¼ãã«ã¸ã®ã¢ã¯ã»ã¹ã«ãããæéã®åè¨ãæ大ãæå°ãå¹³åå¤ç
- ç´è¿ã®ã¹ãã¼ãã¡ã³ãã®å±¥æ´ã表示ãããã¼ãã«ãªã©ããã
æ°å¤ãã¿ãã¨ãã®ãã¤ã³ã
- æéåä½ã¯ãã³ç§
- ããè¦ããã®ã¯ãã¥ã¼ãå®ç¾©
ã¾ã¨ã
- PSã¯æ
å ±ãè¦ãããã®æ°ããªæ段
- ã¾ã çºå±éä¸ã ãã©
ï¼ããããLTéå§ï¼
MySQL Event Scheduler Casual Vol.1 (@myfinder)
- Event Schedulerã¯å®éç¨ã§ä½¿ã£ã¦ãã
- Event Schedulerã¯ãæå®ããæå»ã«æå®ããå¦çãè¡ã(cronã¿ãããªãã®)
- MySQL5.1以ä¸å¿ é
- æå¹ã«ããããevent_schedulerã®ã¦ã¼ã¶ã§ããã»ã¹ãç«ã¡ä¸ãã
- éç¨ã®ç¨é
- ãã¼ãã£ã·ã§ãã³ã°ãããã¼ãã«ã®ãã¼ãã¼ã
- ...
- 注æç¹
- ãã¹ã¿/ã¹ã¬ã¼ãã¨ãã«ONã«ãã
- åºæ¬çã«ãã¹ã¿ã§ã®ã¿enable(ã¤ãã³ã)ã«ãã
- ...
- è¨å®é
ç®ãç£è¦ãã¹ã
- show variablesã§æå¹ã«ãªã£ã¦ããããç£è¦
- Eventãæä½ãã対象ãç£è¦
- ...
- é害復æ§
- ã¹ã¬ã¼ãããã¹ã¿ã«ææ ¼ãããã¨ã
- ãã¹ã¿ã§ONãã¹ã¬ã¼ãã«OFFã§
- ...
â»ã¹ãã¼ãã«ã¤ãã¦ããããå ¨ä½çã«ã¡ã¢ã§ãã¦ãã¾ãã(><)
MySQL 4.0 Casual (@kazeburo)
- MySQL4.0
- 2002/8: 4.0.2 betaãªãªã¼ã¹
- 2007/2: 4.0.30
è¦å´ãã5ã¤ã®ãã¨
- 4.0ã®ã½ã¼ã¹ã³ã¼ããæã«å
¥ããªã
- æã£ã¦ãã人ã®èãã¦ã¿ã
- ãã¡ã¤ã«åã§ã°ã°ã
- innodb_buffer_pool_size
- 10GBã§è¨å®ãã¦ã2GBã§èªè
- secondary index and order by primary key
- ãªãã Using filesort
- 5.0.48ã§Fix.
- mysql 4.0 clientã5.1.57ã®serverã«ã¤ãªãããªã
- 5.1.58ã§Fix.
- GET_LOCKãåå ã§ã¬ããªã±ã¼ã·ã§ã³ããããªãæ¢ã¾ã
ã¾ã¨ã
MySQL5.1以ä¸ã使ãã¾ãããw
MySQL 5.0 -> 5.5 ã¸ã®ã¢ãããã¼ãã«ã¤ã㦠(@oranie)
- ãµã¼ãã¹ãã°ã®è§£æç¨ã®DBã§ä½¿ã£ã¦ãã®ã§ãéãæ¹(5.5)ãããããã£ã
- 好ããªæ¹æ³ã§ã¤ã³ã¹ãã¼ã«ããªãã
- ãã¼ã¿äºææ§ãèæ ®ãã¦ã1度ã5.1ãçµç±ããæ¹ãè¯ã
- ããã¯ã¢ãã => ãã¼ã¿ãã¡ã¤ã«ã³ãã¼ => dumpãã¼ã¿
- mysql_upgradeã使ç¨
- ããä¸é¨ã¯è§£æ±ºããªãã¦ãçµå±dumpã¨ã£ã¦å ¥ãç´ããæ¹ããããã
- 5.5ã«ã¢ãããã¼ãããã«ã¯ãyum使ãããã®ã§remiã¬ãã¸ããªä½¿ã£ã
- 5.5ã«ä¸ããããå¤ãã£ãorå»æ¢ã«ãªã£ããªãã·ã§ã³ãå°éã«ã¤ã¶ãã¦ãã
Master n 対 Slave 1 ã¬ããªã±ã¼ã·ã§ã³ã®ä½ãæ¹ (@do_aki)
â»é«éãã³ãã«æåãã¾ããï½ã¾ã¨ãã«ã¡ã¢ããªãã£ãï½
- ãã¹ã¿n:ã¹ã¬ã¼ã1ã®ã¬ããªã±ã¼ã·ã§ã³
- change master to ã使ã£ã¦...
- masterãé 次åãæ¿ã
- çµæããã¼ã¿ä¸æ´åã§ã
- change master toã§relay logæ¶ãã¡ãã£ã
- sql threadã®ä½ç½®ãå¾ ã¤ã®ã¯éå¹ç
- io threadã®ä½ç½®ã§å¾
ã¤
- master_pos_wait()
- io threadã¯ããã©ã³ã¶ã¯ã·ã§ã³éä¸ã§ãåæ¢ãã
- çµæ
- 3ç§ãã¨ã«åç §å ãåãæ¿ã
- ããã§ã1ã¶æè¿ãå®å®ç¨¼å
ã¾ã¨ã
- n:1ã¬ããªã¯å®ç¾å¯è½
- é
延ã¯å¿
ãçºç
- éè¨ã«ä¾¿å©
- ã½ã¼ã¹ã³ã¼ãã¯githubã«ï¼
MHAã®ã㨠(@matsunobu)
- MySQLãã¹ã¿é害ã§ã¯ãã
- éåæãªã®ã§ãä¸é¨ã¾ãã¯å ¨ã¹ã¬ã¼ããåãªããã°ãåãåã£ã¦ããªãå¯è½æ§
- ãããèªåã§è£ã£ã¦ãããã®ãMHA
- ã¢ã¼ããã¯ãã£
- ããã¼ã¸ã£(管çãµã¼ã)ããã¼ãã§æ§æ
- MySQL5.0以éã§åä½
- ãã¹ã¿ãæ»ãã æã«ãè½ã¨ãã¦ãããã¤ããªãã°ãæ¾ã£ã¦é 次ãã¦ã¦ããä»çµã¿
- pacemaker+DRBDã¨æ¯ã¹ã¦ã®åªä½æ§
- ã¹ã¿ã³ãã¤ãµã¼ãããããªã
- ãã§ã¤ã«ãªã¼ãã®æéãé«é
- MySQL-MMMã¯HAã½ãªã¥ã¼ã·ã§ã³ã§ã¯ãªã
- ä»»æã®ã¹ã¬ã¼ããæ°ãã¹ã¿ã«ã§ãã
- ãã§ã¤ã«ããã¯ããã®ãé¢å
- ããããã¯ã©ããä¸ç·ã§ã楽ãªã®ã¯MySQL Clusterããã
- Mobageã§å
¨é¢çã«ä½¿ã£ã¦ã
- DeNAã«å ¥ç¤¾ããã°æ§åãè¦ãããw
- æ¥æ¬èªã®ããã¥ã¡ã³ã
- è±èªçã§åã¤ãã
- DeNA社å ã«ã¯æ¥æ¬èªWikiãããww
- ãã¹ãã±ã¼ã¹
- å ¬éãã¦ããªã
- DeNAã«å ¥ç¤¾ããã°(ry
MySQLã§NoSQL (@rkajiyama)
- labs.mysql.com
- 製åå質ã¯å¥ã«ãã¦ãé¢ç½ããã®ããããããã
- MySQL5.6
- NoSQL with Memcached
- MySQL Cluster 7.2
- NoSQL with Memcached
2種é¡ã®memcachedé£æºãããã¯ã
MySQL5.6
- MySQLãµã¼ãã«ãã©ã°ã¤ã³ã¨ãã¦memcachedã¤ã³ã¿ãã§ã¼ã¹ã追å
- ã¢ããªããã¯MySQLãµã¼ãã«æ¥ç¶
- ãããã³ã«ã¯memcached Protocol
- ãã¼ã¿æ ¼ç´å ã¯InnoDB
- ãã©ã³ã¶ã¯ã·ã§ã³å©ç¨å¯è½
MySQL Cluster 7.2
- memcachedã«NDB APIç¨ãã©ã¤ãã追å
- ã¢ããªããã¯memcachedã«æ¥ç¶ãã
- ãã¼ã¿æ ¼ç´å ã¯ããã¼ã¿ãã¼ãä¸ã®ndbclusterãã¼ãã«
- ãã©ã³ã¶ã¯ã·ã§ã³å©ç¨å¯è½
- ã¬ããªã±ã¼ã·ã§ã³å©ç¨å¯è½
ä½è«
絶è³ããã¦ããéµæ¬ã¯ã³ãã©ï½ï½
ã¨ãã¹ãã¼ãã®ããã®MySQL[éç¨+管ç]ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ã¬ã¤ã
- ä½è : 奥éå¹¹ä¹
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2010/06/12
- ã¡ãã£ã¢: 大åæ¬
- è³¼å ¥: 16人 ã¯ãªãã¯: 204å
- ãã®ååãå«ãããã° (35件) ãè¦ã