Presentation is loading. Please wait.

Presentation is loading. Please wait.

MySQL 5.1 Configuration Files & Options Part I

Similar presentations


Presentation on theme: "MySQL 5.1 Configuration Files & Options Part I"— Presentation transcript:

1 MySQL 5.1 Configuration Files & Options Part I
Presented by: Sheeri K. Cabral Twitter: @sheeri

2 About Pythian Recognized Leader: Expertise:
Global industry-leader in database infrastructure services for Oracle, Oracle Applications, MySQL and SQL Server 150 current multinational companies such as Forbes.com, Fox Sports and Western Union to help manage their complex IT deployments Expertise: One of the world’s largest concentrations of dedicated, full-time DBA expertise. Global Reach & Scalability: 24/7/365 global remote support for DBA and consulting, systems administration, special projects or emergency response - Successful growing business for more than 10 years - Served many customers with complex requirements/infrastructure just like yours. - Operate globally for 24 x 7 “always awake” services 2 2

3 What you can use this info for
Files, purpose, known issues System and status variables Tuning Includes Percona variables

4 Included/not included
Up to MySQL Includes Percona variables (5.1.36) Does not include InnoDB plugin variables

5 Directories basedir /app/mysql-5.1.29-rc-linux-x86_64/ datadir
/app/mysql/data tmpdir /tmp Basedir = installation directory $basedir/bin $basedir/data is default datadir Datadir – where data is kept by default, innodb data files by default, bin by default. Tmpdir – temporary files opened by mysql, like for replication (not temporary for alter table, or temporary intermediate files, those are in $datadir)

6 Directories language /app/mysql rc-linux- x86_64/share/mysql/english/ plugin_dir /app/mysql rc-linux- x86_64/lib/mysql/plugin

7 Configuration Files In order: /etc/my.cnf /etc/mysql/my.cnf
$SYSCONFDIR/my.cnf (--sysconfdir option to compiling)

8 Configuration Files (2)
In order (still): $MYSQL_HOME/my.cnf Server options [mysqld] [safe_mysqld] directives --defaults-extra-file ~/.my.cnf User options [client] directive commandline

9 Summary: Configuration Files
Just use /etc/my.cnf or /etc/mysql/my.cnf and optionally ~/.my.cnf if you want to store passwords, but secure the file!

10 Other Files File extensions used by MySQL
.index .MYI .MYD .TRG .TRN .ibd .info .frm db.opt Slave information master.info relay-log.info Recommend: turn on log-slave-updates on all machines db.opt, one per database, has default charset and collation info for the database in $datadir innodb_file_per_table is on, so .ibd files – data and indexes master.info has, in PLAINTEXT!!: (some timeout value = 15) master_log_file (SQL thread) master_log_pos (SQL thread) master_user master_password master_port (some timeout value = 60) (some other values, blank and 0, I believe these are ssl replication values)

11 Version Version (5.1.37-1ubuntu5-log) version_comment (Ubuntu)
version_compile_machine (x86_64) version_compile_os (debian-linux-gnu) License (GPL)

12 Basics div_precision_increment (4) Default precision value
4, so 1/11=0.0909 lower_case_table_names (1) lower_case_file_system (OFF) lower_case_table_names default is 0, case sensitivity is determined by the filesystem (Linux = case sensitive) 1 means that table names are stored as lower case, and comparison is case-insensitive. 2 means that table names are stored as they are created (ie, CREATE TABLE ShEeRi results in a .frm file of ShEeRi.frm), and comparison is case-insensitive.

13 Basics hostname (sea1tpmysql03s1) port (3306) socket (/tmp/mysql.sock)
pid file (/app/mysql/data/sea1tpmysql03s1.pid) protocol version (10) client/server mysql protocol

14 Basics storage_engine (InnoDB) also table_type time_zone (SYSTEM)
system_time_zone (PDT) timestamp ( ) used mostly in replication affects CURRENT_TIMESTAMP(), NOW() only affects SYSDATE() if sysdate-is-now is set /app/mysql/bin/mysqlbinlog mysql-bin | \ head -20 will get a sense of what the binary logs look like, including how it sets the timestamp. This is how time-based functions are replication-safe. speaking of which, SYSDATE() is not replication-safe, unless the sysdate-is-now option is set in the my.cnf.

15 Basics Queries Questions Uptime Uptime_since_flush_status
/app/mysql/bin/mysqlbinlog mysql-bin | \ head -20 will get a sense of what the binary logs look like, including how it sets the timestamp. This is how time-based functions are replication-safe. speaking of which, SYSDATE() is not replication-safe, unless the sysdate-is-now option is set in the my.cnf.

16 Connections max_connections (5000) Max_used_connections (50)
Threads_connected (33) Threads_running (2)

17 Threads Connections (439049) Threads_created (50) Threads_cached (17)
thread_cache_size (48) threads created, if this is rapidly increasing, increase thread_cache_size. Cache miss rate = threads_created/Connections Threads_cached = # threads currently in thread cache

18 When a thread is slow to launch
slow_launch_time (2) Slow_launch_threads (0) slow_launch_threads is incremented if it takes longer than slow_launch_time seconds to launch a thread. thread_cache should be in play anyway. This isn't really a timeout.

19 Aborted connects/clients
Aborted_clients (9) Aborted_connects (57932) max_connect_errors (100) FLUSH HOSTS connect_timeout Aborted_clients = client left w/out properly closing. Usually due to not closing a db handler (in code, or by someone stopping code before the close occurred). Aborted_connects = client could not connect – wrong username/password, wrong permissions, connect_timeout reached (can indicate DNS problems), or wrong info in connection packet. If a lot of aborted connections, those are errors, and 100 in a row w/out a successful login is the limit. This limit is in place to try to stop a DoS attack. :58:43 Aborted connection to db: 'database' user: 'userhere' host: `localhost' (Got timeout reading communication packets) aborted_connects = client could not connect – wrong username/password, wrong permissions, connect_timeout reached, or wrong info in connection packet Increasing the connect_timeout value might help if clients frequently encounter errors of the form Lost connection to MySQL server at 'XXX', system error: errno. If this is too low, Aborted_connects status variable will be higher (but is not the only reason)

20 Per-user limits max_tmp_tables (32) not used yet
max_user_connections (0) What is allowed simultaneously for one user (ie, simultaneous max open tmp tables, and simultaneous max user connections).

21 Security old_passwords (OFF) secure_auth (ON) skip_show_database (OFF)
secure_file_priv old_passwords use a 16-character hash instead of a 41-character hash. Less secure, but needs to be ON if you get “Client does not support authentication protocol requested by server; consider upgrading MySQL client” and the client cannot be upgraded or does not support the longer hashes (PHP! Use mysqli extenstions, in PHP 5) If secure_auth is on, don't allow clients to authenticate if they're using the older, 16-char password hash. If skip_show_database is OFF, all users can use SHOW DATABASES, but only show databases where the user has some permission. If there is *any* global privileges, SHOW DATABASES will show all databases. If ON, users need the SHOW DATABASES privilege to use the command. Value for secure_file_priv is a path. LOAD_FILE(), LOAD DATA and SELECT...INTO OUTFILE are limited to files in this directory only

22 Initial SQL init_connect String to execute when cxn is made init_file
File to execute when cxn is made init_slave String to execute when slave cxn is made

23 Query Cache query_cache_type (ON) have_query_cache (YES)
query_cache_size (128M) Qcache_total_blocks (64,428) Qcache_free_blocks (15,348) Qcache_free_memory (44.1M) Qcache_queries_in_cache (20,536) for info: query_cache_limit max size of a resultset that can be cached. approx memory size needed for each query cached is 3 blocks. query_cache_size 0 disables the query cache; values are multiples of Amount of memory allocated for the query cache (even if query_cache_type is 0/OFF) query_cache_type: 0/OFF means don't use the query cache (though the buffer is still created). 1/ON means cache all queries that can be cached (SELECT SQL_NO_CACHE can be used on individual queries not to cache), 2/DEMAND means only cache those that use SELECT SQL_CACHE.

24 Query Cache Usage query_cache_limit (4M)
Qcache_not_cached (14,000,166) Qcache_lowmem_prunes (18,290,939) Defragment with FLUSH QUERY CACHE query_cache_min_res_unit (4096) can be decreased if results are very small query_cache_limit max size of a resultset that can be cached. Qcache_hits Qcache_inserts Qcache_lowmem_prunes Qcache_not_cached – due to SQL_NO_CACHE or results bigger than query_cache_limit

25 Query Cache Usage Qcache_hits (15,399,458) Qcache_inserts (26,947,349)
Com_select (40,947,868) Query cache hit % = 39.69% com_select is not incremented when query cache is hit query cache hit % = Qcache_hits/(Qcache_hits+Com_select)*100

26 Query Cache Other query_cache_wlock_invalidate (OFF)
wlock_invalidate = If ON, a write lock on a table invalidates the query cache entries for that table, and other clients have to wait to access the table. Normal behavior is that entries are invalidated when the table is actually updated.

27 Errors/Warnings error_count (0) warning_count (0) max_error_count (64)
error_count and warning_count are read-only; they should really be status variables, not system variables. max_error_count is the max that SHOW WARNINGS and SHOW ERRORS will display, even if there were more warnings/errors.

28 Character sets character_sets_dir character_set_ client (utf8)
/app/mysql rc-linux-x86_64/share/mysql/charsets) character_set_ client (utf8) results (utf8) server (utf8) database (utf8) filesystem(binary) system (utf8) connection (utf8) character_set_filesystem: used to interpret string literals that refer to file names, ie LOAD DATA INFILE, SELECT ... INTO OUTFILE, LOAD_FILE(). “binary” = default, no conversion. If the filesystem is different than character_set_client, then file names are converted from character_set_client to character_set_filesystem before the file opening attempt occurs. character_set_system: for storing identifiers (names of dbs, tables, views, fields, indexes, tablespaces, stored routines, triggers, events, servers, log file groups, and AS aliases). character_set_connection: The character set used for literals that do not have a character set introducer and for number-to-string conversion.

29 Collations collation_ server (utf8_general_ci)
database (utf8_general_ci) connection (utf8_general_ci) For sorting

30 Locale information default_week_format (0) lc_time_names (en_US)
default_week_format – whether Sunday or Monday starts the week, if the count starts at 0 or 1, and which week is the first in the year: Mode First day of week Range First week of year 0 Sunday with a Sunday 1 Monday with more than 3 days 2 Sunday with a Sunday 3 Monday with more than 3 days 4 Sunday with more than 3 days 5 Monday with a Monday 6 Sunday with more than 3 days 7 Monday with a Monday lc_time_names – locale for date/month names

31 Logs log_output (FILE,TABLE) General Slow query Error Binary

32 General Log general_log (OFF) log (OFF)
general_log_file (/app/mysql/data/sea1tpmysql03s1.log) sql_log_off (OFF) SET SESSION sql_log_off=ON by a user with the SUPER privilege to not log anything to the general log. Off by default.

33 Slow Query Log slow_query_log (ON) log_slow_queries (ON)
slow_query_log_file (/app/mysql/data/sea1tpmysql03s1-slow.log) Slow_queries (649)

34 What gets logged as a slow query
long_query_time (0.5) log_queries_not_using_indexes (OFF) min_examined_row_limit (0)

35 Error Logging log_error (/app/mysql/data/sea1tpmysql03s1.err)
log_warnings (1) sql_notes (ON) sql_notes is equivalent to log_warnings, except for notes, and it's a session variable only. On by default

36 Binary Logging log_bin (ON) sql_log_bin (ON), sql_log_update (ON)
max_binlog_size (1G) binlog_format (MIXED) mysqlbinlog --base64-output=DECODE-ROWS expire_logs_days (7) SET SESSION sql_log_bin=OFF if you don't want to log the current session to the binary log. For example, FLUSH commands, making data changes that shouldn't replicate (ie, if sync'ing).

37 Binary Log Cache binlog_cache_size (2M) Binlog_cache_use (3,924,856)
Binlog_cache_disk_use (23)

38 Replication and Binary Logging
server_id (1) log_slave_updates (ON) sync_binlog (1) sync_frm (ON) server_id is the unique ID of the server; a slave does not apply binary log entries with its own ID. This is how infinite loops are avoided in replication (though you can make one happen accidentally if you change the server_id on a slave that is not caught up). sync_binlog will use fdatasync every x writes to the binary log. Slowest choice (if battery-backed write cache, not as slow), but also safest. Default is 0, which means rely on the OS to flush to disk. sync_frm set to ON means that non-temporary tables have their .frm file sync'd to disk with fdatasync on table create.

39 Determinism and Replication
insert_id (0) last_insert_id (0) identity (0) rand_seed1, rand_seed2 insert_id, last_insert_id are used in the binary logs so that the correct id is used in replication even if a previous insert was missed. (ie, SET INSERT_ID= /*!*/; appears in binary log) identity=last_insert_id, used for compatibility with other systems. master passes rand_seed1 and rand_seed2 to slave so that RAND() on master and slave is deterministic.

40 Slave Registration Optional, used for SHOW SLAVE HOSTS report_host
report_port (3306) report_user report_password

41 Relay Logs relay_log, relay_log_index
relay_log_info_file (relay_log.info) max_relay_log_size (0) relay_log_space_limit (0) relay_log_purge (ON) relay_log is path and filename of relay log, defaults to hostname-relay-bin in datadir. relay_log_index is path and filename of relay log index file, defaults to hostname-relay-bin.index in datadir. relay_log_info_file is path and filename of relay log information file, defaults to relay-log.info in datadir max_relay_log_size=0 means “use the value for max_binary_log_size” relay_log_space_limit is the naximum size, in bytes, of all relay logs on the slave. 0 means “unlimited”. relay_log_purge set to ON will automatically delete relay logs when they're done being used.

42 Master/Master Replication Settings
auto_increment_offset (1) auto_increment_increment (1)

43 Slave Settings slave_skip_errors (1061,1062) slave_net_timeout (60)
slave_transaction_retries (10) 1061 is duplicate key name 1062 is duplicate entry for a unique/primary key slave_transaction_retries – after x retries, there will be an error.

44 More Slave Settings slave_exec_mode (STRICT) slave_load_tmpdir (/tmp)
slave_compressed_protocol (OFF) “Controls whether IDEMPOTENT or STRICT mode is used in replication conflict resolution and error checking. IDEMPOTENT mode causes suppression of duplicate-key and no-key-found errors. Beginning with MySQL ndb and MySQL , this mode should be employed in multi-master replication, circular replication, and some other special replication scenarios. STRICT mode is the default, and is suitable for most other cases. “ a compressed protocol is used if slave_compressed_protocol is set to ON and the protocol is supported by both the master and slave.

45 Slave Status Variables
Slave_open_temp_tables (0) Slave_retried_transactions (0) Slave_running (ON)

46 Slave Session Variables
sql_slave_skip_counter (0) sql_warnings (OFF) sql_warnings - if ON, single-row inserts should produce an “information string” if a warning occurs. Default OFF. Session only

47 Do and Ignore binlog-do-db – don't use binlog-ignore-db – don't use
replicate-do-db – don't use replicate-ignore-db – don't use replicate-do-table – don't use replicate-ignore-table replicate-wild-ignore-table

48 Remember init_slave

49 Other Binary Log Variables
max_binlog_cache_size max is supposed to be 4G Appears as >17,000,000,000 G bug, fixed by

50 Stored Routines max_sp_recursion_depth (0)
automatic_sp_privileges (ON) log_bin_trust_function_creators (OFF) log_bin_trust_routine_creators (OFF) max_sp_recursion_depth = 0 disallows recusion. Max value is Stored procedure recursion increases the demand on thread stack space. If you increase the value of max_sp_recursion_depth, it may be necessary to increase thread stack size by increasing the value of thread_stack (slide 90) at server startup. automatic_sp_privileges: 1/ON = creator of stored routine automatically gets ALTER and EXECUTE privileges, auto dropped when routine is dropped. log_bin_trust_function_creators: controls whether users can be trusted not to create stored functions and triggers that will cause unsafe replication events. A setting of 0 enforces the restriction that a function must be declared with the DETERMINISTIC characteristic, or with the READS SQL DATA or NO SQL characteristic. If set to 0 (the default), users are not allowed to create/alter stored functions unless they have the SUPER privilege in addition to the CREATE ROUTINE or ALTER ROUTINE privilege. If the variable is set to 1, MySQL does not enforce these restrictions on stored function/trigger creation. log_bin_trust_routine_creators: same as previous, but for stored procedures.

51 Temporary Tables Per-thread tmp_table_size (128M)
max_heap_table_size (128M) Created_tmp_tables (2,017,444) Created_tmp_disk_tables (13,746) if created_tmp_disk_tables is too big, maybe increase tmp_table_size & max_heap_table_size

52 Memory Settings (not storage engine dependent)
join_buffer_size (128k) read_rnd_buffer_size (28M) max_prepared_stmt_count (16382) preload_buffer_size (32768) read_rnd_buffer_size - Per-client buffer used in sorting when an index is present. Larger values can improve ORDER BY and GROUP BY, but it's per-client, so be careful. Best to increase this value by session, not globally, if you can. join_buffer_size = 1 buffer for each FULL join of 2 tables. a 3-way join has to join buffers. This is ONLY used if there are no indexes on one table and a full table scan has to be done. max_prepared_stmt_count - Limit is so a DOS can't occur, 0 disables prepared statements. Prepared statements take up memory. preload_buffer_size (32768) Buffer size allocated when pre-loading indexes

53 Memory Settings (not storage engine dependent)
query_alloc_block_size (8192) query_prealloc_size (8192) thread_stack (192k) query_alloc_block_size= size of memory allocation for objects during parse and execute query stages. If memory is fragmented, increasing this can help query_prealloc_size = The size of the persistent buffer used for statement parsing and execution. This buffer is not freed between statements. If you are running complex queries, a larger query_prealloc_size value might be helpful in improving performance, because it can reduce the need for the server to perform memory allocation during query execution operations. Minimum size of persistent buffer for parse and execute query stages. Persistent, so a larger value may improve performance if there are frequent memory allocations. thread_stack = Per-thread stack size

54 Table Definition Cache
Open_table_definitions (181) Opened_table_definitions (465) table_definition_cache – larger value speeds up the time it takes to open a table; does not use file descriptors and takes up less space than table_open_cache. (Slide 44 has table_open_cache) Usually large “Opened” value means you need to increase the cache, or actually changing table definitions.

55 Sorting Variables Sort_range (2,105,552) Sort_rows (12,161,270)
Sort_scan (1,539,997) Sort_range = # sorts done using ranges Sort_rows = # sorted rows Sort_scan = # sorts done using full table scan

56 Bad Handler Status Handler_read_first (1704010)
Handler_read_rnd ( ) read_buffer_size (2M) Handler_read_rnd_next ( ) Handler_read_first: Usually indicates full index scans Handler_read_rnd: # requests to read a data row based on a fixed position; high if lots of sorting, full table scans, ie when joins aren't using keys read_buffer_size - Memory allocated for each scan of each table that is done. Multiple of 4096. Handler_read_rnd_next: read the next data row; indicative of full table scans, or otherwise not using indexes that exist.

57 Good Handler Status Handler_read_key (177,713,296)
Handler_read_next (235,042,485) Handler_read_prev (0) Handler_read_key: # of read requests that use a key. High = good Handler_read_next: incremented for each row in an index scan or range query (not necessarily good or bad, just info) Handler_read_prev: Mostly used in ORDER BY...DESC, same as Handler_read_next but for “previous”

58 Sorting System Variables
sort_buffer_size (56M) Sort_merge_passes (0) max_sort_length (1024) Sort_merge_passes = # of sort merge passes. If large, consider increasing sort_buffer_size max_sort_length = maximum for TEXT/BLOB types

59 Join Buffer join_buffer_size (56M) Select_full_join (1)
Select_scan ( ) Select_full_join = #joins that did full table scans b/c they didn't use indexes. Select_scan = # joins that did a full table scan on the first table (not both tables). High # is bad, not as bad as Select_full_join, but still not so good...find in slow query log using “log queries not using indexes”. (I think).

60 Joining max_join_size (4,294,967,295) sql_max_join_size
sql_big_selects (ON) Select_range_check (0) max_join_size = if more than this many rows need to be examined, don't allow this statement to proceed. Basically this tries to avoid runaway queries. sql_big_selects = SELECT statements > max_join_size are aborted if set to by default, which is all selects are allowed. If max_join_size is changed from the default, sql_big_selects is automatically set to 0. If max_join_size is then changed (ie, in session) then sql_big_selects is ignored. Select_range_check = # joins w/out keys that check for key usage after each row. Worry if >0, check indexes in tables.

61 Join Status Variables Select_full_range_join (0)
Select_range (808,772) Select_full_range_join = # joins that used a range search (good, uses indexes). Select_range = # joins that used a range search on the 1st table only (good, uses indexes). The 2nd table may have used exact match, no index, etc. so it's hard to tell if that means the 2nd table is bad or not.

62 Profiling have_community_features (YES) profiling (OFF) per-session
profiling_history_size (15) have_community_features – profiling was a community contributed feature... profiling = Whether or not query profiling is turned on. Per-session only. See profiling_history_size = How many queries to keep profiling information for. Rotated on a FIFO basis.

63 Optimizer optimizer_prune_level (1) optimizer_search_depth (62)
optimizer_switch (5.1.34) optimizer_prune_level (1) 0 disables, so exhaustive search. 1, plans are pruned based on # of rows retrieved by intermediate plans. optimizer_search_depth (62) max search depth of optimizer. If ># tables in the query, slower to find the plan but gets a better plan. If <# tables in the query, quick to find a plan but it may be suboptimal. If 0, system picks a “reasonable” value. If set to max tables in query +2, uses 5.0 algorithm. optimizer_switch (5.1.34, not PFM) Globally or per-session, can set index_merge={on|off}, index_merge_intersection={on|off}, index_merge_union={on|off}, index_merge_sort_union={on|off}

64 Optimization max_seeks_for_key (1.84E+019)
max_length_for_sort_data (1024) Last_query_cost (0) max_seeks_for_key = Limit assumed max number of seeks when looking up rows based on an index. The MySQL optimizer assumes that no more than this number of key seeks are required when searching for matching rows in a table by scanning an index, regardless of the actual cardinality of the index. By setting this to a low value (say, 100), you can force MySQL to prefer indexes instead of table scans. max_length_for_sort_data - The cutoff on the size of index values that determines which filesort algorithm to use. Default is 1024 bytes, range is 4 bytes – 8M Last_query_cost = of compiled query. 0 for “complex” like UNION and subquery, because it can't be calculated appropriately. Session variable, default 0

65 Optimization range_alloc_block_size (4k) sql_select_limit (1.84E+019)
range_alloc_block_size = block size allocated when range optimization is done sql_select_limit = Max # of rows to return from a SELECT query (not applied to SELECTs within stored procedures, or SELECT queries where result set is returned, as in CREATE TABLE...SELECT and INSERT INTO...SELECT)

66 SQL Behavior sql_auto_is_null (ON) sql_mode
(PIPES_AS_CONCAT,ANSI_QUOTES, IGNORE_SPACE,ORACLE,NO_KEY_OPTIO NS, NO_TABLE_OPTIONS,NO_FIELD_OPTIONS , NO_AUTO_CREATE_USER) sql_quote_show_create (ON) sql_auto_is_null= if on, SELECT * FROM tbl WHERE autoincrement_col IS NULL will return the last inserted row (similar to SELECT LAST_INSERT_ID) sql_mode - very long to explain, my book has 6 pages on it! sql_quote_show_create = SHOW CREATE TABLE statements are quoted so identifiers are escaped

67 SQL Behavior sql_safe_updates (OFF) also called i-am-a-dummy
updatable_views_with_limit (YES) new (OFF) old (OFF) sql_safe_updates = updates or deletes with no limit xor no where clause using an index are not allowed if this is set to ON. updatable_views_with_limit = YES by default, meaning that an update is allowed if it has a LIMIT to an updatable view that does not contain a unique key in its definition. If set to NO, updates with LIMIT are not allowed on these types of views. new = used in 4.0 to turn on 4.1 behaviors old = changes default scope of index hints. In general we don't recommend index hints, so this shouldn't be a problem. (index hints with no FOR clause apply only to how indexes are used for row retrieval and not to resolution of ORDER BY or GROUP BY clauses). Added in as old_mode, changed to old in , this is how index hints are used before

68 Functions have_compress (YES) Unrelated to Compression (OFF)
have_crypt (YES) local_infile (ON) have_compress (YES ) - you have zlib, can use COMPRESS() and UNCOMPRESS() Compression = Whether or not client connection is using compression. Session in scope. have_crypt (YES) the crypt() system call is available, ENCRYPT() can be used local_infile (ON) If ON, LOCAL keyword can be used with LOAD DATA INFILE to use a client-side file. Security.

69 Features read_only (OFF) have_dynamic_loading (YES)
have_partitioning (YES) have_dynamic_loading = plugins, and up

70 Features event_scheduler (OFF) have_geometry (YES)
have_rtree_keys (YES) have_symlink (YES) event_scheduler = allowed values are ON, OFF, DISABLED have_geometry = spatial data types (MyISAM only) rtree keys are used for spatial indexes (MyISAM only) have_symlink - This is required on Unix for support of the DATA DIRECTORY and INDEX DIRECTORY table options, and on Windows for support of data directory symlinks.

71 Other Variables locked_in_memory (OFF) bulk_insert_buffer_size (8 Mb)
group_concat_max_len (1024) Created_tmp_files (40) locked_in_memory - If MySQL is locked in memory with –mem-lock, uses mlockall system call, good for Solaris and Linux 2.4 systems that are heavily swapping. bulk_insert_buffer_size (8 Mb) - per thread in the bulk insert cache. Created_tmp_files – ie, for replication. No real way to change this.

72 Variables not covered SSL: have_ssl have_openssl Ssl_ and ssl_
Prepared_stmt_cnt (0) engine_condition_pushdown (OFF) Most Com_ and Handler_ engine_condition_pushdown – used in MySQL Cluster only, pushes down the WHERE condition to the storage engine.

73 Variables That Are Not Useful
big_tables (OFF) sql_big_tables old_alter_table (OFF) pseudo_thread_id (0) big_tables (OFF) was a session-only variable, and saved all intermediate sets to files. Prevents most “table is full” errors for intermediate tables. This functionality is automatic in MySQL and up, using memory for temp tables and switching to disk tables when the intermediate set is large enough. old_alter_table – see It’s used to disable the optimizations that were added in 5.1 for “Faster Alter Table” pseudo_thread_id “ This variable is for internal server use. “

74 Not used/Not useful multi_range_count (256)
table_lock_wait_timeout (50) rpl_recovery_rank (0) Rpl_status (NULL) multi_range_count – deprecated in 5.1, used in MySQL Cluster. table_lock_wait_timeout and rpl_recovery_rank – not used Rpl_status “ The status of fail-safe replication (not yet implemented). “

75 These variables are not used
time_format (%H:%i:%s) date_format (%Y-%m-%d) datetime_format (%Y-%m-%d %H:%i:%s) innodb_file_io_threads (4) used on Windows only

76 Mostly Unused Variables
log_tc_size (24Kb) not shown in SHOW GLOBAL VARIABLES Tc_log_max_pages_used (0) Tc_log_page_size (0) Tc_log_page_waits (5) log-tc-size – size of the memory-mapped implementation of the log that is used by mysqld when it acts as the transaction coordinator for recovery of internal XA transactions. Tc_log_max_pages_used = high water mark for # pages used in the log. If the product of Tc_log_max_pages_used and Tc_log_page_size is always significantly less than the log size, log-tc-size can be reduced. Currently, this variable is unused: It is unneeded for binary log-based recovery, and the memory-mapped recovery log method is not used unless the number of storage engines capable of two-phase commit is greater than one. (InnoDB is the only applicable engine.) Tc_log_page_size x 0 Tc_log_page_waits x 5 – not sure why there are waits when this is theoretically unused?

77 Win a signed copy of Sheeri’s book.
Thank You. Win a signed copy of Sheeri’s book. Leave your business card and you could win a book. We’ll invite you to read our blog posts, follow us on twitter, and join our next webinars. Drawing will be immediately after the talk once all cards are collected. - Successful growing business for more than 10 years - Served many customers with complex requirements/infrastructure just like yours. - Operate globally for 24 x 7 “always awake” services 77

78 Thank You Sheeri Cabral Questions, Comments, Feedback?
Blog: Ask me about saving 15% on our Adoption Accelerator for MySQL while at MySQL Conference 2010! 78


Download ppt "MySQL 5.1 Configuration Files & Options Part I"

Similar presentations


Ads by Google