Author Topic: Ubuntu getting slow [solved]  (Read 36001 times)

0 Members and 1 Guest are viewing this topic.

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Ubuntu getting slow [solved]
« on: May 20, 2017, 10:52:08 pm »
My main Ubuntu machine (Ubuntu 16.04, core2 duo + 4GB Ram) is taking almost 2 minutes from pushing the button to a functioning desktop.

I'm sure it used to be a lot quicker and I haven't made any changes lately.

Does Ubuntu gradually slow down like Windows?
« Last Edit: September 19, 2017, 03:50:34 am by mikep »

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #1 on: May 21, 2017, 10:08:20 pm »
No it shouldn't...

What's the output from:
Code: [Select]
systemd-analyze time
and
Code: [Select]
systemd-analyze critical-chain
and
Code: [Select]
systemd-analyze blame
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #2 on: May 21, 2017, 10:30:42 pm »
Hello Mark,

Here goes..

mike@mike-ubuntu:~$ systemd-analyze time
Startup finished in 4.754s (kernel) + 32.997s (userspace) = 37.751s
mike@mike-ubuntu:~$ 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 @32.973s
??multi-user.target @32.973s
  ??grub-common.service @22.394s +10.579s
    ??basic.target @17.173s
      ??sockets.target @17.173s
        ??snapd.socket @17.154s +12ms
          ??sysinit.target @17.057s
            ??apparmor.service @7.838s +9.178s
              ??local-fs.target @7.675s
                ??run-cgmanager-fs.mount @22.935s
                  ??local-fs-pre.target @7.675s
                    ??systemd-remount-fs.service @7.513s +119ms
                      ??systemd-journald.socket @3.020s
                        ??-.mount @2.691s
                          ??system.slice @3.020s
                            ??-.slice @2.691s
mike@mike-ubuntu:~$ systemd-analyze blame
         15.151s apport.service
         14.898s ondemand.service
         14.830s networking.service
         14.757s speech-dispatcher.service
         13.119s dev-sdc5.device
         10.579s grub-common.service
         10.067s irqbalance.service
          9.178s apparmor.service
          6.925s ModemManager.service
          6.836s lightdm.service
          5.190s vboxdrv.service
          5.189s iio-sensor-proxy.service
          5.159s avahi-daemon.service
          5.019s thermald.service
          4.559s NetworkManager.service
          3.422s accounts-daemon.service
          2.655s gpu-manager.service
          2.563s systemd-udevd.service
          2.416s console-setup.service
          2.018s colord.service
          1.746s rsyslog.service
          1.742s plymouth-start.service
          1.593s keyboard-setup.service


I hope that means a lot more to you than it does to me!

By the way, the Code: [Select] function isn't working. At least not for me. I get 'Unable to locate url javascript:void(0) '

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #3 on: May 21, 2017, 11:14:20 pm »
Well that's suggesting your boot finished in 37.751 seconds, so how are you defining 2 minutes ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #4 on: May 22, 2017, 02:16:16 am »
By the clock on my desk.

I just tested it again. From clicking 'restart' in Ubuntu, it was 90 seconds until the desktop appeared, with lots of disk accessing still going on. I clicked immediately on the Firefox icon and it took another 40 seconds for FF to load and be useable.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #5 on: May 22, 2017, 02:35:28 am »
what's the output from:
Code: [Select]
df -h
and
Code: [Select]
free -m
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #6 on: May 22, 2017, 03:44:19 am »
mike@mike-ubuntu:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           396M  6.4M  389M   2% /run
/dev/sdc5       130G   46G   78G  38% /
tmpfs           2.0G  668K  2.0G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
cgmfs           100K     0  100K   0% /run/cgmanager/fs
tmpfs           396M   64K  395M   1% /run/user/1000
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950        1266        1307          38        1377        2355
Swap:          4092           0        4092
mike@mike-ubuntu:~$

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #7 on: June 08, 2017, 12:24:44 am »
This is getting silly now. I've just spent over five minutes listening to constant disk accessing and waiting for this PC to become responsive again. I couldn't shut anything down, open a terminal, or anything else.

I was on the point of a hard reboot when things finally started responding. The terminal showed this;

mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950        1374        1980          50         594        2265
Swap:          4092         331        3761
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950        1375        1979          50         594        2264
Swap:          4092         331        3761
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950        1303        2002          49         644        2337
Swap:          4092         329        3763
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950        1302        2003          50         644        2338
Swap:          4092         329        3763
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950         492        2817          18         640        3185
Swap:          4092         329        3763
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950         492        2817          18         640        3185
Swap:          4092         329        3763
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950         494        2815          18         640        3183
Swap:          4092         329        3763
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950         494        2815          18         640        3183
Swap:          4092         329        3763
mike@mike-ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3950         494        2815          18         640        3183
Swap:          4092         329        3763
mike@mike-ubuntu:~$


Swap used is still at 323 with only Firefox running. No streaming or downloading going on...


Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #8 on: June 08, 2017, 05:52:19 pm »
So does it only go slow when using Firefox ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #9 on: June 09, 2017, 02:42:47 am »
No, I don't think so. I also use Chrome and/or Chromium.

Slowness seems to be the order of the day. Swap is being used, albeit minimally. Do you think this may be a physical memory problem?

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #10 on: June 09, 2017, 02:25:11 pm »
Could be but I doubt it, if there's disk thrashing I'd have thought it more likely an HDD problem.

If you install iotop
Code: [Select]
sudo apt-get install iotop
then run it
Code: [Select]
sudo iotop
is there anything at the top that's using an inordinate percentage of "IO>" ?

Also what's the output from:
Code: [Select]
sudo smartctl -A /dev/sda
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #11 on: June 09, 2017, 09:23:11 pm »
IO is in the order of 0 - 4%, with occasionally 7 - 9%.

sudo smartctl -A /dev/sda gives..

mike@mike-ubuntu:~$ sudo smartctl -A /dev/sda
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-79-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   051    Pre-fail  Always       -       2
  2 Throughput_Performance  0x0026   252   252   000    Old_age   Always       -       0
  3 Spin_Up_Time            0x0023   073   071   025    Pre-fail  Always       -       8297
  4 Start_Stop_Count        0x0032   097   097   000    Old_age   Always       -       3642
  5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       17282
 10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   252   252   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   097   097   000    Old_age   Always       -       3727
191 G-Sense_Error_Rate      0x0022   100   100   000    Old_age   Always       -       428
192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0002   057   051   000    Old_age   Always       -       43 (Min/Max 14/49)
195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   252   252   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   252   252   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0036   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       28
223 Load_Retry_Count        0x0032   252   252   000    Old_age   Always       -       0
225 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       3727




However, Ubuntu is on sdc on this machine, so here's the output fom that..

mike@mike-ubuntu:~$ sudo smartctl -A /dev/sdc
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-79-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0003   191   085   021    Pre-fail  Always       -       5408
  4 Start_Stop_Count        0x0032   096   096   000    Old_age   Always       -       4705
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   200   200   051    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   073   073   000    Old_age   Always       -       19949
 10 Spin_Retry_Count        0x0013   100   100   051    Pre-fail  Always       -       0
 11 Calibration_Retry_Count 0x0012   100   100   051    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   096   096   000    Old_age   Always       -       4700
194 Temperature_Celsius     0x0022   113   101   000    Old_age   Always       -       37
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       80
200 Multi_Zone_Error_Rate   0x0009   200   200   051    Pre-fail  Offline      -       0

mike@mike-ubuntu:~$



Thanks Mark

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #12 on: June 12, 2017, 12:39:36 pm »
In 2 terminals, leave
Code: [Select]
top
and
Code: [Select]
iotop
running.

The when the PC slows down, try to see if there's some process that's either hammering the CPU (top) or hard drive (iotop).

My point is, there's no point in taking a single reading from those whilst the PC isn't running slowly .. so do something that causes the system to slow down, and look at those terminals whilst it's doing it.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline mikep

  • Sr. Member
  • ****
  • Posts: 277
  • Karma: 1
  • Gender: Male
  • Me again!
    • View Profile
    • Awards
Re: Ubuntu getting slow
« Reply #13 on: June 23, 2017, 11:35:39 pm »
Hello Mark,

I've been trying this, but there's no obvious culprit. FF and Chrome (which I'm reluctantly trying because FF keeps giving me the "Well, this is embarrassing" screen) tend to use a lot of CPU, especially when streaming videos, but I haven't seen the whole machine freeze up again.

Obviously I can't open the two terminals until the machine is running, so they don't offer any clues as to why the boot process takes so long (consistently around 100 - 120 seconds to a usable desktop). FF also starts up amazingly slowly.

I'm beginning to think in terms of a full reinstall of Ubuntu 16.04...

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Ubuntu getting slow
« Reply #14 on: June 25, 2017, 12:19:04 am »
Might be the simplest solution mike because I'm all outa ideas.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal