Blog

How SAR command work in LINUX VPS

SAR stands for System Activity Report, as its name suggests command is used to collect, report & save CPU, Memory, and I/O usage in Unix an operating system. The SAR command produces the reports on the fly and can also save the reports in the log files as well.

This article explains how to install and configure the sysstat package (which contains the SAR utility) and explains how to monitor the following Linux VPS performance statistics using SAR.

How to install SAR in LINUX?

1. Install Sysstat Package

First, make sure the latest version of SAR is available on your system. Install it using any one of the following methods depending on your distribution.

1

Note: Make sure to pass the option –enable-install-cron. This does the following automatically for you. If you don’t configure sysstat with this option, you have to do this ugly job yourself manually.

Creates /etc/rc.d/init.d/sysstat

2

2. Once installed, verify the SAR version using “SAR -V”

Finally, make sure SAR works. For example, the following gives the system CPU statistics 3 times (with 1 second interval).

3
4

3. Collect the SAR statistics using cron job – sa1 and sa2

/usr/local/lib/sa/sa1

This runs every 10 minutes and collects SAR data for historical reference.

If you want to collect SAR statistics every 5 minutes, change */10 to */5 in the above /etc/cron.d/sysstat file.

This writes the data to /var/log/sa/saXX file. XX is the day of the month. saXX file is a binary file. You cannot view its content by opening it in a text editor.

5

/usr/local/lib/sa/sa2

This runs close to midnight (at 23:53) to create the daily summary report of the SAR data.

5

sa2 creates /var/log/sa/sarXX file (Note that this is different than the saXX file that is created by sa1). This sarXX file created by sa2 is an ASCII file that you can view in a text editor.

4. Linux 2.6.32-431.e16 – Linux kernel version of the system.

01/18/2017 – The date when the SAR data was collected.

_x86_64_ – The system architecture.

(2 CPU) – Number of CPUs available on this system. On multi-core systems, this indicates the total number of cores.

1.

CPU Usage of ALL CPUs (SAR -u)

6

This gives the cumulative real-time CPU usage of all CPUs. “1 5” reports for every 1 second a total of 5 times. Most likely you’ll focus on the last field “%idle” to see the CPU load.

2.

CPU Usage of Individual CPU or Core (SAR -P)

7

If you have 4 Cores on the machine and would like to see what the individual cores are doing, do the following.

3.

Memory Free and Used (SAR -r)

8

This reports the memory statistics. “1 5” reports for every 1 second a total of 5 times. Most likely you’ll focus on “kbmemfree” and “kbmemused” for free and used memory.

Following are a few variations:

4.

Swap Space Used (SAR -S)

This reports the swap statistics. “1 5” reports for every 1 second a total of 5 times. If the “kbswpused” and “%swpused” are at 0, then your system is not swapping.

Following are a few variations:

5.

Overall I/O Activities (SAR -b)

9

This reports I/O statistics. “1 5” reports for every 1 second a total of 5 times.

The following fields are displays in the example below:

tps –

Transactions per second (this includes both read and write).

rtps –

Read transactions per second.

wtps –

Write transactions per second.

bread/s –

Bytes read per second.

bwrtn/s

Bytes written per second.

Following are a few variations:

6.

Individual Block Device I/O Activities (SAR -d)

To identify the activities by the individual block devices (i.e a specific mount point, LUN, or partition), use “SAR -d”

10

Following are a few variations:

7.

Report network statistics (SAR -n)

This reports various network statistics. For example, the number of packets received (transmitted) through the network card, statistics of packet failure, etc., “1 5” reports for every 1 second a total of 5 times.

KEYWORD can be one of the following:

DEV –

Displays network devices vital statistics for eth0, eth1, etc.

EDEV –

Display network device failure statistics.

NFS –

Displays NFS client activities.

NFSD –

Displays NFS server activities.

SOCK –

Displays sockets in use for IPv4.

IP –

Displays IPv4 network traffic.

EIP –

Displays IPv4 network errors.

ICMP –

Displays ICMPv4 network traffic.

ICMP –

Displays ICMPv4 network errors.

This reports the total number of processes created per second, and the total number of context switches per second. “1 5” reports for every 1 second a total of 5 times.

8.

Reports run queue and load average (SAR -q)

This reports the run queue size and loads an average of last 1 minute, 5 minutes, and 15 minutes. “1 5” reports for every 1 second a total of 5 times.

By using the SAR command we can find out the performance status of the server.

Conclusion

Still confused how SAR command work in LINUX VPS? Contact Ideastack now!

Frequently Asked Questions

Q1. What is sar command used for?

The sar command can be used to keep track of a variety of system resources on a Linux system, including CPU and memory usage, file system performance, I/O device consumption, network monitoring, disk usage, process and thread allocation, battery life, plug-and-play device performance, and more.

Q2. How does sar collect data?

Using SAR, gathering, and reporting resource data requires two steps. The first step is to collect test data and save it as a binary file. In the second step, extract the desired data into a text (.txt) report.

Q3. Where are sar files stored?

The term “sar” refers to “system activity report,” and it can be configured to automatically generate daily reports, display current performance, or deliver reports based on log files kept in the /var/log/sa (or /var/log/sysstat) folder on your system.

Linux or Windows VPS? Which is best?

What makes the VPS system works?

This VPS system also known by its full form of Virtual Private Server is a kind of machine that runs and has its system of operation which is housed in a physical computer. It is a form of service that is sold by Internet hosting service providers.

It is a form of operation that works independently from the other virtual spaces that run on the same machine. This form of VPS hosting is basically for the choice of people who want an up-gradation from their shared hosting plans as in the case of them needing more additional resources.

The VPS system is consider best as it lessens the gaps between shared hosting and dedicated hosting solutions. In simple words, it could be like a service apartment where a user can get the feeling of having more control and freedom over their space without the concern for maintenance.

What are the features of the VPS?

What are the features of the VPS?

This virtual private system comes with some of its basic features which add up to its better response among the people.

1. Scalability

It means the ability to handle rapidly and even kind of increase the workloads on the server. It is more regarded in business settings as it has sudden spikes in the process of web traffic.

2. Dedicated form of resources

The hosting of this VPS supplies its users with a dedicated form of resources and even with the flexibility which enables you to choose the disk space, the storage, and the data.

Which OS is best for VPS?

There are two kinds of VPS hosting that are available Linux VPS and Windows VPS which differ from each other by their performance.

The Linux VPS one is something that has a bit less resource and which doesn’t require the request of regular rebooting whenever the load is high. This VPS is particularly used for the SSH and the management of VPS is carried through this. The other one is windows VPS hosting which requires rebooting after every kind of minor patch or any software update, as it uses the graphical user interface.

The Linux servers come with more security since administrators have the editing and more security privileges which depends on its setup along with the hosting system of it, whereas the windows also have the secure factor only if it has the right setting.

Linux servers

Comparison between Linux VPS and the Windows VPS

If you talk in general terms, both of them have different Benefits in which they work best Linux is consider best if there is less demand on your hardware which requires less reboot as cited above and Windows one offers more reliable support from their regular updates.

Linux is less accessible which restricts editing and security access, whereas windows have a large scale target and offer more potential for the user to make errors or flaws.

Conclusion

If we examine each of the requirements individually, we will definitely conclude that a Linux VPS is preferable to a Windows VPS for us. Each has diverse applications, advantages, and drawbacks. The important question right now is which aspect of our project has more advantages than problems. The query that you should respond to independently!

Frequently Asked Questions

Q1. What is the difference between Linux and Windows VPS?

Another major difference between these two types of VPS hosting is the cost. Since Linux is an open-source operating system, there are no license fees. On the other side, Windows is Microsoft’s commercial operating system. It has high licensing fees.

Q2. Is Linux better than Windows Server?

A Windows server often provides more flexibility and support than a Linux server. Linux is frequently chosen by start-up businesses, whereas large existing businesses typically choose Microsoft. Companies in the middle of their growth cycle may consider employing a VPS.

Q3. Why do companies prefer Linux?

The most demanding corporate application requirements, including network and system administration, database management, and web services, are all supported by Linux. In comparison to other server operating systems, Linux servers are usually chosen due to their dependability, security, and adaptability.

Difference between Windows VPS Vs Linux VPS

What is VPS hosting?

VPS (Virtual Private Server) hosting is one of the most popular hosting services you can choose for your website. It uses virtualization technology to provide you with dedicated (private) resources on a server with multiple users.

It usually occurs on a small scale and can buy at cheaper rates instead of renting an entire server.

What is VPS hosting?

What is the need for VPS hosting?

The VPS runs its own copy of an operating system and the best advantage for the customer is they can install any software that runs on the OS system. It is a very smooth and trouble-free type of hosting which is offered at very cheap rates. It creates a virtual server within a physical server.

There are mainly two types of VPS used:

1. Windows VPS

Firstly, Windows VPS offers more flexible and variable options for the administrators. Secondly, it has been in the race for a long time, which allows them to offer software with plenty of benefits and experience behind it. They may have also got long standing relationship between business and operating systems.

One of the most amazing parts is the interface and control system to manage and edit data on web pages and other databases and do similar tasks.

It is said that they have got a high level of technical support and security. Windows has got long years of experience in interest and has a lot of dignity which tends to be one of the well-known and leading VPS hosting providers.

2. Linux VPS

Linux is an open-source operating system which means it is free to use. It is very compatible software because to cut the cost most companies use this software which makes it more for the user more convenient. The best advantage is they don’t experience any memory leaks and don’t slow down or freeze up. They hold the reputation for being the maximum strong OS in life.

Linux VPS is extremely clean to put in. The consumer also can install accessories and gear on the idea in their necessities. Their servers have got many strong layers of protection. It is much more steady and doesn’t require regular reboots at whatever point the update is done. By acquiring the Linux VPS you get root access to the server.

Windows VPS

What is the difference between Windows VPS Vs. Linux VPS?

Accordingly, Linux VPS seems reliable because firstly, to cut company costs most companies use the Linux VPS as it is available for free. Secondly, looking at the performance Linux VPS seems faster and more reliable compared to Windows VPS.

Thirdly, installing Linux is very easy and it is said to be one of the most Eco-friendly installations you may find. Linux can run greater obligations simultaneously than Windows.

Unlike home windows, with a Linux VPS, the patron’s website is allocated a bigger amount of sources, and they could are searching for extra if their business so calls for it.

Conclusion

Ideastack offers Linux VPS at the most competitive price in India with 24x7x365 support.

Frequently Asked Questions

Q1. What is Windows VPS?

You can utilise a virtual machine known as a VPS, or Virtual Private Server, as an environment specifically for your web projects. It is far less expensive than a dedicated server while still offering you total control over maintenance and configuration because it is scaled to deliver the resources you need.

Q2. What is a Linux VPS?

Virtual Private Server, or VPS, is the abbreviation for a virtual machine with hardware resources set aside for you. This solution’s pricing is one of its main benefits because it is significantly less expensive than a typical dedicated server.

Q3. Are all VPS the same?

VPS is a bit more difficult. VPS hosting comes in two types: managed and unmanaged. In that the setup is handled for you, managed plans are identical to shared hosting. It’s up to you with Unmanaged, though developers and specialists primarily use this option.

Difference between Windows VPS Cloud Hosting and Linux VPS Cloud Hosting

Using VPS for web hosting is rising currently and become a famous means to run websites amongst businesses and other entities. Before VPS, websites were host using a dedicated server, a piece of hardware that provided all the resources the business need, including storage and access to programs, files, and data. This hosting model was expensive to establish (or replace) and costly to maintain and upgrade as the business grew.

There are a few advantages to this network: it’s cheap and easy to manage. But shared hosting has its limitations. For instance, you get a limited number of resources. These limitations gave way to the creation of the Virtual Private Server (VPS), which operates via a more powerful server with its operating system. And now there is VPS cloud hosting options, which take a Virtual Private Server to the cloud.

Features of Web Hosting

Features of Web hosting

1.

Affordability

Shared hosting was considered the most economic means but that has changed after VPS cloud hosting. Why? Because most providers will let you choose exactly what features you want, meaning that you only pay for what you want and not any of the extra features that other web hosting providers place into their rates.

2.

Reliability

There is no fear when using VPS, you are assure that your data will be safely stored. This is because data is typically stored on several hard drives, so it’s less likely that your data will be lost.

3.

Speed

It can get very frustrating when a website lags or keeps hanging and is very slow. You’ll likely never have to worry about speed on the VPS cloud. That’s because there are so many resources included in such an option that your site is equipped to run quickly without ever lagging or slowing down.

VPS Hosting Service Models:

VPS Hosting Deployment Models:

Hybrid Cloud

Windows VPS Cloud Hosting

VPS cloud hosting can provide you with a configurable virtual machine on the cloud. Consumers can install and operate their software just as if they had a dedicated computer. VPS is not dedicated. A cheap Windows VPS Cloud server may be shared among many customers, and for this reason, the price is much lower than using a dedicated cloud server.

A VPS can provide you with exactly the features you need without any headaches or overhead. Cloud Windows VPS allows you to create an unlimited number of Linux and Windows virtual machines in your VPS cloud.

Windows Server Virtual Machine Configuration allows you to define the following attributes:

Pros of Windows VPS Hosting:

Benefits of Linux Cloud VPS Hosting

Linux VPS Cloud Hosting

Hosting is very important for a company that needs to store, manipulate and secure data on its servers. One of the hosting options that are most popular today is a cloud VPS, or virtual private server, which is a part of a larger server, but it operates individually, just like a private server. Here are some of the top benefits Linux cloud VPS hosting can offer you.

Benefits of Linux Cloud VPS Hosting

1.

Resource Limitation

This was specially designed to be used in hosting. One of its best features is the Lightweight Virtual Environment (LVE) technology used for resource limitation. The LVE kernel level module is used to restrict single users from bringing down the entire server; accomplished by controlling the amount of RAM and CPU that can be used on any given server process.

2.

Visibility

Users of Linux Cloud have great visibility over their resources. Using the ‘tenant’ model, the system runs each execution by a user inverse. This means it is not difficult to monitor system logs or log attempts that may be potential security threats.

3.

Great Support

This is considered to be one of the best features of Linux Cloud. Users just need to submit tickets to OS support staff to have their issues resolved. This support is available for usage, configuration, installation, bug fixes, and even diagnosis for all versions of Linux Cloud.

Conclusion

Specific aspects of deploying a Linux or Windows VPS can create inconsistencies that clients must resolve when deciding which operating system to use. You may wish to go the simplest path, which is usually a Linux solution, but be cautious of your capacity to deal with its technical issues.

While a Windows-based VPS allows your staff to work in a familiar environment, security concerns may lead you to choose a robust Linux installation. To be successful, you must strike the correct balance, as with many other decisions in life.

Ideastack also provides managed services to help businesses achieve their IT goals. Our technical team has several years of experience and will provide you with the best service available.

Frequently Asked Questions

Q1. What is the difference between cloud hosting and VPS hosting?

A VPS is hosted on a single physical server, but a cloud server is placed on a virtual partition made up of numerous real servers for optimal scalability and availability.

Q2. What is the difference between a shared VPS and a dedicated server?

VPS hosting operates on a virtual shared server, where you host your website with others; dedicated hosting, on the other hand, provides you with your own server to work from. Flexible resource limits with the ability to use other website resources on your server.

Q3. Are all VPS the same?

Managed and Unmanaged are two different types of VPS hosting. Managed plans are similar to shared hosting in that the setup is handle for you. Unmanaged gives you more freedom, developers and professionals are more likely to opt for this.

×

Hello!

Click one of our contacts below to chat on WhatsApp

×