SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (17)

Batch FIles
Batch FIlesBatch FIles
Batch FIles
Fredrick Hall
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5
swee meng ng
 
Batch File Programming
Batch File ProgrammingBatch File Programming
Batch File Programming
Frz Khan
 
System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Process
lucita cabral
 
Batch programming and Viruses
Batch programming and VirusesBatch programming and Viruses
Batch programming and Viruses
Akshay Saini
 
Yum package manager
Yum package managerYum package manager
Yum package manager
LinuxConcept
 
Linux tmpfs
Linux tmpfsLinux tmpfs
Linux tmpfs
Mark Veltzer
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionRed Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 
Raspberry Pi 101
Raspberry Pi 101Raspberry Pi 101
Raspberry Pi 101
Tonny Adhi Sabastian
 
Inner Symfony’s Daemons
 Inner Symfony’s Daemons Inner Symfony’s Daemons
Inner Symfony’s Daemons
Krzysztof (Chris) Ozog
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
Michal Sedlak
 
linux
linuxlinux
linux
Deepa Lakshmi
 
2.Accessing the Pi
2.Accessing the Pi2.Accessing the Pi
2.Accessing the Pi
Mayank Joneja
 
Lvm advanced topics
Lvm advanced topicsLvm advanced topics
Lvm advanced topics
Will Sterling
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commands
Mohammad Rafiee
 
BOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTBOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPT
Shahzeb Pirzada
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
badamisri
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5
swee meng ng
 
Batch File Programming
Batch File ProgrammingBatch File Programming
Batch File Programming
Frz Khan
 
System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Process
lucita cabral
 
Batch programming and Viruses
Batch programming and VirusesBatch programming and Viruses
Batch programming and Viruses
Akshay Saini
 
Yum package manager
Yum package managerYum package manager
Yum package manager
LinuxConcept
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionRed Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commands
Mohammad Rafiee
 
BOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTBOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPT
Shahzeb Pirzada
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
badamisri
 

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
Horry County Schools
 
Mypub
MypubMypub
Mypub
coreydiamond9
 
Powerpoint
PowerpointPowerpoint
Powerpoint
Elijudi
 
попов в.в. биография
попов в.в. биографияпопов в.в. биография
попов в.в. биография
Наталья Торлопова
 
HCS PDL: iPad Care & Maintenance
HCS PDL: iPad Care & MaintenanceHCS PDL: iPad Care & Maintenance
HCS PDL: iPad Care & Maintenance
Horry County Schools
 
HCS PDL Parent Presentation
HCS PDL Parent PresentationHCS PDL Parent Presentation
HCS PDL Parent Presentation
Horry County Schools
 
Dhcp presentation 01
Dhcp presentation 01Dhcp presentation 01
Dhcp presentation 01
maverick4489
 
Ad

Similar to Help, my computer is sluggish (20)

Pc dianosing
Pc dianosingPc dianosing
Pc dianosing
riomar catinguel
 
Linux optimization strategy plan by shiv
Linux optimization strategy plan by shivLinux optimization strategy plan by shiv
Linux optimization strategy plan by shiv
thedatabasearchitect
 
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
Power Admin LLC
 
Types of Computer System Errors.pptx
Types of Computer System Errors.pptxTypes of Computer System Errors.pptx
Types of Computer System Errors.pptx
ArjunePantallano1
 
Types of computer system error
Types of computer system errorTypes of computer system error
Types of computer system error
Rachel Espino
 
Tuning Java Servers
Tuning Java Servers Tuning Java Servers
Tuning Java Servers
Srinath Perera
 
COMPUTER SYSTEM11 SERVICING MOBO,CPU,RAM
COMPUTER SYSTEM11 SERVICING MOBO,CPU,RAMCOMPUTER SYSTEM11 SERVICING MOBO,CPU,RAM
COMPUTER SYSTEM11 SERVICING MOBO,CPU,RAM
DannyEreer
 
Lamp Stack Optimization
Lamp Stack OptimizationLamp Stack Optimization
Lamp Stack Optimization
Dave Ross
 
Understanding And Managing Memory
Understanding And Managing MemoryUnderstanding And Managing Memory
Understanding And Managing Memory
isma ishak
 
Hardware
HardwareHardware
Hardware
karan saini
 
PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...
PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...
PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...
Sitamarhi Institute of Technology
 
Computer is slow
Computer is slowComputer is slow
Computer is slow
RitikaSingh263
 
Testing pc’s performance
Testing pc’s performanceTesting pc’s performance
Testing pc’s performance
iteclearners
 
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
Mark John Lado, MIT
 
DHFGHG
DHFGHGDHFGHG
DHFGHG
ravi123980
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work Faster
Gaurav bhatnagar
 
Class 1
Class   1Class   1
Class 1
dduncan3
 
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
Vishal Gurujuwada
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
Maria Joslin
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
CharlieGilbertson
 
Linux optimization strategy plan by shiv
Linux optimization strategy plan by shivLinux optimization strategy plan by shiv
Linux optimization strategy plan by shiv
thedatabasearchitect
 
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
Power Admin LLC
 
Types of Computer System Errors.pptx
Types of Computer System Errors.pptxTypes of Computer System Errors.pptx
Types of Computer System Errors.pptx
ArjunePantallano1
 
Types of computer system error
Types of computer system errorTypes of computer system error
Types of computer system error
Rachel Espino
 
COMPUTER SYSTEM11 SERVICING MOBO,CPU,RAM
COMPUTER SYSTEM11 SERVICING MOBO,CPU,RAMCOMPUTER SYSTEM11 SERVICING MOBO,CPU,RAM
COMPUTER SYSTEM11 SERVICING MOBO,CPU,RAM
DannyEreer
 
Lamp Stack Optimization
Lamp Stack OptimizationLamp Stack Optimization
Lamp Stack Optimization
Dave Ross
 
Understanding And Managing Memory
Understanding And Managing MemoryUnderstanding And Managing Memory
Understanding And Managing Memory
isma ishak
 
PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...
PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...
PPS 1.1.INTRODUCTION TO COMPONENTS OF A COMPUTER SYSTEM (DISKS, MEMORY, PROCE...
Sitamarhi Institute of Technology
 
Testing pc’s performance
Testing pc’s performanceTesting pc’s performance
Testing pc’s performance
iteclearners
 
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
Mark 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 Faster
Gaurav 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 know
Vishal Gurujuwada
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
Maria Joslin
 
Ad

More from Kevin OBrien (20)

American icon pmi
American icon   pmiAmerican icon   pmi
American icon pmi
Kevin OBrien
 
Tls 1.3
Tls 1.3Tls 1.3
Tls 1.3
Kevin OBrien
 
Forward Secrecy
Forward SecrecyForward Secrecy
Forward Secrecy
Kevin OBrien
 
Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key Exchange
Kevin 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 hack
Kevin OBrien
 
SSL certificates
SSL certificatesSSL certificates
SSL certificates
Kevin OBrien
 
Encryption basics
Encryption basicsEncryption basics
Encryption basics
Kevin OBrien
 
Passwords
PasswordsPasswords
Passwords
Kevin OBrien
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Kevin OBrien
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery Commands
Kevin OBrien
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
Kevin OBrien
 
The ps Command
The ps CommandThe ps Command
The ps Command
Kevin OBrien
 
Installing Software, Part 3: Command Line
Installing Software, Part 3: Command LineInstalling Software, Part 3: Command Line
Installing Software, Part 3: Command Line
Kevin OBrien
 
Installing Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesInstalling Software, Part 1 - Repositories
Installing Software, Part 1 - Repositories
Kevin 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 Considerations
Kevin OBrien
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig Command
Kevin OBrien
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two Commands
Kevin 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 Bash
Kevin 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
 
Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key Exchange
Kevin 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 hack
Kevin OBrien
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Kevin OBrien
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery Commands
Kevin OBrien
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
Kevin OBrien
 
Installing Software, Part 3: Command Line
Installing Software, Part 3: Command LineInstalling Software, Part 3: Command Line
Installing Software, Part 3: Command Line
Kevin OBrien
 
Installing Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesInstalling Software, Part 1 - Repositories
Installing Software, Part 1 - Repositories
Kevin 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 Considerations
Kevin OBrien
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig Command
Kevin OBrien
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two Commands
Kevin 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 Bash
Kevin 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
 

Recently uploaded (20)

Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 

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
  翻译: