{"id":57,"date":"2015-10-02T20:47:13","date_gmt":"2015-10-02T19:47:13","guid":{"rendered":"http:\/\/188.166.119.205\/?p=57"},"modified":"2026-11-10T05:52:03","modified_gmt":"2026-11-10T05:52:03","slug":"running-multiple-instances-on-the-same-hardware","status":"publish","type":"post","link":"https:\/\/banyek.net\/?p=57&lang=en","title":{"rendered":"Running multiple instances on the same hardware"},"content":{"rendered":"<p>Currently, we have one database cluster with 15 different schemas \u2013 these schemas could be either schema which contains \u201creal\u201d data, or just schemas with metadata.<\/p>\n<p>I guess the next evolutionary step of our database stack would be to split up the database cluster vertically along these schemas. All the data schemas should be moved to standalone mysql instances and put the metadata schemas next to them. This also could be a good project for prepare to move a certain part of the database for example to a cloud provider while other parts are still kept on bare metal.<\/p>\n<p><!--more--><\/p>\n<p>I started wondering what could be the best way to split MySQL instances into a single hardware. I have the following ideas:<\/p>\n<ul>\n<li>Hack init scripts to start different instances on different ports (and log directories, data directories, config files too)<\/li>\n<li>Use mysqld_multi<\/li>\n<li>Use MySQL Sandbox<\/li>\n<li>Use docker<\/li>\n<\/ul>\n<p>The first one doesn\u2019t look good for me because that could make hell any of the upgrades, the rpm package will probably rewrite my init script every time, so I have to fix this manually from time to time. It\u2019s simply a NO GO.<\/p>\n<p>It just looks like mysqld_multi is designed for this purpose. It has good documentation, there are blog posts about them. It is worth to check out.<\/p>\n<p>MySQL Sandbox also a project aimed at running multiple instances on the same hardware, but as reading it\u2019s documentation, it is more designed for testing, checking out features than put into production.<\/p>\n<p>Docker seems the sexiest and neat from all of the above, but I don\u2019t know how many overheads it will generate either in network usage or in any other resource usage. It has a great advantage that docker allows to map resources for containers \u2013 like CPUs -, which could be useful, however, I don\u2019t know how I could map the data directories for containers \u2013 they must be included inside, or they could be left on a host? (EDIT: Volume plugin)<\/p>\n<p>I\u2019ll start my experiments and tests, and I will blog about them here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Currently, we have one database cluster with 15 different schemas \u2013 these schemas could be either schema which contains \u201creal\u201d data, or just schemas with metadata. I guess the next evolutionary step of our database stack would be to split up the database cluster vertically along these schemas. All the data schemas should be moved [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[134],"tags":[194,216,144,126],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-tech-en","tag-docker-en","tag-multiple-instances-en","tag-mysql-en","tag-oldblog-en"],"_links":{"self":[{"href":"https:\/\/banyek.net\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/banyek.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/banyek.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/banyek.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/banyek.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":1,"href":"https:\/\/banyek.net\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":428,"href":"https:\/\/banyek.net\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions\/428"}],"wp:attachment":[{"href":"https:\/\/banyek.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/banyek.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/banyek.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}