Linux Running Too Slow? Here’s How to Find the Cause

11 comments

  1. Info

    Thanks a lot… It is really helpful!

    Just a quick question, my linux server is showing 95% of CPU usage in gzip command and I am amazed as I am not using it. How can I stop only this process in linux through command…..Any Idea?

    1. Arnold Benedict

      “95% of CPU usage in gzip command”

      At a guess it is probably logrotate running gzip (the default compression program) on a very large log file.

      Two points to consider

      1) Do not let your logfiles grow so large — logrotate them more frequently if only weekly or monthly. If daily, then examine the log file and cure the problem that is causing lots of entries in the log file.

      2) Change the default compression from gzip to bzip2 or maybe even xz to compress your logfiles to a smaller size to save on disk space and do not keep more than your reasonably need.

      ps -efw | grep gzip

      will reveal the process and its parent id, then use ps -efw | grep parent_id to show what process was invoking gzip (probably logrotate launched fron cron.daily).

  2. dragonmouth

    “Check for Services Started at Boot-Time”
    You can run BootChart for Linux. It charts the entire boot process.

    1. Jacob Salomon

      I just installed bootchart on my Linux Mint PC. When I run it I get a nasty looking error about a missing or empty file:
      Warning: path ‘/var/log/bootchart.tgz’ does not exist, ignoring

      It then follows up with:
      Parse error: empty state: ‘/var/log/bootchart.tgz’ does not contain a valid bootchart

      Scratch 1 solution. I have a comment about iotop as well but I’ll enter that as a separate comment.

  3. Jacob Salomon

    I have already commented on bootchart in reply to Dragonmouth. Now for iotop:

    I installed iotop on my Linux Mint PC. When I try to to run it (with sudo of course) I get a very verbose traceback of .py modules but the main message at the bottom is:
    /data.py, line 196, in parse_proc_pid_status
    key, value = line.split(‘:t’, 1)
    ValueError: need more than one value to unpack

    Clues? Was this released with a nasty program bug?

  4. Tommy Reynolds

    Please, can we just forget about the free(1) command? It provides absolutely no useful information to diagnose performance issues. Newcomers to Linux are often alarmed when they see almost no free memory. You do not want *any* free memory because free memory is wasted memory. For details look at https://www.linuxatemyram.com/ for a glimpse of how Linux memory management actually works.

    Instead, use the vmstat(8) tool to monitor the paging file in-bound traffic (the SI column). Linux does implement paging but it just does not do paging (aka “swapping”) very well, so it is to be avoided. Out-bound paging traffic (the SO column) can be ignored: Linux will do anticipatory page evictions of stale memory content to make more room for the demands of the moment; SO is good, SI is bad.

  5. James

    If it is a very old computer running slow sometimes the only answer is a very lightweight OS like puppy, or a new computer. Yet older computers can be repurposed, for things like media machines or home servers.

  6. Dave

    You say to disable unnecessary services yet you don’t say which ones. What are some services that might run but don’t need to be running at startup and how to you configure them to run as needed instead?

Comments are closed.