[MDEV-27074] container start-up to take a long time Created: 2021-11-17 Updated: 2022-03-29 Resolved: 2021-12-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Docker |
| Affects Version/s: | 10.6.5 |
| Fix Version/s: | 10.2.42, 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Rob Schwyzer | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 10, Docker Desktop for Windows WSLv2, AMD Ryzen 5800X CPU, 32GB 3600MHz DDR4, and 2TB Samsung 980 Pro PCI-E 4.0 x4 SSD |
||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
On startup the image throws the following warnings, each of which seems to contribute to the container taking longer to finish start-up tasks, making full start-up take over a minute. Least impactful is the first warning-
This one is probably fine as-is, but if it can be addressed, would be nice. The bigger issues are these three-
Key here are the time stamps- it is 20:47:07 before the Warning: Unable to load... entries occur and then 20:47:57 after. It seems like the system waits for these to time out before proceeding. The amount of time here doesn't look significant, but this was a faster than typical run for this- it can take longer. It also feels inordinately long compared to when the temporary server starts up (and also quite long compared to Nginx and PHP-FPM container start-up times, making MariaDB the bottleneck for launching new EMP stacks). If we can resolve or work-around this issue, the MariaDB Docker container will feel much more responsive and yield a much improved user experience. |
| Comments |
| Comment by Daniel Black [ 2021-11-26 ] | |||||||||||||||||||||||||||
|
The unable to load message itself isn't incuring a timeout, these are just that these particular files are zoneinfo file. The timezone loading is quite IO intense. I did reduce the time in https://github.com/MariaDB/mariadb-docker/commit/88ff4eed96a7662c1a06b16397592af954770070, however there are better ways like LOCK TABLES ... WRITE on these that I haven't done. 50 seconds does seem like far too long however. If you don't need the timezones - MARIADB_INITDB_SKIP_TZINFO=1 can help. On the replication, yes there is an every growing list of things that should be implicitly part of mysql_install_db. It will be addressed soon. I'll look into the number of restarts and what is being done in each. Do you have a mariadb configuration file that may hint as to which bits are taking time in the server itself? | |||||||||||||||||||||||||||
| Comment by Rob Schwyzer [ 2021-11-26 ] | |||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-12-07 ] | |||||||||||||||||||||||||||
|
Thanks rob.schwyzer@mariadb.com Can you please test the image quay.io/danielgblack/mariadb-test:10.6_tz_init_lock_rather_than_alter which includes this change. Can you include -e MARIADB_RANDOM_ROOT_PASSWORD=1 in your test as the root password in the output provides a good separate between the time consumed by TZ initialization compared to the other generic user setup. Enabling the binlog, esp with sync_binlog is obviously going to be added IO. Overall the above fix might improve this somewhat, but I think I can do better. There's no need for a record of the binary log from the initialization (please correct me if there is). So the part 2, on top of the above, is to remove the the log-bin during initialization. So please test the timings of quay.io/danielgblack/mariadb-test:10.6_no_log_bin_on_temp too which is based on this change. | |||||||||||||||||||||||||||
| Comment by Rob Schwyzer [ 2021-12-08 ] | |||||||||||||||||||||||||||
|
Thank you danblack! I first tested the image as-is:
I next tested the image to use -e MARIADB_RANDOM_ROOT_PASSWORD=1 instead:
No, notable improvement. Now, using the 2nd image you provided instead, with the generated root password:
Night and day difference. Finally, testing with the original ENV config:
So quay.io/danielgblack/mariadb-test:10.6_no_log_bin_on_temp is the real difference-maker here. Finally, checking on my end with sync_binlog=1 commented out while using the original MariaDB 10.6 container image:
As expected, this is all caused by sync_binlog=1 (I spent more time evaluating hardware resource use on my end yesterday and noticed my Samsung 980 Pro 2TB was reporting 100% usage despite pumping out only ~5MB/s which usually means it's doing an enormous number of tiny writes), so your work-around of disabling binary logging for the temporary server part fixes the issue caused by sync_binlog=1. And honestly... this is perfect! There are use-cases where sync_binlog=1 makes sense and where we want to test with that on, and quay.io/danielgblack/mariadb-test:10.6_no_log_bin_on_temp enables this use-case wonderfully. If quay.io/danielgblack/mariadb-test:10.6_no_log_bin_on_temp can be merged upstream, my concerns here are fully addressed. Thank you! | |||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-12-08 ] | |||||||||||||||||||||||||||
|
Thanks for testing. https://github.com/MariaDB/mariadb-docker/commit/c6c9e6cd78d12cdb837348c644de4d543ad3dee1 Will be out next release, or maybe sooner if I get a few major features of healthcheck/mariadb-upgrade resolved. I've omitted the TZ initialization improvements, but rerolled up a fix for |