ProHoster > Blog > Tsamaiso > Li-benchmarks tsa li-server tsa Linux: khetho ea lisebelisoa tse bulehileng
Li-benchmarks tsa li-server tsa Linux: khetho ea lisebelisoa tse bulehileng
Re ntse re tsoela pele ho bua ka lisebelisoa tsa ho lekola ts'ebetso ea CPU mochining oa Linux. Kajeno ho thepa: temci, uarch-bench, likwid, perf-tools le llvm-mca.
Sena ke sesebelisoa sa ho hakanya nako ea ho phethahatsa mananeo a mabeli. Ha e le hantle, e u lumella ho bapisa nako ea ts'ebetso ea lits'ebetso tse peli. Sengoli sa ts'ebeliso ena e ne e le moithuti ea tsoang Jeremane, Johannes Bechberger, ea e ntlafalitseng e le karolo ea thuto ea hae ea undergraduate ka 2016. Kajeno ke sesebelisoa ajoa ke e nang le laesense tlasa Laesense e Akaretsang ea Sechaba ea GNU.
Johannes o ne a batla ho etsa sesebelisoa se neng se tla mo lumella ho lekanya tšebetso ea tsamaiso ea k’homphieutha sebakeng se laoloang. Ka hona, e 'ngoe ea likarolo tse ka sehloohong tsa temci ke bokhoni ba ho theha tikoloho ea teko. Ka mohlala, ka: fetola li-setting tsa CPU frequency manager, tima hyper threading le li-cache tsa L1 le L2, tima mokhoa oa turbo ho li-processor tsa Intel, joalo-joalo. Temci e sebelisa lisebelisoa ho etsa benchmarking. nako, perf_stat и getrusage.
Sena ke seo utility e shebahalang ka sona tabeng ea pele:
# compare the run times of two programs, running them each 20 times
> temci short exec "sleep 0.1" "sleep 0.2" --runs 20
Benchmark 20 times [####################################] 100%
Report for single runs
sleep 0.1 ( 20 single benchmarks)
avg_mem_usage mean = 0.000, deviation = 0.0
avg_res_set mean = 0.000, deviation = 0.0
etime mean = 100.00000m, deviation = 0.00000%
max_res_set mean = 2.1800k, deviation = 3.86455%
stime mean = 0.000, deviation = 0.0
utime mean = 0.000, deviation = 0.0
sleep 0.2 ( 20 single benchmarks)
avg_mem_usage mean = 0.000, deviation = 0.0
avg_res_set mean = 0.000, deviation = 0.0
etime mean = 200.00000m, deviation = 0.00000%
max_res_set mean = 2.1968k, deviation = 3.82530%
stime mean = 0.000, deviation = 0.0
utime mean = 0.000, deviation = 0.0
Ho ipapisitsoe le liphetho tsa benchmarking, sistimi e hlahisa tlaleho e loketseng ka litšoantšo, litafole le kerafo, tse khethollang temci ho tsoa ho tharollo e tšoanang.
Har'a mefokolo ea temci, "bocha" ba eona bo hlahella. Ka lebaka la sena o ha se tsohle tse tshehetswang tlhophiso ea hardware le software. Mohlala, ho thata ho sebetsa ho macOS, 'me likarolo tse ling ha li fumanehe ho sistimi e thehiloeng ho ARM. Nakong e tlang, boemo bo ka fetoha, ha mongoli a ntse a ntšetsa pele morero, 'me palo ea linaleli ho GitHub e ntse e eketseha butle-butle - eseng khale haholo temci esita le. e tšohloa litlhalosong ho Litaba tsa Hacker.
Sesebelisoa sa ho lekola ts'ebetso ea mesebetsi ea boemo bo tlase ba CPU, e ntlafalitsoeng ke moenjiniere Travis Downs (Travis Downs). Haufinyane tjena o ntse a ngola blog Litaba tsa Ts'ebetso ho GitHub Pages, e buang ka lisebelisoa tsa benchmarking le lintho tse ling tse amanang le tsona. Ka kakaretso, benche ea uarch e sa tsoa qala ho tsebahala, empa e se e ntse e tloaelehile boletsoeng baahi ba Hacker News ka likhoele tsa thematic e le sesebelisoa sa ho etsa benchmarking.
Uarch-bench e u lumella ho lekola ts'ebetso ea memori, lebelo le ts'oanang la ho kenya data le mosebetsi oa ho hloekisa YMM e ngolisa. Hore na liphetho tsa benchmarking tse hlahisoang ke lenaneo li shebahala joang li ka fumanoa polokelong ea molao botlaaseng ba leqephe.
Ke habohlokoa ho hlokomela hore uarch-bench, joalo ka temci, likooa Ts'ebetso ea Intel Turbo Boost (e eketsa lebelo la oache ea processor ka tlas'a mojaro) e le hore liphetho tsa liteko li lumellane.
Hajoale, projeke e maemong a pele a nts'etsopele, kahoo benche ea uarch ha e na litokomane tse qaqileng, mme ts'ebetso ea eona e kanna ea ba le likokoana-hloko - mohlala, mathata a tsejoa ka ho qala ho Ryzen. Hape, ho tšehetsoa feela li-benchmarks tsa meralo ea x86. Sengoli se ts'episa ho eketsa ts'ebetso e eketsehileng nakong e tlang mme o u mema hore u kenele nts'etsopele.
Ena ke sete ea lisebelisoa tsa ho lekola tšebetso ea mechini ea Linux e nang le li-processor tsa Intel, AMD le ARMv8. E thehiloe tlas'a ts'ehetso ea Lekala la Federale la Thuto le Lipatlisiso la Jeremane ka 2017 mme ea lokolloa mohloling o bulehileng.
Har'a lisebelisoa tsa likwid, re ka totobatsa likwid-powermeter, e bonts'ang tlhahisoleseding e tsoang ho RAPL ngoliso mabapi le matla a sebelisoang ke tsamaiso, hammoho le likwid-setFrequencies, e leng se u lumellang ho laola maqhubu a processor. U ka bona lenane le felletseng fumana sebakeng sa polokelo.
Sesebelisoa se sebelisoa ke baenjiniere ba amehang lipatlisisong tsa HPC. Ka mohlala, ka likwid mesebetsi sehlopha sa litsebi tse tsoang Setsing sa Lik'homphieutha sa Libaka sa Univesithi ea Erlangen-Nuremberg (RRZE) Jeremane. O boetse o nka karolo ka mafolofolo ntlafatsong ea sehlopha sena sa lisebelisoa.
Sesebelisoa sena sa ho sekaseka ts'ebetso ea li-server tsa Linux tsebisoa Brendan Gregg. Ke e mong oa bahlahisi DTrace - moralo o matla oa ho batla ho lokisa lits'ebetso ka nako ea nnete.
perf-tools e ipapisitse le perf_events le ftrace kernel subsystems. Lisebelisoa tsa bona li u lumella ho sekaseka I/O latency (iosnoop), likhohlano tsa mohala oa sistimi (unccount, funcslower, funcgraph le functrace) le ho bokella lipalo-palo tsa "hits" ho cache ea faele (cachestat). Tabeng ea ho qetela, taelo e shebahala tjena:
Sechaba se sengata se thehile ho potoloha seletsa (hoo e ka bang linaleli tse likete tse 6 ho GitHub). 'Me ho na le lik'hamphani tse sebelisang ka mafolofolo lisebelisoa tsa perf, mohlala Netflix. Empa sesebelisoa se ntse se ntlafatsoa le ho fetoloa le ho feta (le hoja lintlafatso li sa tsoa lokolloa haufinyane tjena). Ka hona, liphoso li ka hlaha ts'ebetsong ea eona - mongoli o ngola hore ka linako tse ling lisebelisoa tsa perf li baka tšabo ea kernel.
Sesebelisoa se bolelang esale pele hore na ho tla hlokahala likhoutu tse kae tsa mochini oa lisebelisoa ho li-CPU tse fapaneng. Eena lekola Litaelo ka potoloho (CPI) le mojaro ho hardware eo kopo e itseng e e hlahisang.
llvm-mca e hlahisitsoe ka 2018 e le karolo ea morero LLVM, e ntseng e ntlafatsa tsamaiso ea bokahohle bakeng sa ho hlahloba, ho fetola le ho ntlafatsa mananeo. Hoa tsebahala hore bangoli ba llvm-mca ba bululetsoe ke tharollo ea ho sekaseka ts'ebetso ea software. IACA e tsoang ho Intel mme a batla ho theha mofuta o mong. Mme ho latela basebelisi, tlhahiso ea sesebelisoa (sebopeho le bongata ba bona) e hlile e tšoana le IACA - mohlala. e ka fumanoa mona. Leha ho le joalo, llvm-mca e amohela feela AT&T syntax, kahoo o tla tlameha ho sebelisa li-converter ho sebetsa le eona.
Seo re ngolang ka sona li-blogs le marang-rang a sechaba: