ဒီ article မှာတော့ linux system တစ်ခုရဲ့ performance ကို ဘယ်လိုမျိုး optimize လုပ်လို့ရမလဲ ဘယ် tool ကို အသုံးပြုပြီး optimize လုပ်မလဲဆိုတာ ပြောပြသွားမှာဖြစ်ပါတယ်။
Why do we need performance tuning?
System တစ်ခုကို performance optimize ဘာလို့ လုပ်ဖို့လိုတာလဲ ဆိုတော့ နားလည်သလို ပြောရရင် system တစ်ခု running ဖြစ်နေဖို့အတွက် components တွေကတော့ သူ့အပိုင်းနဲ့ သူ လိုအပ်ကြပါတယ်။ အဲ့ထဲမှာမှ ဒီ system ကိုအသုံးပြုရခြင်းရဲ့ အဓိက ရည်ရွယ်ချက်ကို aware ဖြစ်ဖို့ လိုအပ်ပါတယ်။ ဥပမာ ဒီ system သည် application purpose အတွက်လား ဒါမဟုတ် database purpose အနေနဲ့ အသုံးပြုဖို့လား ဒါမဟုတ် network services (dns,dhcp,ftp,nfs,etc..) တွေ သုံးဖို့လား စသည်ဖြင့် ရည်ရွယ်ချက်ကို သိထားဖို့ လိုအပ်ပါတယ်။ ဒီ purpose ကို သိပြီဆိုရင် အကယ်၍များ ကိုယ်အသုံးပြုလိုတဲ့ services တွေက system မှာ performance ကောင်းကောင်း မလုပ်နိုင်ဘူး performance ကျနေတယ်ဆိုရင် ကျွန်တော်တို့ system ကို optimize လုပ်ပေးဖို့ လိုအပ်တယ်လို့ ယူဆ နိုင်ပါတယ်။
What is tuned?
ဆိုတော့ ဒီ system တစ်ခုကို performance optimization ကို ပြုလုပ်ဖို့အတွက် tuned service ကို အသုံးပြုနိုင်ပါတယ်။ ဒီ tuned service မှာ pre-defined လုပ်ထားတဲ့ default profile တွေလဲ ပါ၀င်ပါတယ်။ Tuned ရဲ့ profiles တွေကို ကိုယ့် system နဲ့ သက်ဆိုင်တဲ့ performance optimization အတွက် အသုံးပြုရမှာဖြစ်ပါတယ်။
RHEL မှာတော့ performance tuning အတွက် သီးသန့် specialist exam တစ်ခုရှိပြီး အခု ဒီ tuned အသုံးပြုပုံထက် ပိုပြီး advance topic တွေပါ၀င်တယ်။ အခု tuned article ကတော့ RHCSA8 ရဲ့ exam objective တစ်ခု အနေနဲ့ ပါ၀င်လာတာဖြစ်ပါတယ်။
Types of Tuned
Tuned service မှာ static and dynamic tuning type နှစ်မျိုး ရှိပါတယ်။ Static ဆိုတာကတော့ ဒီ profile တစ်ခု ကို အသုံးပြုထားရင် ဒီ profile မှာ သတ်မှတ်ထားတဲ့ optimization တွေကိုပဲ system အပေါ်မှာ သက်ရောက်နေမှာဖြစ်ပြီး dynamic tuning ကကျတော့ system တစ်ခုလုံးရဲ့ အခြေအနေကို monitor လုပ်ပြီး အလိုက်သင့် performance optimization လုပ်ပေးနေမှာဖြစ်ပါတယ်။ Default အားဖြင့် dynamic tuning က disable ဖြစ်နေပြီး /etc/tuned/main.conf file မှာ 'dynamic_tuning' value ကို '1' ပြင်လိုက်ရင် enable ဖြစ်ပါတယ်။
Let's get started!!!
1. Install tuned Package and start the tuned service
အရင်ဆုံး tuned package ကို install လုပ်မယ် service start and enable လုပ်ထားမယ်။
2. Using tuned-adm command
tuned service install လုပ်ပြီးပြီ ဆိုရင် အသုံးပြုဖို့ရန် အတွက်က 'tuned-adm' command ကို အသုံးပြုပါတယ်။ အရင်ဆုံး tuned-adm ရဲ့ help မှာ tuned-adm ကို အသုံးပြုပြီး ဘာတွေလုပ် လုပ်မနိုင်မလဲ ဆိုတာ ပြောပြထားပေးတယ်။
3. tuned-adm list
tuned-adm list command ကို အသုံးပြုလိုက်ရင် အပေါ်မှာ ပြောခဲ့တဲ့ tuned ရဲ့ pre-defined profile တွေ ကို ပြပေးမှာဖြစ်ပါတယ်။ Profiles တွေကို tuned မှာ အဓိက component ဖြစ်ပါတယ်။ ဒီ profile တွေကို အသုံးပြုပြီး system optimize လုပ်တာဖြစ်ပါတယ်။
4. tuned-adm active & tuned-adm recommend
လက်ရှိ system သည် ဘယ် profile ကို အသုံးပြုနေလဲ ဘယ် profle က အသုံးပြုဖို့ recommend ဖြစ်လဲဆိုတာကို သိချင်ရင် tuned-adm active and recommand command ကို အသုံးပြုပြီး ကြည့်နိုင်ပါတယ်။ လက်ရှိအသုံးပြုနေတာသည် virtual-guest profile ဖြစ်ပြီး recommend ပေးထားတာသည်လဲ virtual-guest ပဲဖြစ်ပါတယ်။
5. Let's trying using different profile
အိုကေ ဒါဆို tuned-adm ကို အသုံးပြုပြီး different profile တစ်ခု change ကြည့်မယ်။ ဥပမာ ဒီ system က database purpose အတွက် အသုံးပြုထားတယ်ဆိုရင် disk and network io performance တွေ ကောင်းဖို့အတွက် "throughput-performance" profile ကို ပြောင်းကြည့်ကျမယ်။ အောက်ပုံမှာဆိုရင် profile ချိန်း ဖို့အတွက် 'tuned-adm profile <profile-name>' ကို အသုံးပြုထားတာဖြစ်ပါတယ်။ tune-adm active ဖြင့် ကြည့်တဲ့အခါ လက်ရှိ ပြောင်းထားတဲ့ profile ကို ပြပေးမှာဖြစ်ပါတယ်။
6. Combining two profile with tuned
Profile ကို တစ်ခုထဲ မဟုတ်ပဲ profile နှစ်မျိုး ကို ပေါင်းပြီးတော့လဲ အသုံးပြုနိုင်ပါတယ်။ ဒါပေမယ့် အသုံးပြုတဲ့ profile နှစ်ခု က reasonable တော့ ဖြစ်ဖို့လိုပါတယ်။ ဥပမာ HPC (high performance computing) လိုမျိုး utilization မြင့်တဲ့ profile နဲ့ powersave profile ကို သွားတွဲထားလို့ အဆင်မပြေသလိုပေါ့။ အောက်ပုံမှာ"desktop" and "powersave" profile နှစ်ခု ကို merge လုပ်ပြီး အသုံးပြု ထားပါတယ်။
7. Disable the tuned service
tuned service ကို အသုံးမပြုချင်ဘူးဆိုရင်တော့ tuned-adm off command ဖြင့် disable ပြုလုပ်ထားလိုက်လို့ရပါတယ်။
8. Where are the location of tuned profiles
tuned ရဲ့ pre-defined profiles တွေကို '/usr/lib/tuned' directory အောက်မှာ သိမ်းထားပြီး profile တစ်ခုချင်းစီ မှာ tuned.conf ဆိုတဲ့ config file တစ်ခုပါရှိတယ်။ Customize profile တွေအသုံးပြုချင်ရင်တော့ /etc/tuned directory အောက်မှာ ထားပြီး အသုံးပြုနိုင်ပါတယ်။
That's it 😊
Pls Like and Subscribe Our Root Of Info FB Page and Youtube Channel
https://www.facebook.com/rootofinfo
https://www.youtube.com/channel/UCkOi7WxhUBKONv3uD0CvuWw?view_as=subscriber
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.