The MU forums have moved to WordPress.org

HyberDB and Number of tables (10 posts)

  1. shalsaid
    Member
    Posted 15 years ago #

    Hello

    Currently I have 100,000 Blog and expect it to grow

    I have checked wordpress MU it create 15 table per blog, and as you know each table as three files

    so we will have 4500,000 files for the Database, the file system wont handle it

    How can I setup such enviroment? is there another solution?

  2. lunabyte
    Member
    Posted 15 years ago #

    Actually, by default it's more like 8 tables, but I digress.

    With that many blogs, you'll need some hardware to push it. I'll assume you're on top of that already.

    As for database managing and scaling:
    http://premium.wpmudev.org/project/Multiple-Databases

  3. shalsaid
    Member
    Posted 15 years ago #

    my current system (built inhouse) is using two database servers

    so how much servers do you think I need?

    is there option to not create that number of tables

  4. lunabyte
    Member
    Posted 15 years ago #

    Each blog gets its own set (mostly) of wordpress tables. A few have been globalized (like the user table), but each blog has to have those. No opting out.

    For 100k blogs, it's going to depend on several factors. The biggest one is traffic.

    As a ballpark estimate, so things run smoothly and there is a little room to grow without the service coming to a screeching halt, I'd guess somewhere around 3 database servers, with 2 web servers (load balanced) should keep it running smoothly for a while.

    Then again, if the traffic is pretty high, it could take more.

    If you're new to wordpress, you may wish to explore the single user version and play with it for a while. That way you know what WP does, so you can better be prepared for what MU brings to the table.

  5. shalsaid
    Member
    Posted 15 years ago #

    for each blog ill have 8 tables

    I have 100,000 blogs so ill need 800,000 tables

    each table will create 3 files per table in the /var/lib/mysql

    so I will have 2,400,000 files

    If i will have three servers then it will create 800,000 files in the /var/lib/mysql folder

    Does linux handle that?

  6. lunabyte
    Member
    Posted 15 years ago #

    You're not thinking properly.

    Check the plugin I referenced above.

    You can break up your user tables into 16, 256, or 4096 databases.

    Will 100k blogs, and assuming growth, I'd personally use 4096 db's. Which will actually be a little more than that, once you have a global database, and maybe some additional VIP databases as well.

    That would yield an average of something like 25 users/200 tables per database to start with.

    Now, with 3 db servers, you would most likely want to put something like 2048 on one db server, 2048 on another, then your global and VIP db's on the third.

    With the plugin mentioned earlier, you can specify which db's go to what server, etc.

    As time progresses, you can add another user db server, and put something like 1365 per db server instead of 2048, etc. Or add them 2 at a time to keep the load balanced.

    As a note, do a search here for scaling, and you'll get some additional info. Some of it may be outdated, but at least you can get a historical reference of discussion to which most of the theory still applies.

  7. shalsaid
    Member
    Posted 15 years ago #

    thanks a lot :)

    do you use http://premium.wpmudev.org/project/Multiple-Databases

    or hypridDB? since i read that wordpress.com uses hyperDB

    if i added new servers would the data split on all of them? or new blogs will be written there?

  8. lunabyte
    Member
    Posted 15 years ago #

    I use that plugin, yes, and it's a life saver.

    From the very beginning, you would take your single database, and use the script that comes with the plugin to migrate data into their new database.

    When you bring new servers online, you would have to migrate the databases to those new servers, but once you do the data falls into place.

    To make it easier to think about, think about it as blogs, not tables. Each blog is assigned a database and that's where it's called from/written to/etc. It doesn't matter if that database is on db_server01 or db_server100.

    You won't have tables sharded across multiple databases, in case that's what you're thinking.

  9. shalsaid
    Member
    Posted 15 years ago #

    This is great module am using it now

    I have now two servers, 2048 db on each one

    The servers are 8G RAM any special mysql configration to handle such number of DBs

    since usually I have up to 5 DBs on each server

    Thanks

  10. tdjcbe
    Member
    Posted 15 years ago #

    It may be helpful if you gave some server details as to what you;re running. OS, versions, and the like.

About this Topic