[MDEV-7635] update defaults and simplify mysqld config parameters Created: 2015-02-25 Updated: 2017-07-07 Resolved: 2017-02-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | 10.2.4 |
| Type: | Task | Priority: | Blocker |
| Reporter: | Richard Bensley | Assignee: | Nirbhay Choubey (Inactive) |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | 10.2-rc | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | 5.5.51 & 10.2.2, 10.2.2-1, 10.2.3-1, 10.2.3-2, 10.2.4-4, 10.2.4-1, 10.2.4-5, 10.0.29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Poor MySQL has received some negative feedback over the years 1 2. As entertaining as it is watching and listening to developers struggle and whine, I think it's about time we changed some of the defaults and made the config easier to understand. Oracle are working on changing more defaults in 5.7 3 4 5, I think we should too. Something else they have done, is to radically change the simplicity of the default server config file, /etc/my.cnf: It's quite clear there, the sql_mode has been set, which will satisfy most developers and users looking for an ACID compliant database with little tweaking, and a rough note on increasing or decreasing RAM needed for InnoDB. MariaDB now probably needs something similar for Galera, CONNET and TokuDB.
Proposed new defaults:
|
| Comments |
| Comment by Daniel Black [ 2015-02-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Morgan Tocker's defaults, for everything actually in MariaDB, seem quite sane to me. Ref 1 - bit dated. Ref 2 interesting rant: bad points:
on the valid good points:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2015-09-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As pointed out on irc, sql_mode=STRICT_TRANS_TABLES would of helped prevent https://www.bugzilla.org/security/4.2.14/ . A major release is the only time to change these defaults. 10.2 is a long way off. So many of these values are already out of date addressing some would be a good start. So to give this issue some concrete values (from mysql-5.7 changes):
My additions:
If label=order-by-optimisations are resolved:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Steinman [ 2016-01-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I would REALLY like to see group_concat_max_len default to something much higher than 1k, particularly since (as I note in https://mariadb.atlassian.net/browse/MDEV-9474) you apparently cannot set this value in either /etc/my.cnf nor as a command line argument to mysqld. Neither is this value stored in the binlog, which means potential synch problems with slaves (https://mariadb.atlassian.net/browse/MDEV-8292) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Federico Razzoli [ 2016-05-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I don't agree with --skip-name-resolve, because some people rely on hostnames. My proposals:
I also hope that this task will include more checks during startup. In a couple cases, inconsistent settings cause warnings, but more checks could be done, particularly when read_only = 1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Richard Bensley [ 2016-08-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Agree with FORCE,BACKUP for myisam recover. Out of the box MariaDB should be a reliable database to cater for the majority of installations and encourage best practices (the entire point of this ticket). Just because a server is "on" does not mean it's right. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-08-31 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My comments:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Federico Razzoli [ 2016-08-31 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
updatable_views_with_limit: Because I can't think a case when running a DELETE or UPDATE against a view with LIMIT is reliable. Instead, I assume that usually it is a bug. In fact the number of affected rows depends on LIMIT and the number of rows in the base table. Even if you delete by id, the number of affected rows could be 0 or 1 depending if underlying data changed. If the user is aware of this and considers this a good practice, he can still change updatable_views_with_limit. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2016-08-31 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
serg,
An alternate point of view for innodb_checksum_algorithm=crc32 is none. Just a gut feel but it seems that many forms storage media itself have forms of error detection/correction. The number of modern filesystems that supports data checksum/parity (based on wikipedia: filesystems) seems to include only ZFS/Btrfs/GPFS, which while generally not the greatest choice for databases, provide an indication of the low importance of this feature at a filesystem level. Its unclear if filesystems don't solve this because a) its a storage problem to solve or b) its a application level problem to solve. Provided there is sufficient bounds checking on the values read perhaps checksums on pages isn't needed? Happy to hear other opinions more researched than my simplified analysis here. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michiel Hazelhof [ 2016-09-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Is there a big advantage to sql_mode = ONLY_FULL_GROUP_BY? If not I think this would cause more harm than good (especially for users migrating to MariaDB only to find out some default setting breaks their app). Also I'd like to object against lower_case_table_names, case insensitive compares are slower and it doesn't encourage proper coding styles. Regarding optimizer_use_condition_selectivity we should be extra cautious, we have been tried this setting and anything higher than 2 resulted in infinite hanging queries (only large queries on large tables, we have yet to debug this further). On a semi related note, wouldn't it be better to stick to a default dash or underscore? The dash and underscore are now alternately used which neither promotes good standards nor makes it easier to read. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2016-10-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Noted in the MariaDB dev meetup Amsterdam 2016 character setdefault-set-server default-character-set = utf8mb4 socket authentication
expose plugin name in error message for access denied to help people that do (user) mysql -u root possibly too late? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-10-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My opinion on values that I saw in the description as of Oct 14. Part 1: VERY STRONGLY DISAGREENote: if there is such thing as a QA veto, consider it such. lower_case_table_names=1,2 I don't know how it's meant to work. With either value, all existing tables which have upper-case letters in their names will become unaccessible? use_stat_tables=COMPLEMENTARY + histogram_size=255 + optimizer_use_condition_selectivity=4 These are awful defaults, highly dangerous, and will cause a lot of pain to most users without any gain whatsoever. Table statistics and histograms are fine tools, but they are not for everyone, and cannot be used as defaults. They should be used as tuning, when people experience problems, and when their setup is thoroughly examined to make sure it won't make more harm than good. Basically, it's a prescription drug, not over-the-counter vitamins. The idea of good defaults is either to make sure that the configuration works "out-of-the-box" for most users, or it simplifies runtime tuning (e.g. not all options can be changed without server startup). This configuration does neither of that. Let's consider different scenarios. 1) Users who do not run ANALYZE TABLE
2) Users who run ANALYZE TABLE on their own reasons, on their own schedule
3) Users who run ANALYZE TABLE specifically to collect EITS data
log_queries_not_using_indexes=1 It's a good tool, but a crazy default. min-examined-row-limit=N It's yet another tool for analyzing and fine-tuning a special workflow, it mustn't be used as a default. What if a simple DML is slow because it's blocked for no good reason? What if ANALYZE is slow – it won't be logged at all, regardless the number of rows in the table? What if you forgot a long sleep somewhere deep in your query or function? All of these should go to the slow log, but with this option enabled, they won't. Part 2: DISAGREEdefault_tmp_storage_engine=InnoDB Pointless nuissance. It works much better now with 'none' and temporary tables defaulting to @@default_storage_engine. Vast majority of users have default engine either InnoDB, or MyISAM, or Aria, and maybe in future RocksDB, and would want their tmp tables be of the same engine as normal tables, right? That's what 'none' does. It's hard to imagine that somebody would want default engine MyISAM, but default tmp engine InnoDB. Setting it by default will only make non-InnoDB users have to remember to modify it separately. Worse still, people who run without InnoDB on whatever reason will start getting failures on startup until they reconfigure the instance. long_query_time=2 I think it's excessive, it will create more noise than useful output, and will be all false-positives. Instances grow in size and concurrency faster than they grow in overall speed, many queries are bound to be longer than 2 seconds even if there is nothing wrong with them. Besides, any fluctuations in IO can make it breach the limit. updatable_views_with_limit=OFF I don't see any reason to tighten this setting. AFAIR we haven't had a single complaint from users regarding effects of updates which are controlled by this option. Making it forbidden by default will most likely cause some existing 3rd-party tools stop working properly (at least MySQL manual says that some GUI tools tend to generate such queries), and thus will lower the adoption without any good reason – people will try installing the new version, see it doesn't work well on some obscure reason, and will switch back. innodb_log_file_size =128M According to MySQL manual, it's meaningless. "Sensible values range from 4MB to 1/N-th of the size of the buffer pool, where N is the number of log files in the group". Currently default buffer pool size is 128M, and there are 2 log files in the group. query_cache_strip_comments=1 Has it ever been performance-tested? I'm not sure it's very valuable, but rather suspicious. Yes, there is a specific scenario when comments are painful for query cache, but I think it's mostly a test scenario (e.g. when queries are numerated or otherwise get unique identifiers in the comments – I myself use it a lot in tests). OTHER NOTESlock_wait_timeout I also vote for lowering the value to something that people can realistically wait for (even 1 day would be much better than 1 year). Currently there is no practical difference between "locked" and "frozen forever". innodb_buffer_pool_dump_at_shutdown=ON and innodb_buffer_pool_load_at_startup=ON I'm not very happy about it, not because these values are wrong by themselves, but because of our assorted issues with startup/shutdown timeouts in scripts. I expect a considerable growth of complaints. sync_binlog=1 It would be good to have and publish at least some numbers of our performance sacrifice. Is it more like 1% or more like 50%? binlog_format=MIXED While I support this change, I think we must make a clear statement about it in a form of a blog, preferably before the GA release, to give people time to prepare to it. The change can be absolutely disastrous for setups with insufficient indexes. People need to either make sure they switch back to STATEMENT or add indexes before they get into a trouble and start loudly complaining about the regression MariaDB introduced. Also, it should be noted that in some cases MBR is not just "unsafe DML is logged as ROW, everything else STMT". There are some subtleties related to temporary tables and MBR, there have always been some bugs around it. Unfortunately, we can't see MySQL bug reports anymore, but the fact that they switched right to RBR rather than MBR makes me a little nervous about MIXED as a new default. I'll try to find time to run some tests around it. log-warnings=2 Fine, but please make sure InnoDB notifications go to a level higher than 2. table_definition_cache = autosized Have we actually merged the logic which autosizes it? Did anyone review it? innodb_stats_traditional=off Has it been performance-tested (more or less recently)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2016-10-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks elenst, happy with QA Vetos - yes I'm happy with that idea. log_queries_not_using_indexes, its meaning has changed to reflect a number of rows, commit d0064c6 - per https://lists.launchpad.net/maria-developers/msg09996.html I don't think its 100% right yet. min-examined-row-limit, partially agree that this is quite a brute force instrument - mentioned alternates in mailing list post. binlog_format - I don't think a proper examination of pros/cons of MIXED/ROW has been done. Cases like galera need to be considered and the edge cases elenst mentions. Also consider that package script detection of missing primary keys might be a good option to add a config file of binlog_format=MIXED(or keep STATEMENT) for those cases significantly affected by a ROW default. Other negatives or RBR - DML statements affecting large number of rows - can/do parallel slave options process each RBR component separately (they are in blocks of some size now anyway). innodb_force_primary_key=ON is appealing to me however apparently dragging users into modern SQL seems unpopular and letting them fail on edge cases is ok (hence sql_mode ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION). A proper pros/cons of socket authentication could also be done rather than a 1/2 prepared 10mins at a dev meetup. innodb_buffer_pool_size, also a horrible default because of the need to support those running on desktops or choosing to install on very small VMs. Is a packaging prompt to choose between "dedicated DB" and "shared server" (or a scale in-between) to configure between 80 and 20% of free RAM an option? Perhaps choose 50% of free RAM for server distros like RHEL/Centos. innodb_log_file_size could flow from this value. Making a better default for users with decent hardware and limited experience would be good. skip-name-resolve could also be installed based on a packaging script if DNS usernames aren't being used. A warning based on creation should also exist if this option is enabled. innodb_buffer_pool_dump_at_shutdown - agree timeout is an issue which is only slightly mitigated by innodb_buffer_pool_dump_pct. log-slow-verbosity=query_plan,explain hasn't been mentioned and I think it would be good to log more details since its available. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2016-10-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have updated the defaults list in the description to reflect arguments made by elenst and danblack.
There are still some variables, for which I am not clear about (and thus I have not changed them yet):
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-10-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
IMO, just keep it the same as it is in MySQL. Increasing to 64M is not a big gain anyway, and even though resizing is not a critical problem anymore, there is no reason to do it when unnecessary. I'd leave it to jplindst to decide.
It doesn't matter much – as long as the value is not too low; it's totally arbitrary anyway. I'd keep it to 10 seconds on one simple reason – as soon as people upgrade and start getting their slow log growing rapidly, they'll assume it's a performance degradation, and before they figure out it's really not, there might be some FUD and/or rollbacks to previous versions.
I lean towards "no", but I don't have a strong enough opinion on the subject.
I ran MTR tests with ERROR_FOR_DIVISION_BY_ZERO upon Monty's request. It will require some test updates (see
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2016-10-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also, with current set of defaults the following warning would pop up on server start :
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2016-10-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Case for innodb_stats_traditional=false follows from Rational for log_slow_verbosity = query_plan,explain. when a query has taken 2-10 seconds already the overhead of putting an extra 3-10 lines in log file is rather small. Disk space shouldn't be an issue for this amount and if they are going to do an explain anyway to debug it may as well include it at the time of the query.
Lets mitigate this with a clear notice in the release notes/blog, like binlog_format, long_query_time!=10 as it is impacting, but in a way that will help users generally, even if they need to change their query, indexes, or add a primary key. It is a major version upgrade, expecting users to read release notes and do basic testing I think is a reasonable expectation.
While I'm in favour of a QA veto utilizing the experience of multiple avenues of bug reports to gauge the relative stability of features, I don't think a Monty veto based on "I wrote the code" or whatever reason appropriately keeps with the ideals of a community rough consensus for technical decisions. There where a few hallway/pub comments at Percona Live / MariaDB dev meetup specifically around Monty vetos/code gatekeeper, which I defended (perhaps prematurely), and as such having a strong option and proclaiming "for the good of the users" shouldn't equate to veto because community raise changes for the same reason. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-10-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
I wasn't talking about a veto. In this issue, opinion of all interested parties is considered. In regard to sql_mode nobody so far has expressed particularly strong opinion. It makes all sense to consult with and listen to the reasoning from somebody who a) does have an opinion; b) does actually speak to different users and customers; and c) does actually know the code, regardless of writing or not writing it. He does not watch issues which don't belong to him unless specifically asked to, so he might come up with his comments quite late, which will make things more complicated should others agree with his reasoning. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2016-10-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nirbhay, What is the exact reason not to have by default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2016-10-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
igor Please check Elena's comments above. Also, we recently found a bug around it | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2016-10-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sql_mode = ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION No zero in dates is really useful for connectors. dates with zeroes are nonsense especially any languages that have a type for dates and timestamps, so connectors go great length to map invalid dates to exception or to null or to special date in (.NET uses year 1601 if I recall correctly) STRICT_TRANS_TABLES, NO_ENGINE_SUBSTITUTION - this one actually in use by the Windows installer since 5.2 (i.e sql_mode set to this in my.ini during installation). I do not recall any complains, this seems very safe. NO_ENGINE_SUBSTITUTION a must in my opinion. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-10-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My comments based on what is in bb-10.2-mdev7635 branch, as of
I'd do BACKUP,QUICK. Unexpected multi-hour repair or automatic data loss
This is unsafe in SBR, so I don't think we can change this now.
I'm not sure it's a good idea, error log is contains too much noise as it is
where does that come from?
where does that come from? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2016-10-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
serg:
OK, I will update them.
Good point. will revert it.
hmm.. I did not notice a lot of change in the test results after setting --log-warnings=2. But, the logs could get flooded with warnings like "Deadlock found when trying to get lock".
oh.. its leftover from the commit where I had use_stat_tables enabled and later the test always skipped due to "Requires: have_xtradb" so it was never caught.
No, its due to the change in binlog_format. For some reason changing the binlog format caused the row order to change. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2016-10-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@serg: Pushed the changes to bb-10.2-mdev7635 branch. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2016-12-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
expire_log_days, 0 (aka infinity) is an exceptionally large number of days. With a default max_binlog_size of 1G and general storage size I suspect 20 may be a better default value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-12-22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I disagree, rather strongly. Keeping binary logs can be crucially important for various reasons. Removing them automatically by default can be a disaster, which the user will only find out when it's too late. Size does not matter here – the activity can be low, the disk can be large, and any reasonable real-life setup will monitor the disk status anyway, and the admin will make the decision about binary logs if it comes to that. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2016-12-22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fair call. disk monitoring is a much better approach. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2016-12-22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I propose (discussed with elenst in the past while analyzing thread_pool_max_threads=65535 Usually, there should not really be an upper bound to thread count by default, but DBAs who know their workload well, might want set it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-02-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As requested, I've looked at bb-10.2-mdev7635, diff between fd0479ce592e0b7c13d67b5deda62e9090956309 and the current e2d94b684a070b94519cd45e923a3c41267f66c4. There are a few suites that haven't been fixed. I've noticed
I expect you're going to adjust them as well. Also I have some doubts about innodb_storedproc* tests. Unlike in other tests, here you've kept the strict mode without ignore close, so that it didn't allow data to be loaded, which naturally further caused differences in result sets which were re-recorded. Unless you did it on purpose, maybe it makes sense to restore the test logic. Apart from those, it looks mostly fine. I have some technical suggestions/fixes, all of which are pushed into bb-10.2-mdev7635.elenst, see I intentionally created very itemized commits, so that it was clear which is doing what, and you could pick them up separately (they are mostly independent, except for maybe one or two). Not related to tests directly, I still have some concerns about sync-binlog (see | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2017-02-10 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
thread_pool_max_threads=65535 |