[爆卦]中斷interrupt是什麼?優點缺點精華區懶人包

雖然這篇中斷interrupt鄉民發文沒有被收入到精華區:在中斷interrupt這個話題中,我們另外找到其它相關的精選爆讚文章

在 中斷interrupt產品中有4篇Facebook貼文,粉絲數超過2,850的網紅矽谷牛的耕田筆記,也在其Facebook貼文中提到, 本文延續前篇效能校正的經驗談,上篇文章探討了關於系統呼叫, iptables 可以最佳化的部分,。本篇文章將繼續剩下最佳化步驟的探討。 Perfect Locality 預設情況下, Linux Kernel 會盡量平均地將請求給分配到所有的處理佇列,譬如 network queues, proc...

  • 中斷interrupt 在 矽谷牛的耕田筆記 Facebook 的最讚貼文

    2021-06-18 08:00:07
    有 48 人按讚

    本文延續前篇效能校正的經驗談,上篇文章探討了關於系統呼叫, iptables 可以最佳化的部分,。本篇文章將繼續剩下最佳化步驟的探討。

    Perfect Locality
    預設情況下, Linux Kernel 會盡量平均地將請求給分配到所有的處理佇列,譬如 network queues, processes, CPUS. 大部分情況下這種機制運作良好不會有太多問題,不過如果今天要追求的不單單只是好的效能,而是極致的效能,則 locality 這個概念就要特別的去注意。

    這篇文章中提到很多不同的方式,包含了 CPU Pinning, Receive Side Scaling(RSS), Transmit Packet Sterring(XPS)等,其實用比較簡單的介紹方式就是,希望可以使用固定的 CPU 來處理一條連線上的所有封包(進出),這樣帶來的好處有
    1. CPU Cache 可以盡可能的去使用,減少各種 miss 產生的成本
    2. 減少 context switch 帶來的成本
    3. 減少跨 CPU 之間交換資料帶來的成本
    4. 減少 lock 之間帶來的成本
    除了 CPU Pin, RSS, XPS 外,還有 irqbalance, smp_affinity_list 等相關的概念需要一併學習,對於這個概念有興趣的讀者非常歡迎去找尋這類型的資料

    接者是 SO_REUSEPORT 這個參數,創建 Socket 時使用這個參數能夠使得多個 Process 共用一個連接埠,底層 Kernel 會針對 src/dst{ip/port} 來產生對應的 Hash,並且決定當前封包要送給哪一個 Process。
    這個方式搭配前述各種 CPU Pin, 中斷的最佳化則會遇到問題,因為可能底層將該封包送到 CPU2 結果這個函式又把封包重新分配到 CPU0, 這樣就導致該連線要跨 CPU 處理了。
    為了解決這個問題, Linux Kernel 4.6 後有新的參數 SO_ATTACH_REUSEPORT_CBPF,使用者可以自行撰寫 BPF 的程式來決定如何分配封包。作者根據這過想法撰寫了一個 BPF 的程式,來確保這個機制可以與前述的最佳化穩定運作。

    這次的最佳化帶來的 38% 的成長,這時候的封包處理能力從 603k req/s 提升到 834k req/s
    原文中關於這次的最佳化還有一些後續探討,有興趣的可以閱讀

    Interrupt Optimizations

    當封包透過網路送到網卡後,網卡必須要通知 OS 讓它知道有封包來了,要記得處理。一切處理完畢後網卡就可以繼續等待新的封包過來並且再次發送中斷給 OS 處理封包。這個流程大部分情況也是運作良好,不過當有大量的封包不停傳送來時,頻繁的中斷其實也是會造成不小的額外成本。

    為了解決這個問題,目前比較嶄新的網卡都有支援中斷聚合等功能,透過這個功能可以延後中斷一個小週期,而該週期內收到的所有封包只需要透過一次的中斷就可以來處理,藉此降低中斷的次數。更為進階的網卡甚至支援動態自行調整該週期的時間,譬如當網路空閒時,減少週期使得每個封包能夠盡快的發送中斷被處理,而當網路流量很大時則會加大該該週期時間來更有效地處理封包。

    註: AWS ENA 有支持這種動態調整的機制

    作者基於 AWS 開啟動態調整收端中斷時間的功能,整個效能提升了 14%,從 834k req/s 提升到 955k req/s。作者說這次的調整可以說是整篇文章中幾個非常強的改動,改動的地方少,效能提升明顯,同時背後的隱憂與限制也少。

    除了上述中斷的方式外,另外一種則是透過 Busy Polling 這種針對低延遲性的方式。預設情況下其允訓設定為 blocked 的 socket 能夠消耗額外的 CPU Cycle 來讀取接下來的封包,可以將其想成一成一種混合體,當底層網卡告訴我有資料要讀取時,我預期接下來還會有更多的資料,因此我就透過輪詢的方式去多問幾個封包。

    由於作者的應用程式是使用 non-blocking 的方式去讀寫封包,所以預設的方式是沒有辦法使用的。而該應用程式又是使用 epoll 來進行底層封包的讀寫。 epoll 於 kenel 4.12 後正式支援 busy polling 的方式,所以這部分就沒有太大的問題。文章中有滿多關於 busy_poll 的一些參數調整。

    將這兩個機制給整合後,整體的效能提升達到 28%,從 834k req/s 到達 1060k req/s,同時 99%的 latency 也從 361μs 下降到 292μs.

    同時這兩個機制導入後,整個系統每秒產生的硬體中斷數量也從 183k 降到 16k。 Context switches 的數字也從 6k 下降到 1k 左右。

    下篇文章會繼續從剩下的三個最佳化策略繼續介紹

    https://talawah.io/blog/extreme-http-performance-tuning-one-point-two-million/

  • 中斷interrupt 在 謙預 Qianyu.sg Facebook 的最佳解答

    2021-05-18 22:59:33
    有 1,044 人按讚

    【我親愛的Zoom視訊客人們】
    To My Dear Zoom Clients

    我忍了真的⋯⋯真的⋯⋯很久,今天過後實在忍無可忍,一定要叮嚀所有過去和未來的客人們。

    我年紀很大了,受不了太大的刺激。

    拜託,你們可以Zoom好來嗎?😓😑

    一、Zoom視訊的視角 = 拍護照照的視角

    護照自2020年起就已成為古董,但大家這一生應該有拍過證件照吧!

    對了,就是要頭髮整齊,讓我看到你的雙耳、雙眼、鼻子、嘴巴、頸項和肩膀,到胸部。

    我批八字時,需要看整個面相。不要讓你一半的臉掉出鏡頭外,這樣很像鍾無艷,也不要嘴巴不見掉,這樣我很像在跟一條羅漢魚視訊。

    我看面相包括看你的嘴巴、牙齒和說話時的嘴形。是的,看相就是需要那麼仔細。

    如果你的螢幕太低,那就找書本或舊報紙,把螢幕墊高一點。別讓我整一個小時半只看到你的雙下巴,會把你的面相比例給看錯。

    不要一直告訴我不好意思,方法是人想出來的。



    二、光線

    太暗,我看你如見鬼。
    太亮,我會看不清你的膚色。
    拉開窗簾,不要背向陽光。
    有必要的話,就直接開燈!



    三、勿放什麼椰樹沙灘/金門大橋的虛擬背景圖

    什麼虛擬背景圖都不要放啦~

    我的家美最重要,我不在乎你的家美不美,我只是來看命的。

    如果你的Wi-Fi不是很強,電腦功能不是很厲害,這類的虛擬背景圖會讓你的視訊畫面卡卡的。

    有時你轉個身,整個右邊不見了,或部份的頭髮少了,讓我覺得我好像在看恐怖片,嚇人啊~



    四、環境和聲音

    有些海外客人其實非常用心。為了與我視訊,特別去買有麥克風的耳機🎧,讓我能更清楚的聽到他們的聲音。😍

    沒有使用耳機和麥克風的客人,往往他們的聲音會有種空氣般的回音,如果他們本身講話又小聲,我的耳機聲量開滿,我還是聽得滿辛苦的

    也有香港和馬來西亞客人租過會議室、鐘點房間或單人工作室,就是為了不受家人的干擾,能安心的與我視訊。😍

    最有趣的是,去年新加坡阻斷措施時,有位男客人跑到屋外的走廊坐在地上與我視訊。只是外頭風聲有點大,我好幾次都聽不清楚他的聲音。

    曾有客人在咖啡廳與我視訊。咖啡廳裡的高談闊論聲和器皿的敲擊聲,頻頻從我的耳機闖進我的耳朵,哇~我的耳朵那時真的是活受罪,還要裝一副氣定神閒的樣子。

    天啊,兩次過後,我寧願退錢,也不再見這樣的客人了。耳朵只有一對,我要保護好啊!

    在這裡聲明:一般我們買手機時的那種有麥克風的耳機,就已能視訊。沒有戴耳機和麥克風的客人,我一概會拒絕諮詢,把費用原銀奉還。

    五、孩子

    曾試過諮詢的前20分鐘,一直被女客人的小孩打擾,進來哭著要媽媽主持公道。

    如果你家中有六歲以下的兒童,會時不時來敲你的門,我建議你還是先別約我。你這樣會分心,無法聽好我交代的事,而我也得一直等你去安撫你的孩子,就無法在限定時間內看完你的八字,這樣對誰都不公平。

    六、我只見客人一人

    這個規矩,從我一出道就定下來,也清楚的寫在網站上,根本不用一而再的來試探水溫。

    但這兩個星期,還是有客人硬闖關,事先安排自己的配偶/孩子坐在電腦的另一面,要他們聽我講他的八字。

    我從不改我的規矩,也沒有八字或風水是我非看不可的。

    讀書這麼高,連自己的命都不能自己負責,這已經不是能改到命的人了。

    你一定要你的配偶陪你聽,那你需要的不是我來教你改命,是你的配偶來安你的心。

    將來若還有這樣的事,我會直接中斷視訊,把錢退回去。

    七、「我第一次用Zoom!」

    可是從報名那天到今天的諮詢,你有兩個月的時間去摸索。

    兩個月,怎麼還是錯誤百出?因為客人根本沒有事先準備和練習。

    結果我就這樣等了20分鐘,還得等對方下載軟件。

    Zoom不難使用,但如果是你沒有花時間去摸索,就不要撒謊,直接說,我就直接退現錢。

    品德是改命的資糧,不要為了自己能脫身就隨便編一個漏洞百出的謊,還說自己是好人。這...不會臉皮太厚了嗎?

    小事都不願做好,絕對不會成大器。

    八、暈車

    有些客人用Ipad或手機來視訊。

    重點是,他一支手拿著手機,一支手拿筆寫筆記。他一邊寫,另一支手就一邊搖晃。他做在床上,移動一下,手機就彷彿大海嘯幾下🌊

    我一天如果見三個這樣客人,我的視線就搖晃了5個小時。工作完畢後,頭也會痛得厲害,無法完成晚上製片的工作。

    沒有自拍器三腳架,也應該有些書本或東西來頂著手機。

    各位,多點善心,為我著想一下吧⋯⋯

    __________________________

    To My Dear Zoom Clients

    I have been enduring it for a really really long time. That's it! I am gonna put a stop to this after today and send out this reminder to all my past and future clients.

    I am getting on in years, and cannot stand too much stimulation.

    Please.... can you guys do a proper Zoom?

    Number 1: Going on screen in Zoom = Taking a photograph for your passport.

    Since 2020, the passport has become something of an antique but I believe everyone has taken some kind of ID photos! Yes, the ones with your neatly combed trusses where I can see both your ears, nose, mouth, neck, shoulder all the way to your chest.

    I would like to see your full face during the Bazi Consultation. Please don't allow half your face to fall off the screen and you end up looking like Zhong Wu Yan! Please also don't hide your mouth making me feel like I am talking to a Arrowana.

    When I analyze your facial features, it includes your mouth, teeth and the shape of your mouth while you are talking. Yes, it is down to such level of details.

    If your PC / Laptop monitor is too low, please find a book or old newspapers and stack it on top. Please don't let me only see your double chin for that 1.5 hours, as I would probably get the proportion of your face wrong.

    Don't keep telling me you are apologetic. Think of a way out.

    Number 2: The background lighting.

    Too dark, you risk looking like a ghost.

    Too bright, I cannot figure out your skin color.

    Draw open the curtains, but don't face your back to the sunlight.

    If necessary, just turn on the lights!

    Number 3: Background images of coconut trees on sandy beaches or the Golden Gate Bridge.

    There is no need to put on a virtual background. I only care about how my hone looks, I am not bothered by yours. I am only here to see your Bazi.

    If your WIFI signal or your PC / Laptop performance is poor, using the virtual background can often make your Zoom video choppy. Sometimes when you turn your body, one side of your body or some part of your hair will disappear. It's really like one of those spooky movies scaring the wits out of me.



    Number 4: Background environment and noise.

    Some of my overseas clients really put in effort for our Zoom sessions. They bought a headset with a mic so that I can hear them properly and vice versa.

    Those that did not use a earphone or a headset often sounded echo-ish, and if they spoke softly, I would have to turn on the volume on my side full throttle and still have a hard time trying to hear them.

    There are some clients from Hong Kong and Malaysia who would rent meeting rooms, hotel rooms or private work spaces by the hour so as to reduce any disturbance from others and better focus on the Zoom session with me.

    I recalled an interesting incident during the Circuit Breaker last year. A client from Singapore Zoom-ed with me along the corridor outside his house. Most of the time, I was hearing the howling of the winds rather than his voice.

    Some clients sat themselves in coffee places for our session. These places are often filled with loud chatters and the clanging of cups and plates, and my ears suffered terribly. Yet, I have to continue to be seen as composed and attentive.

    Goodness me, after 2 of such experiences, I decided that I rather refund these clients and never see them again. I have only 1 pair of ears and I want to protect them at all costs!

    A normal earpiece that comes with the purchase of a handphone is good enough for Zoom video calls. For clients who do not have a earpiece/headset and a mic, I would end the consultation and refund the monies.



    Number 5: Children

    There was once where a session with a female client was repeatedly disrupted by her kids, running in crying for their mother to settle their quarrels. If you have children below 6 years of age, and likely to interrupt our session, I suggest you don't book a consultation with me.

    You will be distracted, unable to focus on my advice and I have to wait for you to clear up the situation with your children, eating into the allowable time for me to complete the consultation. This is unfair to both you and me.



    Number 6: I only meet one person, that is the Client.

    I have set this requirement the day I stepped into this line of work, and it is clearly written in my booking form. There is no need to try your luck under any circumstances.

    But in the space of 2 weeks, there were some clients who rode their luck and got their spouse / child to sit on the other side of the screen to listen in on our consultation.

    I never change my stance, and there is no single client that I cannot afford to lose.

    If you insist to have your spouse sit in, it is apparent that you do not need me to help transform your destiny. Rather you really need your spouse to put your heart at ease.

    If such things happen the next time, I will end the session immediately and refund the fees.



    Number 7: "My first time using Zoom"

    But you have 2 full months to prepare before our actual consultation. You did not end up wasting time exploring the software and I wasted 20 mins waiting for you to download the software.

    Zoom is an easy software to use but if you did not spend the time to familiarize yourself with it, please quit the lies and tell me directly. I will refund the consultation fees on the spot.

    Our moral ethics serve as the foundation for our transformation. Stop weaving web of lies to get out of sticky situations, and still claim that you are a good person. Isn't this too thick-skinned?



    Number 8: Giddy spells

    Some clients use Ipad or their handphones for the Zoom session. Crucially, they hold the device with one hand, and take notes with the other. As they write, the other hand holding the phone becomes shaky. If he is doing that on his bed, his handphone would shake like a tsunami wave every time he changes his position.

    If I see 3 such clients within a day, it would be 5 hours of shaking visuals for me. That would mean a splitting headache at the end of my work day, and not being able to work on my videos at night.

    Even if you don't have a tripod stand, at least prop up the device with a book or something.

    Please everyone, please be kind and have mercy on me......

  • 中斷interrupt 在 CheckCheckCin Facebook 的精選貼文

    2021-05-05 18:29:34
    有 113 人按讚

    【尿失禁】一個很影響身心健康的症狀

    ⭐用護墊尿墊治標不治本
    ⭐不要怕尷尬趕快就醫吧
    #星期三CheckCheckMail

    產後漏尿要補氣
    新手媽媽:「3個月前順產,最近發現自己很容易漏尿,打噴嚏、咳嗽甚至快走幾步都會出現,經常要衝廁所很尷尬。」

    CheckCheckCin:生產過後,媽媽們除了忙着照顧寶寶,也要記得照料一下自己的身體,中醫理論認為產後漏尿與氣虛或腎陰虛有關,生產時身體耗損大量氣血,造成肺氣虛弱,以致膀胱失去控制小便的能力,除了小便頻密甚至失禁,還有面色蒼白、四肢乏力、胸悶氣短等伴隨症狀,需要補中益氣紓緩症狀。
    另外,媽媽可以多做凱格爾運動,以強化骨盆底肌肉力量,增強大小便控制能力。進行時臥着、坐着或站立均可:雙膝微微分開,會陰收縮5-10秒 (就如中斷小便的感覺一樣,有一種向內及向上收緊的感覺),然後放鬆10秒,重覆做20次,早晚進行。如果失禁情況嚴重或未有改善,要諮詢醫生治理。

    補氣暖腎茶療
    功效:補中益氣,紓緩因氣虛引致的氣短、心悸、尿頻等症狀。
    材料:北芪9克、太子參9克、 益智仁9克
    做法:材料洗淨,800毫升水及材料以武火煮至水滾後調文火煮30分鐘,把茶連渣倒進保溫瓶即可。此茶能反覆沖泡至味淡,建議一星期飲用2-3天,連續兩星期為一個療程。

    留言或按讚👍🏻支持一下我們吧!❤️ 歡迎 Follow 我們獲得更多養生資訊。
    Postpartum incontinence? Time to replenish qi

    “I delivered my baby three months ago, but recently I have been experiencing involuntary leakage of urine, especially when I sneeze, cough, or even brisk walk. I feel embarrassed whenever I need to rush to the washroom.”

    CheckCheckCin: Besides being busy taking care of babies, new mothers will have to take care of our health as well. According to Chinese Medicine theories, postpartum incontinence is associated with the deficiency of qi or deficiency of yin in the kidneys. When delivering a child, a mother would exhaust a great deal of qi and blood, causing weakness of the qi in the lungs and in turn reducing the mother’s ability to control her urine.

    Besides postpartum incontinence and frequent urination, other accompanying symptoms include pale face, weak limbs, chest tightness, and shortness of breath. In order to relieve these conditions, one would need to nourish qi.

    Mothers can also carry out Kegel exercises regularly to strengthen the pelvic floor muscles as it will strengthen their ability to control the bladder. One can perform these exercises when she is lying down, sitting, or standing. Widen the knees slightly and tighten the perineum for 5 – 10 seconds (just like how we interrupt the urine flow by tightening the internal muscles inwards and upwards). Then, relax for 10 seconds, and repeat the process 20 times. Do this every morning and evening. If postpartum incontinence persists, do consult doctors and seek medical treatment accordingly.

    Tea to replenish qi
    Effects: Replenishes vital energy and nourishes qi. Relieves qi deficiency related symptoms such as shortness in breath, heart palpitations, excessive urination problem.
    Ingredients: 6g astragalus root, 9g pseudostellaria heterophylla root, 9g sharpleaf galangal fruit
    Preparation: Rinse all ingredients. Combine all ingredients with 800ml of water and cook on high heat until boiling. Turn to low heat and simmer for 30 minutes. Pour all contents into a thermos and tea can be re-brewed until flavor weakens. For best results, drink consecutively for 2-3 days. Two weeks for a treatment.

    Comment below or like 👍🏻 this post to support us. ❤️ Follow us for more healthy living tips.

    #男 #女 #我疲憊 #氣虛

你可能也想看看

搜尋相關網站