How long has Linux been running?

Source: Internet
Author: User
How long does Linux run-Linux Enterprise Application-Linux server application information? For more information, see. 1. view the clock interruption:

$ Cat/proc/interrupts
CPU0
0: 1380471 IO-APIC-edge timer
1: 3626 IO-APIC-edge i8042
7: 0 IO-APIC-edge parport0
8: 3 IO-APIC-edge rtc
9: 1 IO-APIC-level acpi
14: 39229 IO-APIC-edge libata
15: 39999 IO-APIC-edge libata
169: 244640 IO-APIC-level uhci_hcd: usb2
177: 2 IO-APIC-level uhci_hcd: usb1, ehci_hcd: usb5
185: 0 IO-APIC-level uhci_hcd: usb3
193: 410350 IO-APIC-level uhci_hcd: usb4, i915 @ pci: 0000: 00: 02.0
201: 251593 IO-APIC-level Intel ICH7
209: 148723 IO-APIC-level eth0
NMI: 0
LOC: 1380276
ERR: 0
MIS: 0

The first disconnection means the clock interruption, and the second number indicates the number of interruptions. Because the clock interruption has a certain frequency, you can know how long the system has been running based on this value.

The frequency of clock interruption is called the cycle in Linux. Run the following command to view the current system configuration cycle:

$ Cat/boot/config-'uname-R' | grep '^ CONFIG_HZ ='
CONFIG_HZ = 250

If there are 250 clock interruptions in one second, the system runs 1380471/250 = 5521.88 s.

2. view the/proc file:
$ Cat/proc/uptime
5863.73 4889.31

The first value indicates the total start time of the system, and the second value indicates the idle time of the system, in seconds.

The idle ratio is 4889.31/5863.73 = 83.38%.

3 uptime command:
$ Uptime
17:12:47 up, 8 users, load average: 0.94, 0.51, 0.47

It indicates the start time, status, total start time, number of users, and load balancing in the past 1, 5, and 15 minutes (average number of processes in the running Queue ).

On average, there are almost half of the processes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.