SlideShare a Scribd company logo
1 of 46
Download to read offline
Help! My Computer is Sluggish




          Kevin B. O'Brien
    Washtenaw Linux Users Group
Just buy a new CPU!

   This is what most people will try
   It is actually a less likely way to solve your
    problem
   You need to diagnose the actual cause before
    you know what to do
Some Suggestions

   This presentation is not exhaustive
   Linux has many, many tools for analyzing
    computer problems
   So we will cover just a few of the things you can
    try
   Read the man pages for the tools we cover.
    There is a lot of added information there that
    can help you do even more with the tools.
Hardware vs. Software

   Hardware = the part of a computer you can hit
   Software = the part you can't hit
   A computer is always a combination of both
    hardware and software
   You should look at both if you are having
    problems
Software

   Software can be buggy, badly written, or
    corrupted in some way
   If it is buggy or badly written, you can look for
    alternatives
   If it is corrupted you can do a reinstallation
Top 1

   This is a very useful tool to see what your
    software is doing
   Just open a terminal and type “top”
Top 2
Top 3

   This command lists all of the running processes
    on your computer
   It also shows how much CPU and memory
    each one is using
   You can sort the display by pressing an upper-
    case letter “O”
   For instance, the sequence upper-case “O”
    -->n-->”enter” will sort by Memory used
Top 4
Top 5

   You want to look for processes that use a lot of
    CPU or Memory as potential problems
   Large numbers are not always a problem,
    though. I have a Virtual Box VM open running a
    Windows VM. That is an expected load that I
    took into account.
   But if Firefox is using 25% of your memory or
    CPU, that is probably a problem
The kill test

   One way you can test if a particular app is the
    problem is to close it
   Sometimes the app is not responding, so you
    need to kill it
   With top open in the terminal, type “k”
   You will get an added prompt above the list of
    processes asking which one you want to kill
   Just enter the PID (process ID) of the process
KDE

   If you use KDE you can bring up a system
    monitor from krunner
   Press Alt+F2 to bring up krunner



   Click the second icon from the left, which looks
    like a small graph
krunner
Gnome

   Go to System → Administration → System
    Monitor
Gnome System Monitor
Note on Multi-Core Processors

   Each process runs on a single core
   Top, and the Gnome System Monitor report the
    percentage of that single core that each
    process uses
   KDE's System Activity reports the percentage
    of all processor cycles available on all cores, so
    it reports a smaller number
   Pay more attention to top, since maxing out a
    single core is still a problem even if you have
    another core available
Interpreting the results

   If one process/application stands out, and
    closing/killing it makes the problem go away,
    you may have a software problem
   You can then try to reinstall or find alternative
    software
   Solving a software problem may be a little work,
    but it costs nothing. You should rule out
    software problems before looking at a hardware
    problem, therefore.
Hardware problems

   There are potentially four problem areas:
       CPU
       RAM
       Disk I/O
       Video Card
   Knowing the source of the problem will let you
    resolve it without wasting money on unneeded
    hardware upgrades
Where people go wrong
   Many people will assume a sluggish computer
    needs a CPU upgrade
   More knowledgeable folks know that more RAM
    is a lot more likely to work than a new CPU
   In a PC World study (October 2010) RAM also
    beat out a faster hard drive for improving
    performance.
Uptime
Load 1

   Look at the load figures
   They show the load over the past 1, 5, and 15
    minutes
   Load is the average number of processes that
    have to wait for CPU time
   You adjust for the number of cores. A load of 2
    on a two-core system is equivalent to a load of
    1 on a single-core system.
Load 2

   Load is just one indication
   You can get even more from the top command
   Notice that the first line of the top results is the
    same as you get from uptime
Top, again
CPU Load 1

   Look at the third line
   Us is the percentage of CPU time taken up by
    user processes. Note that user is not just a
    person, it could be Apache, MySQL, etc. If this
    is very high, it may be an indication of a high
    CPU load.
   Sy is the percentage used by the kernel and
    other system processes
CPU Load 2

   Id is the idle time. The higher the better here. If
    this is reasonably high you can be pretty sure
    you don't have a CPU problem.
   Wa is the I/O wait time. This indicates the
    percentage of time that the CPU was waiting for
    I/O, which is usually your disk. A high number
    here indicates a disk I/O problem, and might be
    solved by getting a faster drive

    For the others, try man top for an explanation
CPU Load 3


    If you see a high number for us or sy, look at
    the processes involved, like we did for software
   You might see a high number related to a
    particular application. That application may be
    something you can fix or replace. But if it is
    proper, like a high figure for MySQL on a
    database or web server, you may need a better
    CPU.
   If it is a large number of separate processes
    with no one being large, that is also an
    indication that a new CPU is required
RAM

   This is in fact the most common problem area,
    and more RAM will often clear up any problem
    you have
   RAM is the workspace for the computer. All
    code has to be copied into RAM before the
    CPU can work with it.
   When RAM runs out, code that may be less
    frequently used gets copied to “swap”. This is
    an area of reserved space on a disk.
Swap and RAM Performance

   Because disk I/O is much slower than RAM,
    code that is moved to swap is slower to access
   If RAM is inadequate, code gets moved in and
    out of the swap area constantly, causing “disk
    thrashing”. This refers to constant hard drive
    activity, which can often be heard or seen as a
    flashing LED.
RAM Utilization

   Do not worry if your RAM appears to be
    completely utilized
   This is not like a high percentage of CPU
    utilization
   RAM is supposed to be used, that is why it is
    there
   For instance, shared libraries are frequently
    kept in RAM, which can speed up the launch of
    other programs that use those libraries
RAM as Cache 1

   To understand this, think of the RAM as a kind
    of cache
   Files in cache are always faster to access than
    files on the hard drive
   So the kernel will keep anything you have used
    in RAM in case it is needed again
   Any system that is used for a few hours will
    almost certainly see all of the RAM in use
    therefore
RAM as Cache 2

   Because a lot of your RAM is being used as a
    type of cache, that part of the RAM will be
    released as needed
   So if you start a new process and need more
    RAM for it, some of the cached code is cleared
    and the RAM is used for the new process
RAM numbers in top
Interpreting RAM numbers


    Note that line 4 is Mem
   This shows that I have 16 GB of RAM
   And almost all of it is used. Only 113MB is free
   Is this a problem?

    No, look at the next line for Swap
Swap in top


    Look at line 5, Swap
   There you see I have 6GB of swap space, but
    only 1.7MB is being used. Almost all of my
    swap space is empty.
   Look at the cache number. This indicates how
    much RAM is being used as a cache.
   To see what is available here, look at cache
    and free swap. In this case, there is 8GB of
    cache, and 6GB of swap. No RAM problems
    here!
Check RAM first

   You want to check Swap issues before
    checking other I/O issues because a RAM
    problem can look like a disk I/O problem. This
    is because the Swap is relying on disk I/O.
   If you do have a RAM issue, look at the
    processes to see which one(s) are responsible
   Remember you can sort by memory used by
    the sequence upper-case “O”
    -->n-->”enter”
High RAM usage

   Look for a process that uses an abnormally
    high amount of RAM
   This could be an indication of a memory leak
   This is when an application does not release
    memory when it is done, so that it gradually
    uses up most of the available RAM
   If you find this, look for an update that fixes it,
    or look for an alternative
   And if you find this, file a bug!
Disk I/O


    The tool you want here is called iostat
   This tool is not automatically installed, so you
    may need to install it
   You will probably find it in a package called
    sysstat
   Install this using your package manager
iostat
Iostat, the numbers

   On the first line, you can see that I have a 2-
    core CPU, I am using a 64-bit version of Linux,
    and what kernel I am using

    Then we get the same CPU numbers as the top
    command gave us
   The bottom section will give you the raw
    numbers for disk I/O
The I/O numbers
   Tps = transactions per second
   Blk_read/s = blocks read per second
   Blk_wrtn/s = blocks written per second
   Blk_read = total blocks read
   Blk-wrtn = total blocks written
Interpretation

   Which drive is getting the activity? Does that
    make sense?
   In this case sda is getting most of the action
   This is where my root partition is located, so all
    of my kernel and system activity should be here
   Sdb has my home partition. That gets less
    activity since most of the time it is sitting idle.
Read vs. write

   This can be a clue as well
   Certain applications or processes can be
    expected to require more reading or more
    writing
   Generally you should expect to have more
    reads than writes
   If you have your /var in its own partition, you
    should see higher write numbers there than on
    other partitions because of the logs being
    written
iotop
Interpreting iotop

   Here, instead of processes, you are looking at
    threads
   This could help uncover a thread that is
    generating a lot of I/O activity
   In this example, KDE's plasma desktop was on
    top, and was writing to disk at 30 K/s
   Does any thread consistently show up in the
    top? Does this make sense?
Signs of video issues

   The mouse is lagging
   Try dragging a window across the screen, and
    it does not move smoothly
       Tearing
       Slow or constant redraws
   These can be caused by CPU issues as well,
    so you want to eliminate that first
   Misbehaving apps can cause this (e.g. Flash
    plugins)
Summary

   Before you spend money, do a systematic
    troubleshoot
   Test in the right order
       Check software problems before hardware
        problems
       Always do video last since video artifacts can be
        caused by CPU load
       Look for results that point somewhere else, e.g. a
        memory leak is really a software problem, not a
        RAM problem

More Related Content

What's hot

introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5swee meng ng
 
Batch File Programming
Batch File ProgrammingBatch File Programming
Batch File ProgrammingFrz Khan
 
System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Processlucita cabral
 
Batch programming and Viruses
Batch programming and VirusesBatch programming and Viruses
Batch programming and VirusesAkshay Saini
 
Yum package manager
Yum package managerYum package manager
Yum package managerLinuxConcept
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionRed Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionMazenetsolution
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commandsMohammad Rafiee
 
BOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTBOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTShahzeb Pirzada
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 

What's hot (17)

Batch FIles
Batch FIlesBatch FIles
Batch FIles
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5
 
Batch File Programming
Batch File ProgrammingBatch File Programming
Batch File Programming
 
System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Process
 
Batch programming and Viruses
Batch programming and VirusesBatch programming and Viruses
Batch programming and Viruses
 
Yum package manager
Yum package managerYum package manager
Yum package manager
 
Linux tmpfs
Linux tmpfsLinux tmpfs
Linux tmpfs
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionRed Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
 
Raspberry Pi 101
Raspberry Pi 101Raspberry Pi 101
Raspberry Pi 101
 
Inner Symfony’s Daemons
 Inner Symfony’s Daemons Inner Symfony’s Daemons
Inner Symfony’s Daemons
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
 
linux
linuxlinux
linux
 
2.Accessing the Pi
2.Accessing the Pi2.Accessing the Pi
2.Accessing the Pi
 
Lvm advanced topics
Lvm advanced topicsLvm advanced topics
Lvm advanced topics
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commands
 
BOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTBOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPT
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 

Viewers also liked

Viewers also liked (7)

I pad care and maintenance keynote
I pad care and maintenance keynoteI pad care and maintenance keynote
I pad care and maintenance keynote
 
Mypub
MypubMypub
Mypub
 
Powerpoint
PowerpointPowerpoint
Powerpoint
 
попов в.в. биография
попов в.в. биографияпопов в.в. биография
попов в.в. биография
 
HCS PDL: iPad Care & Maintenance
HCS PDL: iPad Care & MaintenanceHCS PDL: iPad Care & Maintenance
HCS PDL: iPad Care & Maintenance
 
HCS PDL Parent Presentation
HCS PDL Parent PresentationHCS PDL Parent Presentation
HCS PDL Parent Presentation
 
Dhcp presentation 01
Dhcp presentation 01Dhcp presentation 01
Dhcp presentation 01
 

Similar to Help, my computer is sluggish

Linux optimization strategy plan by shiv
Linux optimization strategy plan by shivLinux optimization strategy plan by shiv
Linux optimization strategy plan by shivthedatabasearchitect
 
20 Windows Tools Every SysAdmin Should Know
20 Windows Tools Every SysAdmin Should Know20 Windows Tools Every SysAdmin Should Know
20 Windows Tools Every SysAdmin Should KnowPower Admin LLC
 
Types of computer system error
Types of computer system errorTypes of computer system error
Types of computer system errorRachel Espino
 
Types of Computer System Errors.pptx
Types of Computer System Errors.pptxTypes of Computer System Errors.pptx
Types of Computer System Errors.pptxArjunePantallano1
 
Lamp Stack Optimization
Lamp Stack OptimizationLamp Stack Optimization
Lamp Stack OptimizationDave Ross
 
Understanding And Managing Memory
Understanding And Managing MemoryUnderstanding And Managing Memory
Understanding And Managing Memoryisma ishak
 
Testing pc’s performance
Testing pc’s performanceTesting pc’s performance
Testing pc’s performanceiteclearners
 
1 Module - Operating Systems Configuration and Use by Mark John Lado
1 Module - Operating Systems Configuration and Use by Mark John Lado1 Module - Operating Systems Configuration and Use by Mark John Lado
1 Module - Operating Systems Configuration and Use by Mark John LadoMark John Lado, MIT
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work FasterGaurav bhatnagar
 
10 reasons why p cs crash u must know
10 reasons why p cs crash u must know10 reasons why p cs crash u must know
10 reasons why p cs crash u must knowVishal Gurujuwada
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1Maria Joslin
 
Lo1.3 diagnosing computer systems
Lo1.3 diagnosing computer systemsLo1.3 diagnosing computer systems
Lo1.3 diagnosing computer systemsFrya Lora
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 

Similar to Help, my computer is sluggish (20)

Pc dianosing
Pc dianosingPc dianosing
Pc dianosing
 
Linux optimization strategy plan by shiv
Linux optimization strategy plan by shivLinux optimization strategy plan by shiv
Linux optimization strategy plan by shiv
 
20 Windows Tools Every SysAdmin Should Know
20 Windows Tools Every SysAdmin Should Know20 Windows Tools Every SysAdmin Should Know
20 Windows Tools Every SysAdmin Should Know
 
Types of computer system error
Types of computer system errorTypes of computer system error
Types of computer system error
 
Types of Computer System Errors.pptx
Types of Computer System Errors.pptxTypes of Computer System Errors.pptx
Types of Computer System Errors.pptx
 
Tuning Java Servers
Tuning Java Servers Tuning Java Servers
Tuning Java Servers
 
Lamp Stack Optimization
Lamp Stack OptimizationLamp Stack Optimization
Lamp Stack Optimization
 
Understanding And Managing Memory
Understanding And Managing MemoryUnderstanding And Managing Memory
Understanding And Managing Memory
 
Hardware
HardwareHardware
Hardware
 
Computer is slow
Computer is slowComputer is slow
Computer is slow
 
Testing pc’s performance
Testing pc’s performanceTesting pc’s performance
Testing pc’s performance
 
1 Module - Operating Systems Configuration and Use by Mark John Lado
1 Module - Operating Systems Configuration and Use by Mark John Lado1 Module - Operating Systems Configuration and Use by Mark John Lado
1 Module - Operating Systems Configuration and Use by Mark John Lado
 
DHFGHG
DHFGHGDHFGHG
DHFGHG
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work Faster
 
Class 1
Class   1Class   1
Class 1
 
10 reasons why p cs crash u must know
10 reasons why p cs crash u must know10 reasons why p cs crash u must know
10 reasons why p cs crash u must know
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Lo1.3 diagnosing computer systems
Lo1.3 diagnosing computer systemsLo1.3 diagnosing computer systems
Lo1.3 diagnosing computer systems
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 

More from Kevin OBrien

Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeKevin OBrien
 
Password best practices and the last pass hack
Password best practices and the last pass hackPassword best practices and the last pass hack
Password best practices and the last pass hackKevin OBrien
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery CommandsKevin OBrien
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxKevin OBrien
 
Installing Software, Part 3: Command Line
Installing Software, Part 3: Command LineInstalling Software, Part 3: Command Line
Installing Software, Part 3: Command LineKevin OBrien
 
Installing Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesInstalling Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesKevin OBrien
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsKevin OBrien
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig CommandKevin OBrien
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two CommandsKevin OBrien
 
The Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashThe Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashKevin OBrien
 
The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?Kevin OBrien
 
The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?Kevin OBrien
 

More from Kevin OBrien (20)

American icon pmi
American icon   pmiAmerican icon   pmi
American icon pmi
 
Tls 1.3
Tls 1.3Tls 1.3
Tls 1.3
 
Forward Secrecy
Forward SecrecyForward Secrecy
Forward Secrecy
 
Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key Exchange
 
Password best practices and the last pass hack
Password best practices and the last pass hackPassword best practices and the last pass hack
Password best practices and the last pass hack
 
SSL certificates
SSL certificatesSSL certificates
SSL certificates
 
Encryption basics
Encryption basicsEncryption basics
Encryption basics
 
Passwords
PasswordsPasswords
Passwords
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery Commands
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
The ps Command
The ps CommandThe ps Command
The ps Command
 
Installing Software, Part 3: Command Line
Installing Software, Part 3: Command LineInstalling Software, Part 3: Command Line
Installing Software, Part 3: Command Line
 
Installing Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesInstalling Software, Part 1 - Repositories
Installing Software, Part 1 - Repositories
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System Considerations
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig Command
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two Commands
 
The Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashThe Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to Bash
 
The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?
 
The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Help, my computer is sluggish

  • 1. Help! My Computer is Sluggish Kevin B. O'Brien Washtenaw Linux Users Group
  • 2. Just buy a new CPU!  This is what most people will try  It is actually a less likely way to solve your problem  You need to diagnose the actual cause before you know what to do
  • 3. Some Suggestions  This presentation is not exhaustive  Linux has many, many tools for analyzing computer problems  So we will cover just a few of the things you can try  Read the man pages for the tools we cover. There is a lot of added information there that can help you do even more with the tools.
  • 4. Hardware vs. Software  Hardware = the part of a computer you can hit  Software = the part you can't hit  A computer is always a combination of both hardware and software  You should look at both if you are having problems
  • 5. Software  Software can be buggy, badly written, or corrupted in some way  If it is buggy or badly written, you can look for alternatives  If it is corrupted you can do a reinstallation
  • 6. Top 1  This is a very useful tool to see what your software is doing  Just open a terminal and type “top”
  • 8. Top 3  This command lists all of the running processes on your computer  It also shows how much CPU and memory each one is using  You can sort the display by pressing an upper- case letter “O”  For instance, the sequence upper-case “O” -->n-->”enter” will sort by Memory used
  • 10. Top 5  You want to look for processes that use a lot of CPU or Memory as potential problems  Large numbers are not always a problem, though. I have a Virtual Box VM open running a Windows VM. That is an expected load that I took into account.  But if Firefox is using 25% of your memory or CPU, that is probably a problem
  • 11. The kill test  One way you can test if a particular app is the problem is to close it  Sometimes the app is not responding, so you need to kill it  With top open in the terminal, type “k”  You will get an added prompt above the list of processes asking which one you want to kill  Just enter the PID (process ID) of the process
  • 12. KDE  If you use KDE you can bring up a system monitor from krunner  Press Alt+F2 to bring up krunner  Click the second icon from the left, which looks like a small graph
  • 14. Gnome  Go to System → Administration → System Monitor
  • 16. Note on Multi-Core Processors  Each process runs on a single core  Top, and the Gnome System Monitor report the percentage of that single core that each process uses  KDE's System Activity reports the percentage of all processor cycles available on all cores, so it reports a smaller number  Pay more attention to top, since maxing out a single core is still a problem even if you have another core available
  • 17. Interpreting the results  If one process/application stands out, and closing/killing it makes the problem go away, you may have a software problem  You can then try to reinstall or find alternative software  Solving a software problem may be a little work, but it costs nothing. You should rule out software problems before looking at a hardware problem, therefore.
  • 18. Hardware problems  There are potentially four problem areas:  CPU  RAM  Disk I/O  Video Card  Knowing the source of the problem will let you resolve it without wasting money on unneeded hardware upgrades
  • 19. Where people go wrong  Many people will assume a sluggish computer needs a CPU upgrade  More knowledgeable folks know that more RAM is a lot more likely to work than a new CPU  In a PC World study (October 2010) RAM also beat out a faster hard drive for improving performance.
  • 21. Load 1  Look at the load figures  They show the load over the past 1, 5, and 15 minutes  Load is the average number of processes that have to wait for CPU time  You adjust for the number of cores. A load of 2 on a two-core system is equivalent to a load of 1 on a single-core system.
  • 22. Load 2  Load is just one indication  You can get even more from the top command  Notice that the first line of the top results is the same as you get from uptime
  • 24. CPU Load 1  Look at the third line  Us is the percentage of CPU time taken up by user processes. Note that user is not just a person, it could be Apache, MySQL, etc. If this is very high, it may be an indication of a high CPU load.  Sy is the percentage used by the kernel and other system processes
  • 25. CPU Load 2  Id is the idle time. The higher the better here. If this is reasonably high you can be pretty sure you don't have a CPU problem.  Wa is the I/O wait time. This indicates the percentage of time that the CPU was waiting for I/O, which is usually your disk. A high number here indicates a disk I/O problem, and might be solved by getting a faster drive  For the others, try man top for an explanation
  • 26. CPU Load 3  If you see a high number for us or sy, look at the processes involved, like we did for software  You might see a high number related to a particular application. That application may be something you can fix or replace. But if it is proper, like a high figure for MySQL on a database or web server, you may need a better CPU.  If it is a large number of separate processes with no one being large, that is also an indication that a new CPU is required
  • 27. RAM  This is in fact the most common problem area, and more RAM will often clear up any problem you have  RAM is the workspace for the computer. All code has to be copied into RAM before the CPU can work with it.  When RAM runs out, code that may be less frequently used gets copied to “swap”. This is an area of reserved space on a disk.
  • 28. Swap and RAM Performance  Because disk I/O is much slower than RAM, code that is moved to swap is slower to access  If RAM is inadequate, code gets moved in and out of the swap area constantly, causing “disk thrashing”. This refers to constant hard drive activity, which can often be heard or seen as a flashing LED.
  • 29. RAM Utilization  Do not worry if your RAM appears to be completely utilized  This is not like a high percentage of CPU utilization  RAM is supposed to be used, that is why it is there  For instance, shared libraries are frequently kept in RAM, which can speed up the launch of other programs that use those libraries
  • 30. RAM as Cache 1  To understand this, think of the RAM as a kind of cache  Files in cache are always faster to access than files on the hard drive  So the kernel will keep anything you have used in RAM in case it is needed again  Any system that is used for a few hours will almost certainly see all of the RAM in use therefore
  • 31. RAM as Cache 2  Because a lot of your RAM is being used as a type of cache, that part of the RAM will be released as needed  So if you start a new process and need more RAM for it, some of the cached code is cleared and the RAM is used for the new process
  • 33. Interpreting RAM numbers  Note that line 4 is Mem  This shows that I have 16 GB of RAM  And almost all of it is used. Only 113MB is free  Is this a problem?  No, look at the next line for Swap
  • 34. Swap in top  Look at line 5, Swap  There you see I have 6GB of swap space, but only 1.7MB is being used. Almost all of my swap space is empty.  Look at the cache number. This indicates how much RAM is being used as a cache.  To see what is available here, look at cache and free swap. In this case, there is 8GB of cache, and 6GB of swap. No RAM problems here!
  • 35. Check RAM first  You want to check Swap issues before checking other I/O issues because a RAM problem can look like a disk I/O problem. This is because the Swap is relying on disk I/O.  If you do have a RAM issue, look at the processes to see which one(s) are responsible  Remember you can sort by memory used by the sequence upper-case “O” -->n-->”enter”
  • 36. High RAM usage  Look for a process that uses an abnormally high amount of RAM  This could be an indication of a memory leak  This is when an application does not release memory when it is done, so that it gradually uses up most of the available RAM  If you find this, look for an update that fixes it, or look for an alternative  And if you find this, file a bug!
  • 37. Disk I/O  The tool you want here is called iostat  This tool is not automatically installed, so you may need to install it  You will probably find it in a package called sysstat  Install this using your package manager
  • 39. Iostat, the numbers  On the first line, you can see that I have a 2- core CPU, I am using a 64-bit version of Linux, and what kernel I am using  Then we get the same CPU numbers as the top command gave us  The bottom section will give you the raw numbers for disk I/O
  • 40. The I/O numbers  Tps = transactions per second  Blk_read/s = blocks read per second  Blk_wrtn/s = blocks written per second  Blk_read = total blocks read  Blk-wrtn = total blocks written
  • 41. Interpretation  Which drive is getting the activity? Does that make sense?  In this case sda is getting most of the action  This is where my root partition is located, so all of my kernel and system activity should be here  Sdb has my home partition. That gets less activity since most of the time it is sitting idle.
  • 42. Read vs. write  This can be a clue as well  Certain applications or processes can be expected to require more reading or more writing  Generally you should expect to have more reads than writes  If you have your /var in its own partition, you should see higher write numbers there than on other partitions because of the logs being written
  • 43. iotop
  • 44. Interpreting iotop  Here, instead of processes, you are looking at threads  This could help uncover a thread that is generating a lot of I/O activity  In this example, KDE's plasma desktop was on top, and was writing to disk at 30 K/s  Does any thread consistently show up in the top? Does this make sense?
  • 45. Signs of video issues  The mouse is lagging  Try dragging a window across the screen, and it does not move smoothly  Tearing  Slow or constant redraws  These can be caused by CPU issues as well, so you want to eliminate that first  Misbehaving apps can cause this (e.g. Flash plugins)
  • 46. Summary  Before you spend money, do a systematic troubleshoot  Test in the right order  Check software problems before hardware problems  Always do video last since video artifacts can be caused by CPU load  Look for results that point somewhere else, e.g. a memory leak is really a software problem, not a RAM problem