{"id":13782271,"url":"https://github.com/magenx/magento-mysql","last_synced_at":"2025-05-11T15:32:19.106Z","repository":{"id":5476941,"uuid":"6673667","full_name":"magenx/Magento-mysql","owner":"magenx","description":"Magento default mysql settings","archived":false,"fork":false,"pushed_at":"2021-08-12T11:41:48.000Z","size":91,"stargazers_count":194,"open_issues_count":0,"forks_count":80,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-11-17T17:43:08.120Z","etag":null,"topics":["magento","mysql","percona"],"latest_commit_sha":null,"homepage":"https://www.magenx.com","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ashish1294/code-now","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magenx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.com/paypalme/magenx"]}},"created_at":"2012-11-13T16:22:21.000Z","updated_at":"2024-07-04T11:23:32.000Z","dependencies_parsed_at":"2022-07-30T14:48:03.569Z","dependency_job_id":null,"html_url":"https://github.com/magenx/Magento-mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magenx%2FMagento-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magenx%2FMagento-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magenx%2FMagento-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magenx%2FMagento-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magenx","download_url":"https://codeload.github.com/magenx/Magento-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588675,"owners_count":21932300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["magento","mysql","percona"],"created_at":"2024-08-03T18:01:34.644Z","updated_at":"2025-05-11T15:32:18.456Z","avatar_url":"https://github.com/magenx.png","language":"Perl","funding_links":["https://www.paypal.com/paypalme/magenx"],"categories":["MySQL"],"sub_categories":["Full Page Caching"],"readme":"﻿magento-mysql\r\n-------------\r\n\r\nMagento default mysql settings\r\n==============================\r\n\r\n\u003edefault/startup settings for mysql database.\u003cbr/\u003e\r\n\u003eplease read this before changing anything!\r\n\r\n    GENERAL OPTIONS\r\n\r\n1. **max_connections**\u003cbr/\u003e\r\n *How many connections to allow. Watch* **max_used_connections** *value*\r\n\r\n2. **thread_cache**\u003cbr/\u003e\r\n *Cache to prevent excessive thread creation*\u003cbr/\u003e\r\n *50-100 is good value. Watch* **threads_created**\u003cbr/\u003e\r\n\r\n3. **table_cache/table_open_cache**\u003cbr/\u003e\r\n *Cache of opened table instances*\u003cbr/\u003e\r\n *Single table may have multiple entries*\u003cbr/\u003e\r\n *Watch* **opened_tables** *status value*\u003cbr/\u003e\r\n *Start with 4096*\u003cbr/\u003e\r\n\r\n4. **open_files_limit**\u003cbr/\u003e\r\n *MyISAM tables require up to 2 file handlers*\u003cbr/\u003e \r\n *Each connection is file handler too*\u003cbr/\u003e\r\n *Safe to set to 65535 in most systems*\u003cbr/\u003e\r\n\r\n5. **table_definition_cache**\u003cbr/\u003e\r\n *Cache table definitions (CREATE TABLE)*\u003cbr/\u003e\r\n *Only one entry  per table*\u003cbr/\u003e\r\n *Watch* **Opened_table_definitions**\u003cbr/\u003e\r\n *Set to number of tables + 10% unless 50K+ tables*\u003cbr/\u003e\r\n\r\n6. **back_log**\u003cbr/\u003e\r\n *Need adjustment if many connections/sec*\u003cbr/\u003e\r\n *2048 is reasonable value*\u003cbr/\u003e\r\n\r\n7. **max_allowed_packet**\u003cbr/\u003e\r\n *Limits maximum size of query*\u003cbr/\u003e \r\n *Limits internal string variable size*\u003cbr/\u003e \r\n *16MB is a good value*\u003cbr/\u003e\r\n\r\n8. **max_connect_errors**\u003cbr/\u003e\r\n *Prevent password brute force attack*\u003cbr/\u003e\r\n *Can cause \"Host Blocked\" error messages*\u003cbr/\u003e\r\n *Value around 1000000 is good*\u003cbr/\u003e\r\n\r\n9. **skip_name_resolve**\u003cbr/\u003e\r\n *Avoid DNS lookup on connection. Faster and Safer*\u003cbr/\u003e\r\n *Do not use host names in GRANTs*\u003cbr/\u003e\r\n\r\n10. **old_passwords**\u003cbr/\u003e\r\n *Should NOT be enabled. Will cause insecure password hash to be used.*\u003cbr/\u003e\r\n\r\n11. **log_bin**\u003cbr/\u003e\r\n *Enable for replication and point in time recovery*\u003cbr/\u003e\r\n *Set to mysql-bin to avoid default naming*\u003cbr/\u003e\r\n\r\n12. **sync_binlog**\u003cbr/\u003e\r\n *Make Binlog durable.  Set to 1 if have RAID with BBU or Flash*\u003cbr/\u003e\r\n *Can be really performance killer with slow drives.*\u003cbr/\u003e\r\n\r\n13. **expire_log_days**\u003cbr/\u003e\r\n *Purge old binary logs after this number of days*\u003cbr/\u003e\r\n *14 (2 weeks) is a good value with weekly backups*\u003cbr/\u003e\r\n\r\n14. **tmp_table_size**\u003cbr/\u003e\r\n15. **max_heap_table_size**\u003cbr/\u003e\r\n *Typically set to same value (workload based)*\u003cbr/\u003e\r\n **Created_tmp_disk_tables** *status variable*\u003cbr/\u003e \r\n *Beware BLOB/TEXT fields cause on disk table with any size.*\u003cbr/\u003e\r\n\r\n16. **query_cache_size**\u003cbr/\u003e\r\n *Enable query cache only if it is tested to provide significant gains*\u003cbr/\u003e\r\n *Often causes stalls and contention*\u003cbr/\u003e\r\n *Do not set over 512M*\u003cbr/\u003e\r\n\r\n17. **sort_buffer_size**\u003cbr/\u003e\r\n *In memory buffer used for sorting*\u003cbr/\u003e\r\n *Watch* **sort_merge_passes**\u003cbr/\u003e\r\n *Consider setting for session for large queries*\u003cbr/\u003e\r\n *Values up to 1MB are good default*\u003cbr/\u003e\r\n *Large values hurt performance of small queries*\u003cbr/\u003e\r\n\r\n18. **join_buffer_size**\u003cbr/\u003e\r\n *Helps performance of Joins with no indexes*\u003cbr/\u003e\r\n *Better get rid of such Joins*\u003cbr/\u003e \r\n *8MB can be reasonable value*\u003cbr/\u003e\r\n\r\n19. **default_storage_engine**\u003cbr/\u003e\r\n *Use Innodb engine for tables if not specified*\u003cbr/\u003e\r\n\r\n20. **read_rnd_buffer_size**\u003cbr/\u003e\r\n *Buffer for reading rows in sorted offer*\u003cbr/\u003e\r\n *Specifies Maximum Value*\u003cbr/\u003e\r\n *Values around 16MB often make sense*\u003cbr/\u003e\r\n *Do not mix with* **read_buffer_size**\u003cbr/\u003e\r\n\r\n21. **Tmpdir**\u003cbr/\u003e\r\n *Specify location of temporary directory*\u003cbr/\u003e\r\n *Tmpfs often good choice unless very large temporary space is needed.*\u003cbr/\u003e\r\n *tmpdir=/dev/shm*\u003cbr/\u003e\r\n\r\n\t\tMyISAM OPTIONS\r\n\r\n1. **key_buffer_size**\u003cbr/\u003e\r\n *Cache MyISAM Indexes.*\u003cbr/\u003e \r\n *Does Not cache data.*\u003cbr/\u003e\r\n *Up to 30% of memory if using MyISAM only*\u003cbr/\u003e\r\n\r\n2. **myisam_recover**\u003cbr/\u003e\r\n *Automatically repair corrupted MyISAM tables after crash.* **BACKUP,FORCE** *is a good value.*\u003cbr/\u003e\r\n\r\n3. **myisam_sort_buffer_size**\u003cbr/\u003e\r\n *Buffer used for building MyISAM indexes by Sort. 8MB-256MB are good values*\u003cbr/\u003e\r\n\r\n4. **low_priority_updates**\u003cbr/\u003e\r\n *Allow higher concurrency for SELECTs*\u003cbr/\u003e\r\n *May starve update queries*\u003cbr/\u003e\r\n\r\n5. **bulk_insert_buffer_size**\u003cbr/\u003e\r\n *Buffer to optimize Bulk Inserts*\u003cbr/\u003e\r\n *Values of 1/4 of* **key_buffer_size** *make sense*\u003cbr/\u003e\r\n *Note it is per connection value*\u003cbr/\u003e\r\n\r\n\t\tINNODB MEMORY SETTINGS\r\n\r\n1. **innodb_buffer_pool_size**\u003cbr/\u003e\r\n *The most important setting. Often 80%+ of memory is allocated here.*\u003cbr/\u003e\r\n\r\n2. **innodb_buffer_pool_instances**\u003cbr/\u003e\r\n *Reduce contention.  Set to 4+ in MySQL 5.5+*\u003cbr/\u003e\r\n\r\n3. **innodb_log_buffer_size**\u003cbr/\u003e\r\n *Buffer for log files.  Good Values 4MB-128MB*\u003cbr/\u003e\r\n *Not only reduce writes but help contention*\u003cbr/\u003e \r\n\r\n4. **innodb_ibuf_max_size**\u003cbr/\u003e\r\n *Control size of Insert buffer. Default is 1/2 of Buffer pool. Smaller values are good for SSD*\u003cbr/\u003e\r\n\r\n\t\tINNODB IO OPTIONS\r\n\r\n1. **innodb_flush_log_at_trx_commit**\u003cbr/\u003e\r\n *Control Durability*\u003cbr/\u003e\r\n *1=flush and sync;  2=flush;  0=neither*\u003cbr/\u003e\r\n\r\n2. **Innodb_flush_method**\u003cbr/\u003e\r\n *Controls how Innodb Performs IO*\u003cbr/\u003e\r\n **O_DIRECT** *good value for most servers*\u003cbr/\u003e\r\n\r\n3. **innodb_auto_lru_dump**\u003cbr/\u003e\r\n *Percona Server Feature to warmup quickly*\u003cbr/\u003e\r\n *300 (seconds) is a good value*\u003cbr/\u003e\r\n\r\n4. **innodb_io_capacity**\u003cbr/\u003e\r\n *Controls Innodb Assumption about Disk Performance. Increase for faster drives*\u003cbr/\u003e\r\n\r\n4. **innodb_read_io_threads**\u003cbr/\u003e\r\n5. **innodb_write_io_threads**\u003cbr/\u003e\r\n *Control number of threads doing reads and writes*\u003cbr/\u003e\r\n *MySQL 5.5 has async IO so very high values might not be needed*\u003cbr/\u003e\r\n *4 is good default. Higher for large IO systems.*\u003cbr/\u003e\r\n\r\n6. **innodb_flush_neighbor_pages**\u003cbr/\u003e\r\n *Percona Server feature to control how flushing works*\u003cbr/\u003e\r\n *Disable (set to 0) for SSD*\u003cbr/\u003e\r\n\r\n\t\tOTHER INNODB OPTIONS\r\n\r\n1. **innodb_log_file_size**\u003cbr/\u003e\r\n *Size of redo log file. Larger logs better performance but longer recovery.*\u003cbr/\u003e \r\n\r\n2. **innodb_log_files_in_group**\u003cbr/\u003e\r\n *Leave at 2 which is default.*\u003cbr/\u003e\r\n\r\n3. **innodb_file_per_table**\u003cbr/\u003e\r\n *Store each Innodb table in separate file. Usually Good choice*\u003cbr/\u003e\r\n\r\n4. **innodb=force**\u003cbr/\u003e\r\n *Enable so MySQL does not start if Innodb could not initialize.*\u003cbr/\u003e \r\n *Otherwise it might start but error on access to all Innodb tables.*\u003cbr/\u003e\r\n\r\n5. **innodb_lock_wait_timeout**\u003cbr/\u003e\r\n *How long to wait for row level locks before bailing out*\u003cbr/\u003e\r\n\r\n6. **innodb_old_blocks_time**\u003cbr/\u003e\r\n *Helps to make buffer pool scan resistant*\u003cbr/\u003e\r\n *Values around 1000 make sense*\u003cbr/\u003e\r\n\r\n7. **innodb_file_format**\u003cbr/\u003e\r\n *Which file format Innodb will use*\u003cbr/\u003e\r\n *Antelope is default legacy format*\u003cbr/\u003e\r\n *Barracuda allows to use new features like compression*\u003cbr/\u003e\r\n\r\n8. **innodb_stats_on_metadata**\u003cbr/\u003e\r\n *Update statistics on meta data access*\u003cbr/\u003e\r\n *Such as Information_schema queries*\u003cbr/\u003e\r\n *Typically best disabled for more workloads Set to 0*\u003cbr/\u003e\r\n *Innodb will still refresh stats when table changes significantly*\u003cbr/\u003e\r\n\r\n9. **performance_schema**\u003cbr/\u003e\r\n *Enable Performance Schema in MySQL 5.5+*\u003cbr/\u003e\r\n *Watch potential overhead.*\u003cbr/\u003e \r\n\r\n10. **log_slow_queries**\u003cbr/\u003e\r\n *Enable Slow Query Log. Old but very helpful.*\u003cbr/\u003e\r\n\r\n11. **long_query_time**\u003cbr/\u003e\r\n *Especially with* **long_query_time** *set to 0 periodically to get sample of the load*\u003cbr/\u003e\r\n\r\n12. **log_slow_verbosity=full**\u003cbr/\u003e\r\n *Get a lot more data about queries in Percona Server*\u003cbr/\u003e\r\n\r\n13. **low_warnings=2**\u003cbr/\u003e\r\n *Get warnings about disconnects and other minor issues in error log.*\u003cbr/\u003e\r\n *More information but it can get spammy*\u003cbr/\u003e\r\n\r\n14. **userstat_running=1**\u003cbr/\u003e\r\n *Get advanced Table and Index usage statistics in Percona Server and MariaDB*\u003cbr/\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagenx%2Fmagento-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagenx%2Fmagento-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagenx%2Fmagento-mysql/lists"}