Presentation is loading. Please wait.

Presentation is loading. Please wait.

Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources.

Similar presentations


Presentation on theme: "Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources."— Presentation transcript:

1 Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources

2 Guide to Linux Installation and Administration, 2e2 Objectives In this chapter, you will: Access the /proc file system to manage system status Control how processes use system resources Track physical and virtual memory usage Locate and relieve system bottlenecks Manage system logs

3 Guide to Linux Installation and Administration, 2e3 Viewing System Status in /proc The /proc file system is a specialized file system that lets you view and control system resources such as processes, memory, and kernel networking parameters When you query a filename in /proc, the Linux kernel responds with live information about the status of a process, memory, or other resource

4 Guide to Linux Installation and Administration, 2e4 Viewing Device Information

5 Guide to Linux Installation and Administration, 2e5 System Information in the KDE Control Center

6 Guide to Linux Installation and Administration, 2e6 Viewing Process Information The /proc file system contains detailed information about each process running on Linux Before you can access information in /proc regarding a specific process, you need to find the process’s PID number To find the PID for a running process, use the ps command

7 Guide to Linux Installation and Administration, 2e7 Managing Processes To manage your system effectively, you will often need to display detailed information about specific processes The ps command has many options to select processes to be included in the command output You can select what information is displayed about each process

8 Guide to Linux Installation and Administration, 2e8 Ps Options Used to Select Processes

9 Guide to Linux Installation and Administration, 2e9 Combination Process Information Fields Available from ps

10 Guide to Linux Installation and Administration, 2e10 Process Information Fields Available from ps

11 Guide to Linux Installation and Administration, 2e11 Process Information Fields Available from ps (continued)

12 Guide to Linux Installation and Administration, 2e12 Changing Process Priorities Each process in Linux is assigned a priority, called a nice level The root user can change the priority of any process; other users can raise the nice level of processes they have started The nice and renice commands set a process’s nice level; other command-line and graphical programs also let you change a process’s nice level

13 Guide to Linux Installation and Administration, 2e13 Viewing Processor Usage with top The top command lists processes according to how much CPU time they are using The output of top is updated every few seconds The top command can also be used to control processes by sending them signals

14 Guide to Linux Installation and Administration, 2e14 Interactive Commands in top

15 Guide to Linux Installation and Administration, 2e15 Using Graphical Process Managing Tools KDE System Guard and the Gnome System Monitor are two powerful graphical process management utilities Graphical process managing tools display many fields of information about each process and can be used to send signals to a process

16 Guide to Linux Installation and Administration, 2e16 The KDE System Guard Utility

17 Guide to Linux Installation and Administration, 2e17 The Gnome System Monitor Utility

18 Guide to Linux Installation and Administration, 2e18 Actively Monitoring the CPU Load You can display a small CPU load monitor on the Panel of your desktop to keep an eye on system load When the CPU load is consistently high, you can begin checking for processes that may need attention

19 Guide to Linux Installation and Administration, 2e19 A CPU Load Monitor

20 Guide to Linux Installation and Administration, 2e20 Managing Memory The Gnome System Monitor provides memory management features You can manage physical memory (RAM) and virtual memory The Linux kernel and Linux programs can only interact with information stored in RAM

21 Guide to Linux Installation and Administration, 2e21 Understanding Shared Libraries Shared libraries let many Linux programs access the same programming functionality without loading it into memory multiple times Dynamically linked applications use shared libraries Statically linked applications have a copy of the programming libraries they need built into the application itself

22 Guide to Linux Installation and Administration, 2e22 Understanding Paged Memory A page of memory is a block of 4 KB of RAM The Linux kernel moves data to and from swap space in pages

23 Guide to Linux Installation and Administration, 2e23 Tracking Memory Usage The free command displays information about RAM and virtual memory usage All the information displayed by free is in kilobytes A buffer is memory used by an application for data storage

24 Guide to Linux Installation and Administration, 2e24 Memory Usage

25 Guide to Linux Installation and Administration, 2e25 The Preferences Dialog Box in the Gnome System Monitor

26 Guide to Linux Installation and Administration, 2e26 Tracking Per-Application Memory Use You can use the Gnome System Monitor to view how a single process is using memory Right-click on any process and choose Memory Maps from the pop-up menu

27 Guide to Linux Installation and Administration, 2e27 Graphical Memory Map Tab for a Single Process

28 Guide to Linux Installation and Administration, 2e28 Viewing Virtual Memory Information You can use the vmstat command to view detailed information about how swap space is used When vmstat is run as a regular command, its output is based on information averaged over time since the system was booted

29 Guide to Linux Installation and Administration, 2e29 Locating System Bottlenecks A bottleneck is the part of a computer system that significantly slows down completion of the task at hand Bottlenecks reduce system performance when one component, such as a slow network connection or disk drive, can’t keep up with the rest of the system

30 Guide to Linux Installation and Administration, 2e30 Identifying and Removing Bottlenecks Use various utilities Test many programs Review performance measurements and system status

31 Guide to Linux Installation and Administration, 2e31 Using Benchmarks To identify bottlenecks a benchmark program can be used Benchmarks provide a numeric measurement of one aspect of system performance

32 Guide to Linux Installation and Administration, 2e32 Managing System Logs Log files record the activities of Linux programs The main system log used by the kernel and many daemons is /var/log/messages A message is a description of what is happening within a program

33 Guide to Linux Installation and Administration, 2e33 Commonly Logged Events and Their Log Files

34 Guide to Linux Installation and Administration, 2e34 The syslogd and klogd Daemons Any program running on Linux can call the shared programming function syslog and pass it a message syslogd watches for messages submitted by programs The klogd daemon (kernel logging daemon) watches for messages submitted by the Linux kernel

35 Guide to Linux Installation and Administration, 2e35 How syslogd and klogd Work together to Process Log Messages

36 Guide to Linux Installation and Administration, 2e36 Configuring the System Log Both syslogd and klogd rely on a single configuration file: /etc/syslog.conf Each line in syslog.conf defines a set of messages and what action to take with those messages Messages are defined using a selector, which is made up of a facility and a priority The facility defines the type of program that generated the message The priority defines the severity or type of message

37 Guide to Linux Installation and Administration, 2e37 The Facilities

38 Guide to Linux Installation and Administration, 2e38 The Priorities

39 Guide to Linux Installation and Administration, 2e39 The Actions Once you set up a selector (consisting of a facility and a priority), you can assign an action to that selector The action determines what syslogd and klogd do with the messages defined by the selector

40 Guide to Linux Installation and Administration, 2e40 Configuration File Syntax

41 Guide to Linux Installation and Administration, 2e41 Using the logger Utility The logger utility lets you send a message to the system logging daemon You can use the logger utility from a command line or from a script You can specify selectors with the logger command

42 Guide to Linux Installation and Administration, 2e42 Analyzing Log Files Log files contain a valuable record of what has occurred on your Linux system A system administrator should regularly check log files for indications of trouble You can use standard Linux tools like grep to search for information in the log files

43 Guide to Linux Installation and Administration, 2e43 Interpreting Sample Log File Entries

44 Guide to Linux Installation and Administration, 2e44 Rotating Log Files A common log rotation system stores log files for a month, with a separate archive file for each week Red Hat Linux provides a utility called logrotate to manage many types of log files The configuration file /etc/logrotate.conf defines how log files are rotated

45 Guide to Linux Installation and Administration, 2e45 Summary The /proc file system lets you view details about the kernel, running processes, and other system information You can view process information using /proc or using the ps and top commands Each process in Linux is assigned a priority, called a nice level The nice and renice commands set a process’s nice level KDE System Guard and the Gnome System Monitor display information about each process and can be used to send signals to a process

46 Guide to Linux Installation and Administration, 2e46 Summary The Linux kernel moves data to and from swap space in pages—4 KB pieces The free and vmstat commands display information about RAM and virtual memory usage Bottlenecks reduce system performance, but benchmarks can help identify bottlenecks System and kernel messages are logged by the syslogd and klogd daemons using the configuration in /etc/syslog.conf Log files must be maintained by rotating them using the logrotate command


Download ppt "Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources."

Similar presentations


Ads by Google