R
R
romanwb2020-08-16 20:54:08
linux
romanwb, 2020-08-16 20:54:08

How to fix long shutdown (reboot) in ubuntu 18?

After sending the server to reboot, the server shuts down for a long time (about 3 minutes), then it starts up normally.

Before shutdown/reboot

Aug 16 20:34:35 example systemd[1]: Stopping Session 3 of user app.
Aug 16 20:34:35 example systemd[1]: Stopping Session 1 of user root.
Aug 16 20:34:35 example systemd[1]: Stopping User Manager for UID 0...
Aug 16 20:34:35 example systemd[1]: Stopping User Manager for UID 1000...
Aug 16 20:34:35 example systemd[1]: Stopped target Graphical Interface.
Aug 16 20:34:35 example systemd[1]: Stopped target Multi-User System.


After switching on
Aug 16 20:37:40 example kernel: [    0.000000] Linux version 4.15.0-112-generic ([email protected]) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 (Ubuntu 4.15.0-112.113-generic 4.15.18)
Aug 16 20:37:40 example kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-112-generic root=UUID=25e819f2-0cf9-4be3-855c-0e000e7b1648 ro quiet
Aug 16 20:37:40 example kernel: [    0.000000] KERNEL supported cpus:
Aug 16 20:37:40 example kernel: [    0.000000]   Intel GenuineIntel
Aug 16 20:37:40 example kernel: [    0.000000]   AMD AuthenticAMD
Aug 16 20:37:40 example kernel: [    0.000000]   Centaur CentaurHauls
Aug 16 20:37:40 example kernel: [    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Aug 16 20:37:40 example kernel: [    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Aug 16 20:37:40 example kernel: [    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Aug 16 20:37:40 example kernel: [    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
Aug 16 20:37:40 example kernel: [    0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
Aug 16 20:37:40 example kernel: [    0.000000] e820: BIOS-provided physical RAM map:
.............


Linux server settings
4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP + LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kocherman, 2020-08-16
@kocherman

If you want a quick shutdown, it will work slowly.
If you want it to work quickly, it will turn off slowly.
It's normal for a server to shut down longer than it takes to load.
In order to improve performance at different levels from the kernel to the application (services, database), all kinds of caches, deferred procedures, including delayed writing to disk, are included.
The system must wait until all running services complete their work properly.
Do you seriously want to optimize your server for reactive reboot? Disable caches, disable accelerators, set the minimum number of processes, turn off unnecessary threads, use OOM_Killer to maintain this minimum number of processes.

M
mayton2019, 2020-08-17
@mayton2019

Author, your logs show nothing.
The interval between events is less than 1 minute.
It's not something to fight for.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question