Linux Sysadmin Basics -- 6.2 State, Niceness, and How to Monitor Processes

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024

Комментарии • 38

  • @VanDerLaars
    @VanDerLaars 10 лет назад +74

    Dude, I was gonna start teaching a friend at work when I found your videos that he can watch instead and learn faster and better. You did a Hell of a job. Well done!!!

  • @samuraijack5919
    @samuraijack5919 4 года назад +39

    My Notes:
    Linux Sysadmin Basics -- 6.2 State, Niceness, and How to Monitor Processes
    0:43 What is the proc filesystem?
    Process Filesystem
    - virtual filesystem the linux kernel mounts to post information about its processes so that applications have easy access to them
    --
    1:06 Every Process wants what?
    CPU time
    --
    1:32 What is responsible for: scheduling what process get CPU time when?
    The kernel
    - Determines this based on what state the process is in.
    --
    2:19 What are the 4 states a process can be in?
    1) Run-able - Eligible to be scheduled for CPU time, has all the info it needs
    2) Sleeping - Waiting for something
    3) Zombie - Finished with what it was doing, waiting to give back info it has come up with & be killed by kernel
    4) Stopped - May have been in the middle of doing something BUT received stop signal and is now waiting for the continue signal to resume
    --
    3:50 If you have a lot of Zombie processes causing an issue, what would be useful to check for?
    Parent PID (PPID)
    - the issue could be that the parent hasn't collected finished output of the processes and the children can't die
    --
    4:16 The most common tool/command to monitor processes is...
    top
    (command: automatically sorts by % of cpu use, # of things running, states of processes, etc)
    --
    5:37 Besides the 'top' command, what command can show you MORE detailed and granular info about processes, resource use and process states?
    (Hint: features scrolling)
    htop
    (command, you may need to install)
    - nicer interface
    - allows you to scroll
    - can scroll to a process and send a signal to it directly
    - more features, read man page
    --
    8:16 What should be your first step in exploring any new program?
    Look at the man page
    - familiarize yourself with the options available
    - see if there are any examples at the end
    --
    8:47 What is Niceness (NI)?
    A value that determines how 'nice' a process is to other processes
    (the priority of the process)
    --
    9:30 With Niceness, the HIGHER the number...
    ... the LOWER the priority
    (the #s go from -20 [SUPER HIGH] to 19 [lowest priority])
    - Ex:
    Low priority command: nice - n 15 /backup/not/important/at/all/task
    --
    10:40 Niceness and Customer facing systems: with anything like this, you want to be careful not to....
    ...run things that will run things that will grind everything else to a halt
    (because you might want to set a lower niceness level)
    - too great a level might make your system feel like it is freezing up
    - generally, you don't want to set anything to the minimum niceness/highest priority b/c it will block other stuff
    --
    11:27 How do you renice (change priority) of a task?
    Syntax:
    renice -5 2744
    (make sure that you have appropriate privileges)
    - you can also change it with htop with F7 or F8
    --
    13:53 Example Problem: You are on a new system and it has slowed to a craw.
    What do you do?
    1) Open up top (or htop)
    2) What is taking up the MOST memory?
    3) How much memory is free?
    4) What is taking up the highest % of CPU usage?
    5) Are there a lot of zombie processes (frozen parent)?
    Tell me if there is anything I missed. Be safe and enjoy your day.

    • @vincentstclair7025
      @vincentstclair7025 3 года назад +1

      Good stuff. Thanks for posting!

    • @BilgeKarga1
      @BilgeKarga1 3 года назад +1

      thx man I appreciated it you're very note taking is very engaging

    • @DarkXagami
      @DarkXagami 3 месяца назад

      Damn! I've been over here writing down the video number and writing notes. This is WAAAAY BETTER!! Thanks man!

  • @calebdelgado4999
    @calebdelgado4999 7 лет назад +13

    You are $%&& genius, I am not even a 80% English speaker but I understand everything you say which is hard in most of cases!!
    Awesome Tutorial Series, Thanks !!! :)

  • @DarkXagami
    @DarkXagami 3 месяца назад

    I'm still here! And I'm actually understanding! Currently on Day 3!

  • @eftiprwtopapadakis9310
    @eftiprwtopapadakis9310 7 лет назад +10

    Such awesome tutorial! It easily competes expensive one webminars! It really gave me a better understanding of the Linux systems and a confidence boost for upcoming interviews on Linux Administration and related positions! Awesome videos too on your chanel!

  • @fritzb.5921
    @fritzb.5921 5 лет назад +10

    11:44 "sudo !!" would've been faster

  • @PunmasterSTP
    @PunmasterSTP 2 года назад

    Niceness? More like “This is”…another amazing video. Thanks for making it!

  • @TPHBLIB
    @TPHBLIB 8 лет назад +4

    Just a small comment: PR = 20 + NI Therefore value of PR = 20 PLUS (-20 to +19) . This mean 0 to 39 and if we offset that by 100 then it is 100 to 139.

  • @mangoknight5035
    @mangoknight5035 4 года назад

    these videos started his channel , he is a great guy , i litterly started learning linux but i was not sure if to countinue till i watched this guys videos

  • @outlaw8379
    @outlaw8379 4 года назад +2

    I tried renicing GTA to -20 and my computer refused to turn on for an hour :D Love the guides! Recently started watching them as I want to pursue a career in Linux administration.

    • @tutoriaLinux
      @tutoriaLinux  4 года назад

      Haha, that's great. This is exactly the type of experimentation that I hope people will do with my videos :-D. That's the only way to *really* learn this stuff. Have fun!

    • @outlaw8379
      @outlaw8379 4 года назад +1

      tutoriaLinux I agree ! Just learning new things in Linux in general is fun to me so I have no problem with it :^) I already binge watched your entire Linux series and took a ton of notes so now it’s just practice :) thank you for your work!

  • @alexanderischimji9933
    @alexanderischimji9933 4 года назад +2

    Thank you so much for making these videos, they're extremely helpful !

    • @xrafter
      @xrafter 4 года назад

      Some useful information
      There is three streams always open called the standards
      Stdout = terminal screen
      Stdin = the keyboard it will read from the keyboard
      Stderr = the same as stdout but a different stream
      This three streams Don't need to be closed because it will close somehow when shutdown the computer
      The streams also called files or fd(file descriptor)
      Stdout fd = 1
      Stdin = 0
      Stderr = 2

  • @OceaniaFlight815
    @OceaniaFlight815 4 года назад

    All the feels just came back re: how good that first Deus Ex was. Eidos Montreal really nailed stealth in that one. Oh yeah and learning Linux has been awesome too, thanks.

  • @matthewkingery1995
    @matthewkingery1995 5 лет назад

    I tried opening up htop and using F8 to increase the niceness, it went up but then when I tried to reduce it nothing happened. I tried a second time from 0 and nothing happened. I assume that it can't be brought below 0 in niceness by default but is there a reason that it can not be reduced via F7?
    I am on a VM using Ubuntu.

  • @smudgepost
    @smudgepost 5 лет назад +1

    Occasionally I use xkill to nuke problematic windows but I believe this ONLY kills the x resource and not the underlying process.

  • @LucioLiuti
    @LucioLiuti 5 лет назад

    Hi. Why did cpu use go hig after you pressed f9 in htop?

  • @bigdogboos1
    @bigdogboos1 6 лет назад +2

    so why would it require sudo to renice in the command line, but it allows anyone to do in from htop? weird

    • @kapilmathur87
      @kapilmathur87 4 года назад

      thats an interesting question and definitely deserves an answer

  • @TPHBLIB
    @TPHBLIB 8 лет назад

    Once again a great video lesson.

  • @cubeg5813
    @cubeg5813 5 лет назад +3

    Nice video :)

  • @skeeveskeeve
    @skeeveskeeve 6 лет назад

    Just tried to run kill 17 (SIGSTOP) on htop - my expectation was that it would put it to sleep but instead it just kills it.

  • @elikelik3574
    @elikelik3574 5 лет назад

    Bro u r awesome. Thanks a lot for the video. It is really helpful.

  • @vincentdejong1818
    @vincentdejong1818 5 лет назад

    how can I find zombie processes? still awesome series! I'll make notes again on the second pass of everything. Cheers!

    • @johannbauer2863
      @johannbauer2863 5 лет назад

      In htop there is a column names S for state, so if there is a Z in that column, it's in the Zombue State (or read the manpage to htop)

  • @vasvipatel8250
    @vasvipatel8250 8 лет назад

    amazing job done .thank you so much

  • @ethandegny1328
    @ethandegny1328 4 года назад

    you have to press fn and f9

  • @JoshuaPortervideo
    @JoshuaPortervideo 8 лет назад

    Good video.

  • @andreiepure6009
    @andreiepure6009 8 лет назад

    Your videos are great! Have you considered using tmux, so that you don't need to switch terminals? Here, for example, you can keep htop running, switch to another pane, and after running renice the new priority will be visible in an instant

    • @tutoriaLinux
      @tutoriaLinux  8 лет назад +2

      Hey, thanks! In real life (and also in newer videos) I use the i3 tiling window manager for exactly this reason. I do like tmux on remote machines though; I even made a few videos on it. Cheers!

  • @andreviniciusbezerradasilv9335
    @andreviniciusbezerradasilv9335 2 года назад

    thank u

  • @sanjaydubey009
    @sanjaydubey009 9 лет назад

    hmm