Speeding Up Linux

Hello,

Recently I have been reading in a book that I can speed up Linux. So that is what I want to do, I have tried bootchart but it doesnt really work. What I want to do is start up my OpenSUSE 64-bit Tumbleweed very quickly (other words, I want it to speed up a lot. I like quick computers). Because I have to wait about 40 seconds for it to start up, what I want to do is know how to prevent useless apps from starting up at boot time, and then other things I can do to make the computer quicker (it is already fast enough, but I would like it to be super-fast). I mainly want the boot time to be speeded up, and I would prefer safe ways of speeding it up (so please dont give me options where I have a risk of destroying the system…). Then, I want to speed it up while it is working (so that it turns on apps super-fast, programs run very qiuckly, anything that can be made quicker I want it quicker).
I am very well aware of the fact that turning off “effects” speeds the computer, I done that already.

Primary Goal: Speeding up boot time.
Secondary Goal: Speeding up the system as much as possible (safely).

Cheers & thanks,
-Arpadius98

Well you can only do a s well as the hardware. 4o secs seems a bit long so maybe tell us a bit more info like the hardware and show use the boot chart. It is not uncommon for network connections to take a long time particularly is wifi

Removing unneeded services is another way to go

It’s mostly a hardware issue. I’m told that using an SSD instead of a hard drive works wonders, but I don’t have personal experience with that. (I also heard that there might be a problem with Samsung SSDs).

So that is what I want to do, I have tried bootchart but it doesn`t really work.

Okay, so you are concerned with booting.

For me, booting takes far too long. Much of the delay appears to be waiting for the network.

Back a zillion years ago, people were saying that “systemd” would speed up boot because it did things in parallel. But it seems to me that it is slowing down boot by insisting on serializing activities that don’t need to be serialized.

I can’t see any reason to delay startup waiting for network. I put up with it, but I suppose it’s possible to tweak that in “systemd” service files.

Because I have to wait about 40 seconds for it to start up, what I want to do is know how to prevent useless apps from starting up at boot time, and then other things I can do to make the computer quicker (it is already fast enough, but I would like it to be super-fast).

It’s probably not the useless apps that cause the delays. It’s the useful one, together with overly conservative dependency rules within “systemd”.

There’s a reason that I put up with it. Back before systemd, startup was faster. I could quickly login to KDE. But KDE was slow getting going. Now KDE startup is a lot faster, because it is not competing with system startup operations. So I make do with a swig of coffee to wile away the startup time.

On Sun 05 Apr 2015 01:16:01 PM CDT, nrickert wrote:

Arpadius98;2703189 Wrote:
> Recently I have been reading in a book that I can speed up Linux.
It’s mostly a hardware issue. I’m told that using an SSD instead of a
hard drive works wonders, but I don’t have personal experience with
that. (I also heard that there might be a problem with Samsung SSDs).

> So that is what I want to do, I have tried bootchart but it doesn`t

really work.
Okay, so you are concerned with booting.

For me, booting takes far too long. Much of the delay appears to be
waiting for the network.

Back a zillion years ago, people were saying that “systemd” would speed
up boot because it did things in parallel. But it seems to me that it
is slowing down boot by insisting on serializing activities that don’t
need to be serialized.

I can’t see any reason to delay startup waiting for network. I put up
with it, but I suppose it’s possible to tweak that in “systemd” service
files.

Because I have to wait about 40 seconds for it to start up, what I
want to do is know how to prevent useless apps from starting up at
boot time, and then other things I can do to make the computer
quicker (it is already fast enough, but I would like it to be
super-fast).
It’s probably not the useless apps that cause the delays. It’s the
useful one, together with overly conservative dependency rules within
“systemd”.

There’s a reason that I put up with it. Back before systemd, startup
was faster. I could quickly login to KDE. But KDE was slow getting
going. Now KDE startup is a lot faster, because it is not competing
with system startup operations. So I make do with a swig of coffee to
wile away the startup time.

Hi
Having an ssd will help, but you can run the following command after
boot to see what is causing the delay…


systemd-analyse critical-chain

One slow down of recent times was related to the journal (logging) on a
few users system.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.39-47-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

systemd-analyse
or
systemd-analyze?

does it depend on system settings?

it is systemd-analyze

as you have found out “bootchart” is not needed ( well as something you need to install )
the functionality is built in now

you WILL find that you really can not do to much
you can BUT there are consequences !

i could cut 15 seconds off by NOT having the network auto come up during boot
BUT!!!

i would NEED to manually start the network once i login as a user
BUT!!!
then my weather report WILL NOT be on the desktop

my network storage WILL NOT be mounted

things like this

but you should be able to use the SVG image to see some bottlenecks and fix them

Hello,

I had trouble using the systemd-analyse critical-chain command (thanks gogalthorp for saying that it is: analyze, since it worked the way you said it).

linux-1vnx:/home/arpad # systemd-analyze critical-chainThe time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.


graphical.target @7.645s
└─display-manager.service @6.801s +842ms
  └─systemd-user-sessions.service @6.751s +46ms
    └─remote-fs.target @6.751s
      └─remote-fs-pre.target @574ms

Results are above.

Cheers & Thanks,
-Arpadius98

Hello,

I’m loocking for that kind of information, so her to compare my stats:

suse13-1-ssd:/home/urs # systemd-analyze critical-chain
The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

graphical.target @7.201s
└─multi-user.target @7.201s
└─cron.service @7.201s
└─postfix.service @7.027s +172ms
└─time-sync.target @7.027s
└─ntp.service @6.993s +33ms
└─nss-lookup.target @6.993s
└─network.target @6.992s
└─network.service @2.168s +4.824s
└─SuSEfirewall2_init.service @2.083s +84ms
└─basic.target @2.076s
└─systemd-ask-password-plymouth.path @2.076s
└─-.mount @77ms
└─system.slice @118ms
└─-.slice @81ms

this is a Asus m5a99x_evo with a SSD and an AMD FX-6300 and a memory cloked at 2133mhz .
For information the boot time with a fast 2tb hdd is about 23s. with ssd is about 14s, in fact the boot time of the opensuse is less than 8s with the ssd (the rest of the boot time are consumed by the POST/Bios and other thinks).
Once loged you dont’see much of a difference between a SDD or a fast HDD unless you write some huge files (like i doo).

Now my question:
I’m very happy with it but its my third SSD (differrent brands) because i have some strange behaviour with it, after using more than 80gb of files writings on applications (mainly libreoffice spreedshets) it take about 5 to 10 second to reply (this is only on ssd not on a hdd, and the garbage collections, trims, partitions types and so on, do change nothing about it!)
is it possible that the linux swap partition is the problem ?
Thanks for your answers.

By the way, watt are the difference between the pc of arpadius98 and this one with the systemd-analyze ?
Greetings Ursh15

Something is missing here. You have 6 seconds between remote-fs-pre.target and remote-fs.target, but those two units do not do anything - they simply wait for other services.

But it still is far from 40 seconds. But as output is most probably incomplete, it is hard to guess.

Looks like arpadius98 has killed a lot of services
Here is mine with a 6 core AMD 8 Gig ram booting from a SSD


linux:~ # systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @14.023s
└─multi-user.target @14.023s
  └─smb.service @13.984s +38ms
    └─nmb.service @3.942s +10.040s
      └─network.target @3.936s
        └─NetworkManager.service @3.864s +71ms
          └─SuSEfirewall2_init.service @3.754s +107ms
            └─basic.target @3.702s
              └─timers.target @3.702s
                └─systemd-tmpfiles-clean.timer @3.702s
                  └─sysinit.target @3.701s
                    └─apparmor.service @3.459s +241ms
                      └─systemd-tmpfiles-setup.service @3.452s +5ms
                        └─local-fs.target @3.443s
                          └─vm.mount @635ms +40ms
                            └─systemd-fsck@dev-disk-by\x2duuid-3bd79acb\x2d9f73\x2d411b\x2dacae\x2dd5c1f8debf48.service @528ms +100ms
                              └─dev-disk-by\x2duuid-3bd79acb\x2d9f73\x2d411b\x2dacae\x2dd5c1f8debf48.device @527ms
l

Hello Again,

maybe whe should compare the real time of booting ?

suse13-1-ssd:/home/urs # systemd-analyze time
Startup finished in 5.331s (kernel) + 7.206s (userspace) = 12.537s

this is a Asus m5a99x_evo with a SSD and an AMD FX-6300 and a memory cloked at 2133mhz .

Hello,

Looks like arpadius98 has killed a lot of services

Well, if I have killed a lot of services why is my computer still taking about 40 seconds to start up?
I have a Yoga 2 (iCore 5, 500GB, 8GB RAM) laptop. What I want to do, is speed this booting time (other things work quickly, I have other computers which take a long time to boot, and I feel great when I have a very quick computer :).

gogalthrop, when I see your list and look back to my list, why is there such a big difference? I never touched anything on this computer (all I done so far is making new files, changing the appearance, and downloaded some programs *).

What I want to do is to stop all the useless processes, and I want the computer to concentrate on what I want to do (so that when I want to do something, it does it quick), though at the moment lets concentrate on the boot-time.

Cheers & Thanks,
-Arpadius98*

Hello,
Sorry a can’t find out why a can’t edit my messages .

I have somme strange things about this command, as i said a have an ssd and a hhd on the same system…
This is a Asus m5a99x_evo with a SSD and an AMD FX-6300 and a memory cloked at 2400mhz
So first the ssd
suse13-1-ssd:/home/urs # systemd-analyze critical-chain
The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

graphical.target @6.589s
└─multi-user.target @6.589s
└─cron.service @6.589s
└─postfix.service @6.414s +174ms
└─time-sync.target @6.413s
└─ntp.service @6.381s +31ms
└─nss-lookup.target @6.380s
└─network.target @6.380s
└─network.service @1.539s +4.841s
└─SuSEfirewall2_init.service @1.443s +95ms
└─basic.target @1.439s
└─systemd-ask-password-plymouth.path @1.439s
└─-.mount @76ms
└─system.slice @118ms
└─-.slice @81ms
suse13-1-ssd:/home/urs # systemd-analyze time
Startup finished in 5.326s (kernel) + 6.594s (userspace) = 11.920s

now the hdd
m5a99-Suse13-1-hdd:/home/urs # systemd-analyze critical-chain
The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

graphical.target @13.913s
└─multi-user.target @13.912s
└─cron.service @13.912s
└─postfix.service @13.676s +234ms
└─time-sync.target @13.675s
└─ntp.service @13.619s +55ms
└─nss-lookup.target @13.618s
└─network.target @13.616s
└─network.service @8.504s +5.111s
└─SuSEfirewall2_init.service @7.694s +808ms
└─basic.target @7.519s
└─paths.target @7.519s
└─cups.path @7.450s
└─sysinit.target @7.429s
└─apparmor.service @7.132s +296ms
└─systemd-tmpfiles-setup.service @7.099s +31ms
└─local-fs.target @7.098s
└─mnt-Donnees.mount @5.894s +1.203s
└─systemd-fsck@dev-disk-by\x2did-ata\x2dWDC_WD1002FAEX\x2d00Z3A0_WD\x2dWCATR2560792\x2dpart7.service @3.374s +2.492s
└─dev-disk-by\x2did-ata\x2dWDC_WD1002FAEX\x2d00Z3A0_WD\x2dWCATR2560792\x2dpart7.device @3.373s

m5a99-Suse13-1-hdd:/home/urs # systemd-analyze time
Startup finished in 3.487s (kernel) + 13.916s (userspace) = 17.403s

So there is not much difference on both boot’s but, with a watch hdd of 1tb is about 25s. with ssd its about 14s, in fact the boot time of the opensuse is less than 8s with the ssd !
Dont look at the fsck (it does only once a day) but this may bee an isue for some folks ! is this not the case for you arpadius98 ?!

Were are 5 to 9 seconds more on the hdd that i get on the watch ?

Greetings ursh15

On Mon 06 Apr 2015 09:36:01 AM CDT, Arpadius98 wrote:

Hello,

I had trouble using the systemd-analyse critical-chain command (thanks
gogalthorp for saying that it is: analyze, since it worked the way you
said it).

Code:

linux-1vnx:/home/arpad # systemd-analyze critical-chainThe time
after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

graphical.target @7.645s
└─display-manager.service @6.801s +842ms
└─systemd-user-sessions.service @6.751s +46ms
└─remote-fs.target @6.751s
└─remote-fs-pre.target @574ms


Results are above.

Cheers & Thanks,
-Arpadius98

Hi
So what is the output from;


systemd-analyze
systemd-analyze blame

Just the lines that are > 1 second in the blame output.

If your systems is doing some sort of checks, or waiting for the user
to hit enter at the grub menu, as well as plymouth can add to boot time.

Is the system dual or single boot?


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.39-47-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

systemd-analyze blame
will list them by TIME it takes

for me the network adds 15 seconds

15.272s wicked.service

you might want to read the help and man


su -
 
systemd-analyze --help 

------- and this --------------
man  systemd-analyze

for a nice image ( like bootchart gave you )


su -
systemd-analyze plot > /bootsvg.svg 



Those are services If you remove services they don’t showup any more

Well that is a two edged sword. removing service may speed boot but may slow down thing later on when those services must be started. What you think might not be need may actually be needed

If you have a slow hard drive things can be slow. Note that I boot off a SSD most notebooks have 5200 RPM drives which are relatively slow

KDE is a heavy weight GUI mabe try a lighter GUI. I assume you have autologin (IMO a bad idea) and you time to stable desktop not to login.*

On Mon, 06 Apr 2015 16:36:01 +0000, ursh15 wrote:

> Sorry a can’t find out why a can’t edit my messages .

It’s in the forum FAQ. There is a time limit, read the FAQ to find out
why. No, we’re not going to change it (that’s usually the next question,
so I’ll save you the trouble of asking it).

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Okay. Let us begin this way:

Give me the output of

systemd-analyze

(notice, no other parameters needed)

Please make certain to place all of the output between code tags. To do that, when you are posting your message, click on the “#” symbol that is in the 2nd row of icons in the message editor, just above your message window. Paste the output between the CODE tags that pop into your message when you do that.

Doing so keeps the output formatted properly, so therefore is easier to read and analyze.

As said, please place ALL of the output there, including the command itself.

Then run:

systemd-analyze blame | head

and post the output between code tags.

Then run, once again:

systemd-analyze critical-chain

Note that for best results with services, it is much better to mask services with systemd than it is do disable the services. We will cover that once we first find out what is going on with your system.

It would not hurt if you also list what you have uninstalled or disabled up to this point.*

Hello,

Here are the result of: systemd-analyze

Startup finished in 3.550s (kernel) + 2.528s (initrd) + 15.126s (userspace) = 21.205s

And here are the results of systemd-analyze blame


          8.308s dev-sda9.device
          5.982s systemd-udev-settle.service
          2.522s systemd-udevd.service
          2.310s SuSEfirewall2_init.service
          2.230s systemd-journald.service
          2.160s teamviewerd.service
          1.835s ModemManager.service
          1.833s boot-grub2-x86_64\x2defi.mount
          1.787s postfix.service
          1.617s srv.mount
          1.598s var-lib-pgsql.mount
          1.488s SuSEfirewall2.service
          1.443s opt.mount
          1.391s var-opt.mount
          1.389s \x2esnapshots.mount
          1.387s usr-local.mount
          1.338s var-crash.mount
          1.299s var-lib-mailman.mount
          1.281s boot-grub2-i386\x2dpc.mount
          1.203s var-lib-named.mount
          1.169s display-manager.service
          1.142s tmp.mount
          1.039s var-spool.mount
          1.036s var-log.mount
           938ms polkit.service
           891ms var-tmp.mount
           795ms avahi-daemon.service
           782ms sshd.service
           765ms lvm2-activation-net.service
           656ms nscd.service
           626ms wpa_supplicant.service
           620ms rc-local.service
           530ms systemd-journal-flush.service
           480ms home.mount
           431ms NetworkManager.service
           423ms systemd-tmpfiles-clean.service                                                                                                                                    
           386ms boot-efi.mount                                                                                                                                                    
           386ms systemd-fsck@dev-disk-by\x2duuid-12c47f61\x2dc15d\x2d4580\x2d8260\x2d0ca0901b9917.service                                                                         
           356ms lvm2-activation-early.service                                                                                                                                     
           353ms systemd-remount-fs.service                                                                                                                                        
           331ms systemd-logind.service                                                                                                                                            
           298ms dev-disk-by\x2duuid-2857d207\x2d87d7\x2d455f\x2d8867\x2d67b6f18f96f7.swap                                                                                         
           283ms kmod-static-nodes.service                                                                                                                                         
           267ms bluetooth.service                                                                                                                                                 
           267ms dev-hugepages.mount                                                                                                                                               
           265ms dev-mqueue.mount
           247ms lvm2-activation.service
           246ms systemd-tmpfiles-setup.service
           245ms systemd-rfkill@rfkill0.service
lines 1-49

Last but not least, here is the result of the command: systemd-analyze critical-chain

The time after the unit is active or started is printed after the “@” character.
The time the unit takes to start is printed after the “+” character.

graphical.target @15.121s
└─teamviewerd.service @12.960s +2.160s
  └─network.target @12.955s
    └─NetworkManager.service @12.523s +431ms
      └─SuSEfirewall2_init.service @10.211s +2.310s
        └─basic.target @10.028s
          └─paths.target @10.027s
            └─cups.path @10.027s
              └─sysinit.target @10.025s
                └─systemd-update-utmp.service @9.988s +35ms
                  └─auditd.service @9.928s +58ms
                    └─systemd-tmpfiles-setup.service @9.676s +246ms
                      └─systemd-journal-flush.service @9.144s +530ms
                        └─var-log.mount @8.094s +1.036s
                          └─dev-disk-by\x2duuid-00e54a7a\x2d5662\x2d4437\x2d98a4\x2d289925eebeb6.device @6.848s



I would note, that TeamViewer for me is important to run on this computer.
Also I do not use autologin, since it would be dangerous, others can mess about in my files…

Fraser Bell`s Requests:

Results for: systemd-analyze:

arpad@linux-1vnx:~> systemd-analyze blame | head
          8.308s dev-sda9.device
          5.982s systemd-udev-settle.service
          2.522s systemd-udevd.service
          2.310s SuSEfirewall2_init.service
          2.230s systemd-journald.service
          2.160s teamviewerd.service
          1.835s ModemManager.service
          1.833s boot-grub2-x86_64\x2defi.mount
          1.787s postfix.service
          1.617s srv.mount

Results for the next command:

arpad@linux-1vnx:~> systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.


graphical.target @15.121s
└─teamviewerd.service @12.960s +2.160s
  └─network.target @12.955s
    └─NetworkManager.service @12.523s +431ms
      └─SuSEfirewall2_init.service @10.211s +2.310s
        └─basic.target @10.028s
          └─paths.target @10.027s
            └─cups.path @10.027s
              └─sysinit.target @10.025s
                └─systemd-update-utmp.service @9.988s +35ms
                  └─auditd.service @9.928s +58ms
                    └─systemd-tmpfiles-setup.service @9.676s +246ms
                      └─systemd-journal-flush.service @9.144s +530ms
                        └─var-log.mount @8.094s +1.036s
                          └─dev-disk-by\x2duuid-00e54a7a\x2d5662\x2d4437\x2d98a4\x2d289925eebeb6.device @6.848s

I would note, that I have followed your instructions (so I done the commands you told me in order).

KDE is a heavy weight GUI mabe try a lighter GUI. I assume you have autologin (IMO a bad idea) and you time to stable desktop not to login

What do you mean by that? You mean that the system requires a stronger computer? When the computer runs it runs at a very acceptable speed (a speed that is expected), except I want to make the computer be able to boot faster, and later work as fast as possible (in a safe way of course. Since I read that if you have a “crappy” computer, you can make it faster, which means that probably you can make a quick computer even faster, I hope.). So I want the computer running at maximum speed (if it has risks or consequences, I would preffer not to do them then.). Sometimes, I have the computer running slowly (it turns programs on slowly, and itself runs slowly), but that is rare.

Main Point: I want to make this computer as fast as possible, safely.

Cheers & Thanks,
-Arpadius98