Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Linux for System Administrators

You're reading from   Linux for System Administrators Navigate the complex landscape of the Linux OS and command line for effective administration

Arrow left icon
Product type Paperback
Published in Sep 2023
Publisher Packt
ISBN-13 9781803247946
Length 294 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Viorel Rudareanu Viorel Rudareanu
Author Profile Icon Viorel Rudareanu
Viorel Rudareanu
Daniil Baturin Daniil Baturin
Author Profile Icon Daniil Baturin
Daniil Baturin
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Linux Basics
2. Chapter 1: Getting to Know Linux FREE CHAPTER 3. Chapter 2: The Shell and Its Commands 4. Chapter 3: The Linux Filesystem 5. Chapter 4: Processes and Process Control 6. Chapter 5: Hardware Discovery 7. Part 2: Configuring and Modifying Linux Systems
8. Chapter 6: Basic System Settings 9. Chapter 7: User and Group Management 10. Chapter 8: Software Installation and Package Repositories 11. Chapter 9: Network Configuration and Debugging 12. Chapter 10: Storage Management 13. Part 3: Linux as a Part of a Larger System
14. Chapter 11: Logging Configuration and Remote Logging 15. Chapter 12: Centralized Authentication 16. Chapter 13: High Availability 17. Chapter 14: Automation with Chef 18. Chapter 15: Security Guidelines and Best Practices 19. Index 20. Other Books You May Enjoy

Overview of basic settings

Linux has various basic settings that you can configure to customize the behavior of your system. These settings are typically found in configuration files, and they can affect various aspects of the operating system:

  • System time configuration: The system time in Linux is critical for a variety of tasks, including scheduling tasks, logging, and time-sensitive applications. The system time can be configured using the timedatectl command in most modern Linux distributions. This command allows users to set the system’s time zone, as well as the date and time.
  • Hostname configuration: The hostname is the name given to a computer or device on a network. In Linux, the hostname can be configured using the hostnamectl command. This command allows users to set the hostname, as well as the static IP address and domain name.
  • User and group configuration: In Linux, users and groups are used to control access to the system and its resources. The useradd and groupadd commands are used to create new users and groups, respectively. The usermod and groupmod commands are used to modify existing users and groups.
  • Network configuration: Networking is an essential component of modern computing, and Linux provides several tools to configure network settings. The ifconfig command can be used to configure network interfaces, while the ip command can be used to manage IP addresses, routes, and network devices. The NetworkManager service is a popular tool for managing network connections and settings in Linux.
  • System security configuration: Linux is known for its robust security features, and many system configuration settings focus on enhancing system security. Some of the key security configuration settings include configuring the firewall, managing user permissions, configuring Security-Enhanced Linux (SELinux), and setting up system auditing and monitoring.
  • System performance configuration: Linux is a highly efficient operating system, but there are still several configuration settings that can be used to optimize system performance. These settings include configuring the kernel, tuning system parameters such as the I/O scheduler and memory allocation, and managing system resources such as CPU and memory usage:
    • Kernel parameters: The Linux kernel has various tunable parameters that can be adjusted to optimize performance for specific workloads. These parameters can be set during boot or runtime using the sysctl command or by modifying the /etc/sysctl.conf file.

For example, to increase the maximum number of open files allowed by the system, you can set the fs.file-max parameter:

# Increase the maximum number of open files
sysctl -w fs.file-max=100000
  • CPU scaling: Linux provides CPU scaling mechanisms that control the CPU’s frequency and power-saving features. Adjusting CPU scaling can help strike a balance between power efficiency and performance.

For example, to set the CPU governor to performance mode (maximum frequency all the time), you can use the cpufreq-set command (may require installation of cpufrequtils):

cpufreq-set -r -g performance
  • I/O scheduler: The Linux kernel offers multiple I/O schedulers, each designed for specific storage devices and access patterns. Choosing the right scheduler for your storage can improve I/O performance.

As an example, to set the I/O scheduler for a specific block device, such as an SSD, use the following command:

echo "deadline" > /sys/block/sdX/queue/scheduler
  • Swap configuration: The swap space is used when physical RAM is full. However, excessive swapping can significantly impact performance. Adjusting swapiness can control the tendency to swap out memory.

For example, to reduce swappiness (less aggressive swapping), set a lower value (for example, 10) in /etc/sysctl.conf:

vm.swappiness=10
  • Filesystem mount options: Mount options for filesystems can impact performance based on the use case. Some options can optimize read/write operations or enhance data safety.

As an example, for an SSD-mounted filesystem, you can set the noatime option to avoid updating access timestamps for improved read performance:

UUID=YOUR_UUID /mnt/ssd ext4 defaults,noatime 0 2
  • Network settings: Fine-tuning network parameters can enhance networking performance and reduce latency.

For example, to increase the TCP buffer size, set the following in /etc/sysctl.conf:

net.core.rmem_max = 16777216
net.core.wmem_max = 16777216

System performance configuration is an iterative and adaptive process that requires a deep understanding of the system’s components and workloads. By making informed and measured adjustments, system administrators can create efficient, stable, and responsive systems that meet the needs of their users and applications.

Note

Remember to back up configuration files before making changes and thoroughly test the system after modifications to ensure the desired performance improvements. The optimal settings may vary depending on the specific hardware, workload, and user requirements. Regular monitoring and profiling can help you identify performance bottlenecks and further refine the configuration.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image