0Pricing
Linux Command Line Mastery · Lektion

Prozessprioritäten mit nice, renice und Signalen

Steuern Sie mit nice und renice, wie viel CPU-Prozesse erhalten, und lernen Sie, wie Sie mithilfe von Signalen mit laufenden Prozessen kommunizieren – nicht nur, indem Sie sie beenden.

Prozessprioritäten mit nice, renice und Signalen ist eine kostenlose Linux Command Line Mastery-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Linux Command Line Mastery-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Linux Command Line Mastery-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Beyond Starting and Stopping

You already know how to view processes with ps/top and stop them with kill. But sometimes a process should simply run more politely so it does not starve others of CPU.

That is what nice and renice are for.

What Is a Niceness Value?

Every process has a niceness from -20 (highest priority) to 19 (lowest priority). A nicer process yields CPU to others. Default is 0.

Starting a Process with nice

nice -n N command launches a command with niceness N. Higher numbers are friendlier to the rest of the system.

nice -n 10 tar -czf backup.tar.gz /var/log

Viewing Niceness

The NI column in top shows niceness. With ps you can request it explicitly.

ps -o pid,ni,comm -p 1

Changing Priority with renice

renice adjusts the niceness of an already running process by PID.

renice -n 5 -p 1234

Why You Need Root to Raise Priority

Any user can make a process nicer (raise the number). Only root can give a process a negative niceness, because that takes CPU away from everyone else.

sudo renice -n -5 -p 1234

Signals: More Than kill

The kill command really sends a signal. SIGTERM (15) asks nicely to stop; SIGKILL (9) forces it; SIGHUP (1) often tells a daemon to reload config.

kill -l

Reloading Without Restarting

Sending SIGHUP to many services makes them re-read their configuration without a full restart, avoiding downtime.

kill -HUP 4567

Pausing and Resuming a Process

SIGSTOP freezes a process and SIGCONT resumes it, handy for temporarily relieving load.

kill -STOP 4567
kill -CONT 4567

Targeting by Name

pkill and killall let you send signals by process name instead of PID.

pkill -HUP nginx

Putting It Together

A typical admin flow: spot a CPU hog in top, lower its priority with renice instead of killing it, and only escalate to kill -9 if it misbehaves.

renice -n 15 -p 8899 || kill -TERM 8899

Quick Check

Which niceness value gives a process the highest CPU priority?

Recap

You learned to fine-tune process behavior:

  • nice -n N cmd starts at a chosen priority
  • renice changes priority of running PIDs
  • Negative niceness needs root
  • Signals like SIGTERM, SIGHUP, SIGSTOP/SIGCONT control processes without killing them

Häufig gestellte Fragen

Ist die Lektion „Prozessprioritäten mit nice, renice und Signalen“ kostenlos?

Ja — der vollständige Text von „Prozessprioritäten mit nice, renice und Signalen“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Linux Command Line Mastery-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Linux Command Line Mastery-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Prozessprioritäten mit nice, renice und Signalen“?

Steuern Sie mit nice und renice, wie viel CPU-Prozesse erhalten, und lernen Sie, wie Sie mithilfe von Signalen mit laufenden Prozessen kommunizieren – nicht nur, indem Sie sie beenden. Du übst Linux Command Line Mastery mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Linux Command Line Mastery zu starten?

Keine Vorkenntnisse erforderlich. Linux Command Line Mastery auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.

Wie lange dauert die Lektion „Prozessprioritäten mit nice, renice und Signalen“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Linux Command Line Mastery-Lektion Code schreiben und ausführen?

Ja. Jede Linux Command Line Mastery-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Prozesse verstehen: `ps`, `top`, `htop`
  2. Prozesse verwalten: `kill`, `bg`, `fg`
  3. Systemressourcen überwachen: `df`, `du`, `free`
  4. Prozessprioritäten mit nice, renice und Signalen
← Zurück zu Linux Command Line Mastery