Load (computing)

htop displaying a significant computing load (top right: Load average:)

In UNIX computing, the system load is a measure of the amount of computational work that a computer system performs. The load average represents the average system load over a period of time. It conventionally appears in the form of three numbers which represent the system load during the last one-, five-, and fifteen-minute periods.

Unix-style load calculation

All Unix and Unix-like systems generate a dimensionless metric of three "load average" numbers in the kernel. Users can easily query the current result from a Unix shell by running the uptime command:

$ uptime
 14:34:03 up 10:43,  4 users,  load average: 0.06, 0.11, 0.09

The w and top commands show the same three load average numbers, as do a range of graphical user interface utilities.

In operating systems based on the Linux kernel, this information can be easily accessed by reading the /proc/loadavg file.

To explore this kind of information in depth, according to the Linux's Filesystem Hierarchy Standard, architecture-dependent information are exposed on the file /proc/stat.[1][2][3]

An idle computer has a load number of 0 (the idle process is not counted). Each process using or waiting for CPU (the ready queue or run queue) increments the load number by 1. Each process that terminates decrements it by 1. Most UNIX systems count only processes in the running (on CPU) or runnable (waiting for CPU) states. However, Linux also includes processes in uninterruptible sleep states (usually waiting for disk activity), which can lead to markedly different results if many processes remain blocked in I/O due to a busy or stalled I/O system.[4] This, for example, includes processes blocking due to an NFS server failure or too slow media (e.g., USB 1.x storage devices). Such circumstances can result in an elevated load average, which does not reflect an actual increase in CPU use (but still gives an idea of how long users have to wait).

Systems calculate the load average as the exponentially damped/weighted moving average of the load number. The three values of load average refer to the past one, five, and fifteen minutes of system operation.[5]

Mathematically speaking, all three values always average all the system load since the system started up. They all decay exponentially, but they decay at different speeds: they decay exponentially by e after 1, 5, and 15 minutes respectively. Hence, the 1-minute load average consists of 63% (more precisely: 1 - 1/e) of the load from the last minute and 37% (1/e) of the average load since start up, excluding the last minute. For the 5- and 15-minute load averages, the same 63%/37% ratio is computed over 5 minutes and 15 minutes, respectively. Therefore, it is not technically accurate that the 1-minute load average only includes the last 60 seconds of activity, as it includes 37% of the activity from the past, but it is correct to state that it includes mostly the last minute.

Interpretation

For single-CPU systems that are CPU bound, one can think of load average as a measure of system utilization during the respective time period. For systems with multiple CPUs, one must divide the load by the number of processors in order to get a comparable measure.

For example, one can interpret a load average of "1.73 0.60 7.98" on a single-CPU system as:

  • During the last minute, the system was overloaded by 73% on average (1.73 runnable processes, so that 0.73 processes had to wait for a turn for a single CPU system on average).
  • During the last 5 minutes, the CPU was idling 40% of the time, on average.
  • During the last 15 minutes, the system was overloaded 698% on average (7.98 runnable processes, so that 6.98 processes had to wait for a turn for a single CPU system on average).

This means that this system (CPU, disk, memory, etc.) could have handled all the work scheduled for the last minute if it were 1.73 times as fast.

In a system with four CPUs, a load average of 3.73 would indicate that there were, on average, 3.73 processes ready to run, and each one could be scheduled into a CPU.

On modern UNIX systems, the treatment of threading with respect to load averages varies. Some systems treat threads as processes for the purposes of load average calculation: each thread waiting to run will add 1 to the load. However, other systems, especially systems implementing so-called M:N threading, use different strategies such as counting the process exactly once for the purpose of load (regardless of the number of threads), or counting only threads currently exposed by the user-thread scheduler to the kernel, which may depend on the level of concurrency set on the process. Linux appears to count each thread separately as adding 1 to the load.[6]

CPU load vs CPU utilization

The comparative study of different load indices carried out by Ferrari et al.[7] reported that CPU load information based upon the CPU queue length does much better in load balancing compared to CPU utilization. The reason CPU queue length did better is probably because when a host is heavily loaded, its CPU utilization is likely to be close to 100%, and it is unable to reflect the exact load level of the utilization. In contrast, CPU queue lengths can directly reflect the amount of load on a CPU. As an example, two systems, one with 3 and the other with 6 processes in the queue, are both very likely to have utilizations close to 100%, although they obviously differ.[original research?]

Reckoning CPU load

On Linux systems, the load-average is not calculated on each clock tick, but driven by a variable value that is based on the HZ frequency setting and tested on each clock tick. This setting defines the kernel clock tick rate in Hertz (times per second), and it defaults to 100 for 10ms ticks. Kernel activities use this number of ticks to time themselves. Specifically, the timer.c::calc_load() function, which calculates the load average, runs every LOAD_FREQ = (5*HZ+1) ticks, or about every five seconds:

unsigned long avenrun[3];

static inline void calc_load(unsigned long ticks)
{
   unsigned long active_tasks; /* fixed-point */
   static int count = LOAD_FREQ;

   count -= ticks;
   if (count < 0) {
      count += LOAD_FREQ;
      active_tasks = count_active_tasks();
      CALC_LOAD(avenrun[0], EXP_1, active_tasks);
      CALC_LOAD(avenrun[1], EXP_5, active_tasks);
      CALC_LOAD(avenrun[2], EXP_15, active_tasks);
   }
}

The avenrun array contains 1-minute, 5-minute and 15-minute average. The CALC_LOAD macro and its associated values are defined in sched.h:

#define FSHIFT   11		/* nr of bits of precision */
#define FIXED_1  (1<<FSHIFT)	/* 1.0 as fixed-point */
#define LOAD_FREQ (5*HZ+1)	/* 5 sec intervals */
#define EXP_1  1884		/* 1/exp(5sec/1min) as fixed-point */
#define EXP_5  2014		/* 1/exp(5sec/5min) */
#define EXP_15 2037		/* 1/exp(5sec/15min) */

#define CALC_LOAD(load,exp,n) \
   load *= exp; \
   load += n*(FIXED_1-exp); \
   load >>= FSHIFT;

The "sampled" calculation of load averages is a somewhat common behavior; FreeBSD, too, only refreshes the value every five seconds. The interval is usually taken to not be exact so that they do not collect processes that are scheduled to fire at a certain moment.[8]

A post on the Linux mailing list considers its +1 tick insufficient to avoid Moire artifacts from such collection, and suggests an interval of 4.61 seconds instead.[9] This change is common among Android system kernels, although the exact expression used assumes an HZ of 100.[10]

Other system performance commands

Other commands for assessing system performance include:

  • uptime – the system reliability and load average
  • top – for an overall system view
  • vmstat – vmstat reports information about runnable or blocked processes, memory, paging, block I/O, traps, and CPU.
  • htop – interactive process viewer
  • dool (formerly dstat),[11] atop – helps correlate all existing resource data for processes, memory, paging, block I/O, traps, and CPU activity.
  • iftop – interactive network traffic viewer per interface
  • nethogs – interactive network traffic viewer per process
  • iotop – interactive I/O viewer[12]
  • iostat – for storage I/O statistics
  • netstat – for network statistics
  • mpstat – for CPU statistics
  • tload – load average graph for terminal
  • xload – load average graph for X
  • /proc/loadavg – text file containing load average

See also

References

  1. ^ "CPU load". Retrieved 4 October 2023.
  2. ^ "/proc". Linux Filesystem Hierarchy. Retrieved 4 October 2023.
  3. ^ "Miscellaneous kernel statistics in /proc/stat". Retrieved 4 October 2023.
  4. ^ "Linux Tech Support: What exactly is a load average?". 23 October 2008.
  5. ^ Walker, Ray (1 December 2006). "Examining Load Average". Linux Journal. Retrieved 13 March 2012.
  6. ^ See http://serverfault.com/a/524818/27813
  7. ^ Ferrari, Domenico; and Zhou, Songnian; "An Empirical Investigation of Load Indices For Load Balancing Applications", Proceedings of Performance '87, the 12th International Symposium on Computer Performance Modeling, Measurement, and Evaluation, North Holland Publishers, Amsterdam, the Netherlands, 1988, pp. 515–528
  8. ^ "How is load average calculated on FreeBSD?". Unix & Linux Stack Exchange.
  9. ^ Ripke, Klaus (2011). "Linux-Kernel Archive: LOAD_FREQ (4*HZ+61) avoids loadavg Moire". lkml.iu.edu. graph & patch
  10. ^ "Patch kernel with the 4.61s load thing · Issue #2109 · AOSC-Dev/aosc-os-abbs". GitHub.
  11. ^ Baker, Scott (28 September 2022). "dool - Python3 compatible clone of dstat". GitHub. Retrieved 22 November 2022. ...Dag Wieers ceased development of Dstat...
  12. ^ "Iotop(8) - Linux manual page".

Read other articles:

Artikel ini bukan mengenai bangsa Kazaki. Kazak қазақтар (kiri ke kanan) A. Qunanbayuli • Ablai Khan • Dinmukhamed Konayev A. Baitursynov • T. Aubakirov • Chokan Valikhanov • Alikhan Bokeikhanov • Mirjaqip DulatuliJumlah populasi16.000.000Daerah dengan populasi signifikan Kazakstan13.500.000[1] Tiongkok1.000.000[2] Uzbekistan800.000[3] Rusia647.000[4] Mongolia100.000[5] Turkmenistan20.000[6] ...

 

Divisi Gunung Waffen ke-13 dari SS Handschar (Kroasia ke-1)Aktif1943–1945Negara Jerman NaziAliansi Jerman Nazi Negara Merdeka KroasiaCabangWaffen-SSTipe unitGebirgsjäger (infanteri gunung)PeranOperasi Anti-PartisanJumlah personelDivisi (maksimum 17.000)Bagian dariKorps Gunung V SSKorps Gunung IX SSKorps Angkatan Darat LXVIIIJulukanHandscharMotoHandžaru udaraj! (Handschar – Serang!)Pertempuran Perang Dunia II di Yugoslavia: Operasi Wegweiser Operasi Save Operasi Osterei Op...

 

Seorang farmakoterapis di dalam laboratorium Universitas Semmelweis Farmakoterapi adalah sub ilmu dari farmakologi yang mempelajari tentang penanganan penyakit melalui penggunaan obat.[1] Dalam ilmu ini obat-obatan digunakan untuk membuat diagnosis, mencegah timbulnya, dan cara menyembuhkan suatu penyakit.[1] Selain itu, farmakoterapi juga mempelajari khasiat obat pada berbagai penyakit, bahaya yang dikandungnya, kontraindikasi obat, pemberian obat yang tepat.[1] Bagia...

Municipality in Catalonia, SpainEsponellàMunicipality FlagCoat of armsEsponellàLocation in CataloniaShow map of Province of GironaEsponellàEsponellà (Spain)Show map of SpainCoordinates: 42°11′N 2°48′E / 42.183°N 2.800°E / 42.183; 2.800Country SpainCommunity CataloniaProvince GironaComarcaPla de l'EstanyGovernment • MayorJoan Farres Porxas (2015)[1]Area[2] • Total16.1 km2 (6.2 sq mi)Popula...

 

العلاقات العمانية الموزمبيقية سلطنة عمان موزمبيق   سلطنة عمان   موزمبيق تعديل مصدري - تعديل   العلاقات العمانية الموزمبيقية هي العلاقات الثنائية التي تجمع بين سلطنة عمان وموزمبيق.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدول...

 

Pour un article plus général, voir Géographie de la Nouvelle-Calédonie. Photographie satellite de la Nouvelle-Calédonie. Le climat de Nouvelle-Calédonie est tropical, tempéré par l'influence océanique et influencé périodiquement par les phénomènes El Niño et La Niña, avec des vents dominants à l'est et au sud-est (les alizés). Il comprend des températures relativement chaudes (la moyenne des températures établie sur 12 mois pour la période 1952-1965 est d'environ 23...

ألفريد أمير بريطانيا العظمى معلومات شخصية الميلاد 22 سبتمبر 1780(1780-09-22)قصر بكنغهام، وندزر، بيركشاير الوفاة 20 أغسطس 1782 (1 سنة)قصر وندسور، لندن سبب الوفاة جدري  مكان الدفن كنيسة القديس جورج  مواطنة المملكة المتحدة  الأب جورج الثالث ملك المملكة المتحدة  الأم شارلوت من ...

 

British-Indian actor (1929–2015) Saeed JaffreyOBEBorn(1929-01-08)8 January 1929Malerkotla, Punjab, British India (present-day Punjab, India)Died15 November 2015(2015-11-15) (aged 86)London, England, United KingdomResting placeGunnersbury CemeteryCitizenshipBritishIndian (formerly)EducationUniversity of Allahabad (BA, MA) Catholic University of America (MFA)OccupationActorYears active1961–2011Spouses Madhur Jaffrey ​ ​(m. 1958; div. 1966)...

 

Green BayChicago and North Western Railroad stationGeneral informationLocation200 Dousman StreetGreen Bay, WisconsinPlatforms1 side platform, 1 island platformTracks2HistoryOpened1899Closed1971Services Preceding station Chicago and North Western Railway Following station Big Suamicotoward Ishpeming Ishpeming – MilwaukeeVia Fond du Lac Green Bay Junctiontoward Milwaukee Terminus Green Bay – Milwaukee via Sheboygan Anstontoward Ashland Ashland – Green Bay Terminus Anstonto...

Pour les articles homonymes, voir Zlatin. Miron ZlatinBiographieNaissance 21 septembre 1904OrchaDécès 31 juillet 1944 (à 39 ans)TallinnNationalité françaiseActivité RésistantConjoint Sabine ZlatinAutres informationsConflit Seconde Guerre mondialeLieu de détention Prison Patarei (en)modifier - modifier le code - modifier Wikidata Miron Zlatin, directeur[1] de la maison d’Izieu[2] dans l'Ain, juif de Russie né à Orcha en 1904, issu d'une famille aisée, est le mari de Sabine Z...

 

この記事は検証可能な参考文献や出典が全く示されていないか、不十分です。出典を追加して記事の信頼性向上にご協力ください。(このテンプレートの使い方)出典検索?: コルク – ニュース · 書籍 · スカラー · CiNii · J-STAGE · NDL · dlib.jp · ジャパンサーチ · TWL(2017年4月) コルクを打ち抜いて作った瓶の栓 コルク(木栓、�...

 

此條目可参照英語維基百科相應條目来扩充。 (2023年12月1日)若您熟悉来源语言和主题,请协助参考外语维基百科扩充条目。请勿直接提交机械翻译,也不要翻译不可靠、低品质内容。依版权协议,译文需在编辑摘要注明来源,或于讨论页顶部标记{{Translated page}}标签。 此條目需要补充更多来源。 (2021年4月4日)请协助補充多方面可靠来源以改善这篇条目,无法查证的内容可能�...

岸信介佐藤信介 日本第56、57任內閣總理大臣任期1957年2月25日—1960年7月19日君主昭和天皇副首相石井光次郎益谷秀次前任石橋湛山继任池田勇人 日本內閣總理大臣(臨時代理)任期1957年1月31日—1957年2月25日总理石橋湛山前任石橋湛山继任岸信介 日本防衛廳長官(臨時代理)任期1957年1月31日—1957年2月2日总理岸信介(代,兼)前任石橋湛山(代)继任小瀧彬(�...

 

Historic unit of length, basis of shoe sizes Not to be confused with the grain, a related unit. BarleycornThe barleycorn is based on the length of a barley grain.General informationUnit systemImperial unitsUnit ofLengthConversions 1 barleycorn in ...... is equal to ...    Imperial units   1/3 in   SI units   8.47 mm A chart of Imperial and United States customary units. The barleycorn is an English unit of length&...

 

1930 film Hell's AngelsTheatrical release posterDirected byHoward HughesJames Whale (dialogue)[1]Written byHarry BehnHoward EstabrookJoseph Moncure March (uncredited)Produced byHoward HughesStarringBen LyonJames HallJean HarlowCinematographyTony GaudioHarry PerryEdited byDouglass BiggsFrank LawrencePerry Hollingsworth (uncredited)Music byHugo RiesenfeldProductioncompanyThe Caddo Company (de)Distributed byUnited ArtistsRelease dates May 27, 1930 (1930-05-27) (Grauman...

La Supercoupe de l'UEFA 1999 est un match de football disputé le 27 août 1999 entre le vainqueur de la Ligue des champions de l'UEFA 1998-1999 et le vainqueur de la Coupe d'Europe des vainqueurs de coupe de football 1998-1999, que sont respectivement Manchester United et la Lazio Rome. La Lazio remporte la Supercoupe sur le score de 1-0, le but de la victoire étant inscrit par l'attaquant chilien Marcelo Salas durant la 35e minute. Le match s'est déroulé au Stade Louis-II de Monaco,...

 

Art museum in Marrakesh, MoroccoMarrakech MuseumMain courtyard of the Marrakech MuseumEstablished1997LocationMarrakesh, MoroccoCoordinates31°37′52″N 7°59′12″W / 31.6312°N 7.9868°W / 31.6312; -7.9868Typeart museumKey holdingsnumismatics, ceramicsCollectionsMoorish art The Museum of Marrakech is a historic palace and museum located in the old center of Marrakesh, Morocco. In addition to its notable architecture, the museum's collection showcases various histo...

 

American alternative rock band Dolly VardenBackground informationOriginChicago, ILGenresIndie, Alternative RockYears active1993–presentLabelsUndertow, Evil Teen, Flying Sparks, FargoMembersSteve Dawson, Diane Christiansen, Mark Balletto, Mike Bradburn, Matt ThobePast membersLisa Wertman CroweWebsitedollyvarden.com Dolly Varden is a Chicago band built around the singing and songwriting of husband and wife duo Steve Dawson and Diane Christiansen. Their music combines elements of folk, roc...

Indian politician Ranvendra Pratap SinghMinister of state in Food, Civil Supplies & Consumer AffairsGovernment of Uttar PradeshIn office21 August 2019 – 25 March 2022Chief MinisterYogi AdityanathMinister of state in AgricultureGovernment of Uttar PradeshIn office19 March 2017 – 21 August 2019Chief MinisterYogi AdityanathMinisterSurya Pratap ShahiMember of Uttar Pradesh Legislative AssemblyIn office2017–2022Preceded byMohammed AsifSucceeded byUsha MauryaConstituency...

 

National Football League rivalry Chargers–Raiders rivalry Los Angeles Chargers Las Vegas Raiders First meetingNovember 27, 1960Chargers 52, Raiders 28Latest meetingDecember 14, 2023Raiders 63, Chargers 21Next meetingSeptember 8, 2024StatisticsMeetings total129All-time seriesRaiders, 69–58–2Postseason resultsRaiders, 1–0 January 11, 1981:Raiders 34, Chargers 27Largest victoryChargers: 44–0 (1961);Raiders: 63–21 (2023)Longest win streakChargers, 13 (2003–09);Raiders: 10 (1972–77...