Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Thursday, December 27, 2012

20 Linux System Monitoring Tools


Need to monitor Linux server performance? When a performance issue arises, there are 4 main areas to consider: CPU, Memory, Disk I/O, and Network. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as:
  1. Monitoring System Resource
  2. Monitoring Disks (storage) .
  3. Monitoring Users.
  4. Network bottlenecks.
1.Monitoring System Resource

1.1 Top – Linux Process Monitoring
The top will display a continually updating report of system resource usage. The top portion of the report lists information such as the system time, uptime, CPU usage, physical ans swap memory usage, and number of processes.
You can modify the output of top while is is running. If you hit an i, top will no longer display idle processes. Hit i again to see them again. Hitting M will sort by memory usage, S will sort by how long they processes have been running, and P will sort by CPU usage again.
In addition to viewing options, you can also modify processes from within the top command. You can use u to view processes owned by a specific user, k to kill processes, and r to renice them.
For more in-depth information about processes you can look in the /proc filesystem. In the /proc filesystem you will find a series of sub-directories with numeric names. These directories are associated with the processes ids of currently running processes. In each directory you will find a series of files containing information about the process.

1.2 Iostat – Input/Output Statistics
The iostat will display the current CPU load average and disk I/O information. This is a great command to monitor your disk I/O usage. IoStat is simple tool that will collect and show system input and output storage device statistics. This tool is often used to trace storage device performance issues including devices, local disks, remote disks such as NFS.

1.3 VmStat – Virtual Memory Statistics 
The vmstat command will provide a report showing statistics for system processes, memory, swap, I/O, and the CPU. These statistics are generated using data from the last time the command was run to the present. In the case of the command never being run, the data will be from the last reboot until the present.By default vmstat command is not available under Linux systems you need to install a package called sysstat that includes a vmstat progra.

1.4 Lsof – List Open Files
The lsof command will print out a list of every file that is in use. Since Linux considers everything a file, this list can be very long. However, this command can be useful in diagnosing problems. An example of this is if you wish to unmount a filesystem, but you are being told that it is in use. You could use this command and grep for the name of the filesystem to see who is using it.
Or suppose you want to see all files in use by a particular process. To do this you would use lsof -p -processid-.

1.5 ps - Process Status command
 The ps will provide you a list of processes currently running. There is a wide variety of options that this command gives you. A common use would be to list all processes currently running. To do this you would use the ps -ef command.
The first column shows who owns the process. The second column is the process ID. The Third column is the parent process ID. This is the process that generated, or started, the process. The forth column is the CPU usage (in percent). The fifth column is the start time, of date if the process has been running long enough. The sixth column is the tty associated with the process, if applicable. The seventh column is the cumulitive CPU usage (total amount of CPU time is has used while running). The eighth column is the command itself.


2. Monitoring Disks (storage) .

2.1 Df command
The df will show disk usage for all your mounted filesystems in 1K block. You can also use the -h to see the output in "human-readable" format. This will be in K, Megs, or Gigs depending on the size of the filesystem. In addition to space usage, you could use the -i option to view the number of used and available inodes.

2.2 The du command
To view usage by a directory or file you can use du. Unless you specify a file name du will act recursively. Or like the df I can use the -h and get the same output in "human-readable" form. For example: 

 
If you just want a summary of that directory you can use the -s option.

2.3 The Fdisk command
The fdisk command is a text-based utility for viewing and managing hard disk partitions on Linux. It’s one of the most powerful tools you can use to manage partitions.
fdisk -l commands lists the partitions on your system. To view all partitions of the /dev/sda hard disk
fdisk -l /dev/sda

3. Monitoring Users.


Monday, February 6, 2012

What is Server ?

Server is any computer providing services to other computers, but usually the term server implies a powerful computer tha supports a number of user simultaneously.
Server will have a number of features that distinguish it from a desktop computer:
1.      Robustness: the system will be capable of running 24x7, having higher quality components and providng reduntdant components. It means a coponet fail, another is already fitted in the system to take its place., many configuration operations as possible can take place with out interrupting services ( hot-swappable for instance).
2.      Scalability: the sysem will be aasily upgradeable so that it can be improved to meet chaging tequirements. The case will have plenty of space and connectors to add new components and the power supply to operate them.
3.      Security: the system will ensure the intergrity of data by protecting it from system errors, environmental problems, theft, unauthorised access, and network attachs, such as hacking and viruses.
4.      Performance: the system will user high performance components such ads the motherboard, processor, meomory and disk subsystem.
5.      Capacity: the system will provide a large amount of disk space and backup capability.

Server are often powerful microcomputers, minicomputers, or mainframes:
micro-computer
 Microcomputer: is one based around a microprocessor (or CPU). Desktop PCs are microcomputers based on the Intel microprocessor specification(x86). PC Servers are powerful versions of desktop PCs. PC servers come in a variety of types and specifications, from basic office file servers to enterprise-levelsystems. Mid- to high-end servers will incorporate multiple processors( generally 2,4, or 8 ) and multiple gigabytes of memory. PC servers  utilise higher quality components and greater reliability but also greater cost. PC servers have more rocessors, memory, disk direves, adapters, and power supplies.
Some of the major manufacturers of PC servers include IBM, HP, Sun, Dell, and Apple. PC server can run a wide range of Network Operating Systems, including Microsoft Windows Server, Novel NetWare, Linux and Mac OS X Server.
Mainframe
Mainframe computer: is a massively powerful and expensive computer capable of supporting hundreds or thousands of users simultaneously. Mainframes are charactoerised by their huge size, capacity, and performance and also by their reliability. In the original mainframes, the processors consisted of separate components. Modern mainframes now use microprocessos ( up to 54 in the latest model) but the architecture of the mainframe platform is still completely different to that of PC servers. They are widely used by corporations for large-scale data processing, where the requirements for capacity, availability, and security cannot be fulfilled by PC servers. Mainframes are often used to run multiple “virtual servers”.
Minicomputer: is a smaller, less powerful, more affordable version of a mainframe. 


Features of Servers:
1.      High Availability and Fault Tolerance: it is well-known maxim that time costs money. Availability is not restricted to catastrophic crashes or complete system failures. A system that is slow is also costing time. Fault tolerance refers to a server’s ability to keep serving even if something goes wrong. It is provided through the robustness of computer components and by providing for redundancy in the system. Where redundancy is provided, the component is said to be n+1, where n is the number of components in use and 1 is a spare to be used in the event of failure.
2.      Clustering: a clustering services is a means of providng redundancy to protect access in the event of hardware failure. A cluster consists of nodes; each a separate server providing duplicate services. In the event of a failure, the remain nodes will take on the services of failed node.
3.      Load Balancing: refers to distributing requests between multiple components. From the point of view of the client, there is noly one resource. In some configurations, having multiple components can provide load balancing and redundancy. Other load balancing configurations do not provide redundancy; if one component fails, the whole system goes down.
4.      Scalability: means the ability to improve the performace of a server without diminishing its usefulness or increasing tis cost disproportionately. A well-designed server is able to expand to meet the increased needs of its users.
Operating systems for Server:
Server can run a wide ranger of network operating system (NOS) such as Microsoft Windows Server, Novel NetWare, Linux and Mac OS X Server. The main areas that should be considered when selecting a NOS are as follows:
§  Performance: produce adequate throughput and response for the desired number of users and does it support adequate storadge? Most NOS support multiprocessing. An NOS also often supports more memory than desktop OS.
§  Reliability: assurance that the system run 24x7 and provide fault tolerance.
§  Scalability: is it capable of being scaled-up as the network grows (maximum number of users supportd) ? NOS also support features such as clustering and load balancing.
§  Security: does it provide adequate protection for data?
§  Platforms available: compter architures that can be used.
§  Management: it should provide powerful and non-complex tools to centrally manage the network.
§  Interoperability: ability to work with other systems.
§  Application support: what applications are available?
§  Cost per user: how does the system compare with its competitors when the above factors are considered?
Types of servers:
These services may run on a dedicated server or you may coinfigure a single box to run multiple services, depending on the size of the network and budget.
Network services
·         Directory services and authentication: the network is controlled by an administrator by specifying accounts on a directory server. In order to use the network, a user must be authenticated by supplying a correc username and password at log on. Additional security can be enforced by requiring other authentication, such as swiping a smartcard… To access a resource on the network, the user must also have been granted the appropriate permissions. Permissions are applied to group accounts, and then users are assigned to one or more group accounts. Most directory services are implementations of the Leghtweight Directory Access Protocol(LDAP).
·         Network configuration and access: many server are configured to provide addressing information on a network, running TCP/IP services such as DHCP, DNS and WINS. They may also be configured to function as a firewall, proxy server, a gateway, router, or bridge. They can also be configured to provide remote access to resources on server (VPN).
·         Network monitoring: the server can be configured to monitor the network and collect infromation about assets.
File and Print Services: one of the basic functions of a server is to provide shared access to folders and files. This has severa advantages:
·         More disk space is made available to users cheaply.
·         File version control can be administered centrally
·         Files can be secured against unauthorised access.
·         Data can be backed up more reliably.
·         A print server enables multiple users to use a print device saving on costs
Internet services:  A server connected to the internet can function as  a web server.
·         Applications: Typical server application include email, groupware, databases, accounting…As applications can be demanding to run, they are often located on dedicated applicaion servers.
·         Dedicated Application: the term refers to server hardware that runs one application only. The application gets reliable performance from server hardware. But higher cost in terms of providing dedicated equipment.
·         Distributed Application: is provided by more than one physical server on the network. Data can be distributed around thes servers. This model provides robustness. Services are not generally interrupted because of the failure of individual services. It can also improve performance by distributing load between different machines.
·         Peer-to-Peer Application (P2P): each instance of the application can act as both client and server to other instances. P2P applications are capable of utilising spare capacity from all nodes to improve performance.
Planning server:
In planning a server network, the following questions are important:
·         What services(applications) and /or resouces (disk space, print facilities, and so on) must be provided to network users?
·         What load is to be expected for each application and resource? ( how many simultaneous users the server would support and capacity require)
·         What growth ca the network expect in the future?
The answers to these questions determine how you specify your server system.