Changes between Version 1 and Version 2 of MysqlConfig


Ignore:
Timestamp:
Apr 25, 2007, 10:47:16 AM (17 years ago)
Author:
Nicolas
Comment:

Converted by an automatic script

Legend:

Unmodified
Added
Removed
Modified
  • MysqlConfig

    v1 v2  
    1212== MySQL DB Engines (or Table Types) ==
    1313
    14 == General ==
     14=== General ===
    1515  The MySQL software comprises a number of DB engines. For SETI@home DB only 2 are used, Innodb and MyISAM. They have different features and are used according to the performance requirements of the project. One can use all of the different engines (or table types) or just a single one in a MySQL DB, just depending on the query activity against each table in the project among other.  MySQL software  is available in 32 bit and 64 bit binaries for downloading. Using 32 bit MySQL requires that all RAM resources that are assigned to the various DB engines, must sum to no more than 2GB of RAM. There is no such limitation with 64 bit MySQL and large amounts of RAM help Innodb performance.
    1616
    1717
    18 == MyISAM ==
     18=== MyISAM ===
    1919  The MyISAM engine requires the least amount of computer resources can be used where there is a low DB activity requirement. For example with query rates lower that 5/sec this table type may be adequate. Also if one does not have a dedicated DB server this may be a good choice for all the tables since it consumes much less computer resources. It has the advantages of allowing long text indices against tables which Innodb does not allow.  MyISAM creates an OS file for each table and one for all the indices related to the specific table (and another for the table format info).
    2020
     
    2222
    2323
    24 == Innodb ==
     24=== Innodb ===
    2525  The Innodb engine is used for most of the tables in SETI@home project. It processes multiple simultaneous queries against its tables. It is a versioning DB engine that holds an image of the table at the start of a query and maintains it until that query is completed. Other updates are allowed during queries and in general for short queries there is no problem. Innodb uses the Innodb log  to store changes to its tables until it flushes these changes to the actual tables at syncpoints. If for any reason there is a server event that causes a system failure, Innodb will use this log to recover the Innodb tables to consistency. There are a minimum of 2 transaction log files with a total maximum size of 4GB.  Innodb tables/indices are usually stored in large OS physical files and the tables and indices are managed internally within these OS/Innodb files. It is important that these files are located on high performance devices. The transaction log files should be located on independent high performance media (away from the Innodb files) for sustained high transaction rates. At DB shutdown all modified buffers have to be flushed into the transaction logs before MySQL goes away, so slow performance drives for the transaction log could delay shutdown for over 30 minutes when there are a large number of .modified buffers. to be flushed.
    2626
     
    2828== Physical Requirements ==
    2929
    30 == CPU ==
     30=== CPU ===
    3131  Assuming the need for more than 70,000 users and 250K hosts with an average workunit turnaround of about 10 hours then one should get an Opteron dual-core class CPU. It is a 64-bit architecture and can access up to 32GB of RAM. It is qualified to run Solaris, Linux and Windows XP 64-bit (?) . There are 64-bit versions of MySQL for Linux and Solaris OSes.  This is by no means the only hardware that will work with BOINC/MySQL, however SETI@home uses this type of hardware and serves over 350K user and over 630K hosts. If your requirements are smaller, then many 32bit hardware and OSes may be perfectly adequate.
    3232
    3333
    34 == RAM ==
     34=== RAM ===
    3535  The RAM requirement is related to the number of active subscribers who are expected to volunteer for the project and the number of threads that will be connected to the MySQL server. We recommend a minimum of 2GB dedicated to MySQL for about 20,000 . 30,000 volunteers growing to servers with much larger RAM sizes, say 6GB for up to 450K volunteers. This is also related to disk IO rates that are available for use by the data and log files. For example Innodb will store modified data in RAM until a syncpoint at which time data is flushed to disk; during this time update transactions are paused until the flush is completed. If there is large RAM and slow disk IO, the pause can last for several minutes. A similar delay can be noted when attempting to shutdown the project database when all the modified buffers must be flushed to disk before MySQL will shutdown, this delay could be 30 minutes or more.
    36 == IO Subsystem ==
     36=== IO Subsystem ===
    3737  Assuming a high performance requirement of more than 200 DB queries/sec there should be separate controllers for for the data and the log files. In the case of Innodb log files it is very important that they are on very reliable media for example mirrored (RAID 1) drives. The tables and indices require wide band or high throughput disk configuration such as RAID 10.  Some consideration should be given to having online spare disk drives since this will help to minimize down times in case of failures.
    3838
     
    4040== Normal Operations ==
    4141
    42 == General ==
     42=== General ===
    4343  For normal operations or production there are some considerations that should be addressed to enable the project personnel to provide reliable service. For example there should be a reliable power supply with UPS protection to avoid uncontrolled shutdowns. The temperature of the hardware operations room should be regulated to hardware specifications to avoid premature aging/failure of hardware components.  And the MySQL software has to be set up to take advantage of the hardware resources that are available.
    4444
    4545
    46 == Config File (my.cnf) ==
     46=== Config File (my.cnf) ===
    4747   The config file needs to be set up for production environment.  MySQL has defaults for where it allocates the files that it needs;  where they are placed depends on the OS on which it is running.  For greater control, space management and performance the user should  define where these files are assigned.  For example the base data directory for MySQL tables etc  in Linux is /var/lib/MySQL.  For SETI@home we assigned this to directory to another data partition  /mydisks/a/apps/mysql/data/,  to ensure that there was enough space and performance.  It made it easy to do physical backups without including  additional files that were not related to the database.   Here are some other file directory assignments for the SETI@home environment:
    4848
     
    122122== Monitoring ==
    123123
    124 == MYTOP ==
     124=== MYTOP ===
    125125  During normal operations it is useful to monitor the MySQL IO traffic, memory usage and connection activity to various client applications. Mytop application script give useful realtime status for the MySQL engine. Here is a sample of the first lines of its output:
    126126{{{
     
    190190}}}
    191191
    192 == IOSTAT: ==
     192=== IOSTAT: ===
    193193  Iostat is the UNIX type utility that provides a display of the IO statistics for peripherals on a server or workstation. For continuous displays of extended information for all devices. Iostat should be invoke as follows:
    194194{{{
     
    196196}}}
    197197 (this will produce an updated display every 5 seconds for all devices and give data in KB)
    198 == MySQLAdmin ==
     198=== MySQLAdmin ===
    199199  This program is making changes and getting the status of various MySQL parameters. It is not interactive but can be made to repeat a given function by using number repeat option.  For example
    200200{{{
     
    202202}}}
    203203   This will show the status display and repeat the display every 10 seconds.  Adding the .r option will give followup displays that show delta  differences with the first display values.  Performance Tweaking
    204 == General ==
     204=== General ===
    205205  An often overlooked area of performance is the requirement for reliable power and air conditioning. Power failures can eliminate all the benefits accrued by careful planning for hardware and software installations. Experience is that unreliable power can lead to days of recovery with data loss and subscriber discontent. Similarly, insufficient cooling accelerates the aging of hardware components and can cause data corruption and downtime more frequently than the one would expect given the hardware specs.
    206206{{{
     
    211211}}}
    212212
    213 == MySQL Configuration ==
     213=== MySQL Configuration ===
    214214  Multi threads, query caching
    215 == Files. Distribution ==
     215=== Files. Distribution ===
    216216  Innodb files, transaction log files, bin-log files, MyISAM data/index files
    217 == Slow Query Log ==
     217=== Slow Query Log ===
    218218  Turn on Slow Query log to monitor slow queries.
    219 == RAM Allocation ==
     219=== RAM Allocation ===
    220220  Innodb vs MyISAM