After using the Ubuntu system for a period of time, I found that the system started slowly. when the system was just installed, it started for about half a minute. Now I found that the start time was almost one minute, so I decided to investigate it. First, Google will find many posts on the Internet that want to accelerate the startup of Ubuntu. First, we recommend a bootchart tool, which can record the Startup Process of the Ubuntu system and provide graphical display, so install a: linuxidc@www.linuxidc.com :~ $ & N
After using the Ubuntu system for a period of time, I found that the system started slowly. when the system was just installed, it started for about half a minute. Now I found that the start time was almost one minute, so I decided to investigate it.
First, Google will find many posts on the Internet that want to accelerate the startup of Ubuntu. First, we recommend a bootchart tool, which can record the Startup Process of the Ubuntu system and provide graphical display, then install one:
Linuxidc @ www.linuxidc.com :~ $ Sudo apt-get install bootchart
Restart the machine after installation
After the system is restarted, view the/var/log/bootchart/logs file:
In general, we can see that the startup process has three main parts:
1) 0 ~ 15 seconds: IO-intensive, relatively idle CPU. From the process descriptions below, it is estimated that the kernel is mounted to the file system and disk detection;
2) 15 ~ 35 seconds: I/O is idle, and the CPU is also idle. here we can see that ifup, bridge, and ifconfig are mainly related to the network, this time actually took 20 seconds (note that I did it in my laptop, and there were wireless devices );
3) 35 ~ 55 seconds: I/O starts to become intensive and CPU intensive. There are many things in this phase, such as network management services, login services, and desktops.
At the same time, I used the dmesg command to check what was done in the above three stages in terms of time:
[2.275412] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: (null)
[11.478634] Adding 4083708 k swap on/dev/sda5. Priority:-1 extents: 1 pair SS: 4083708 k
[1, 11.526044] IPv6: ADDRCONF (NETDEV_UP): eth0: link is not ready
[0, 11.639571] udevd [479]: starting version 175
[2, 11.762504] lp: driver loaded but no devices found
[12.072290] EXT4-fs (sda7): re-mounted. Opts: errors = remount-ro
12 seconds in 2nd seconds are related to mount;
[1, 14.814577] br0: port 1 (eth0) entered listening state
[1, 14.814587] br0: port 1 (eth0) entered listening state
[1, 23.797215] br0: port 1 (eth0) entered learning state
[32.800776] br0: topology change detected, propagating
[1, 32.800805] br0: port 1 (eth0) entered forwarding state
14th seconds and 32 seconds are related to the network and the br0 I set (the bridge I used to experiment with the Virtual Machine network.
As a result, I temporarily removed the bridge. After I started it again, I found that the 2nd phase was as follows:
[1, 11.526044] IPv6: ADDRCONF (NETDEV_UP): eth0: link is not ready
...
[16.317051] r8169. 0:> eth0: link up
That is to say, there is no need for bridges. It takes less than five seconds for the network to get up.
Therefore, I recently started the Ubuntu system because of the bridge settings.
In addition, we also learned that if you need to further reduce the start time, then:
1. Use an SSD hard disk;
The remaining IO-intensive operations in the 1st and 3rd phases are mainly restricted by disk I/O reads and writes. Therefore, only SSD hard disks can be replaced;
2. You can install the bum tool to manage services and disable unnecessary services (but be careful if you disable some services required by the system, the system may fail to be started ).
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2