How CPU Efficient is your App?
Vložit
- čas přidán 19. 05. 2024
- Identifying whether an application is CPU or IO bound is important for scaling, we explore this using the top command in Linux in this video.
0:00 Intro
2:30 us sy wa id
10:00 CPU Bound
12:20 Pressure Stall Information
14:45 IO Disk Bound
Discovering Backend Bottlenecks: Unlocking Peak Performance
performance.husseinnasser.com
Fundamentals of Backend Engineering Design patterns udemy course (link redirects to udemy with coupon)
backend.husseinnasser.com
Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)
network.husseinnasser.com
Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
database.husseinnasser.com
Follow me on Medium
/ membership
Introduction to NGINX (link redirects to udemy with coupon)
nginx.husseinnasser.com
Python on the Backend (link redirects to udemy with coupon)
python.husseinnasser.com
Become a Member on CZcams
/ @hnasr
Buy me a coffee if you liked this
www.buymeacoffee.com/hnasr
Arabic Software Engineering Channel
/ @husseinnasser
🔥 Members Only Content
• Members-only videos
🏭 Backend Engineering Videos in Order
backend.husseinnasser.com
💾 Database Engineering Videos
• Database Engineering
🎙️Listen to the Backend Engineering Podcast
husseinnasser.com/podcast
Gears and tools used on the Channel (affiliates)
🖼️ Slides and Thumbnail Design
Canva
partner.canva.com/c/2766475/6...
Stay Awesome,
Hussein - Věda a technologie
Fundamentals of Operating Systems course oscourse.win
Explained beautifully and technically.. hats off to you Hussein
Thank you Hussein for sharing this valuable information
Thanks!
Oh my god. What I've been looking for recently! 😮
This is amazing... I think even databases like Oracle and Spark track this very well for optimization!
This also applies to mobile apps, battery drain isn’t looked after in most apps. In my experience JS based mobile apps like cordova, ionic, RN suck battery at crazy rates if not done correctly
even if done correctly 😂
Great explanation !! Thanks Hussein.
One question - As you mentioned "wa" being higher can indicate CPU waiting on disk IO. Is there a similar metric in top or any other standard linux command which can indicate CPU waiting on network?
Brilliant !
IO bound vs CPU Bound? considering socket creation & all things that go into making a round trip n/w call like e.g. serialization, copying data from disk to some share mem pool, then to the NIC pool etc...
Thanks 👍🏼
I have to optimize one of our application page which currently use 100% of CPU when only 200 users are on it at the same time. Never done it before 😅 great opportunity to learn about CPU optimizations
Real world apps usually are never starving CPU unless they are computational intensive.
A lot of data processing software will wait for IO, and as IO speeds up, so do the lower level caches and CPUs that essentially eliminate this scenario.
If you're churning numbers like in opencl or in image processing pipeline, you're likely to be CPU bound.
Ideally there's no way to squeeze out 100% cpu in most apps except the compute ones as you will always be waiting for IO, and the system can't do anything about it as whole process is serial operation.
The closest you get is having an event loop with parallel processing, but implementations are not always ideal for the task. For speeding up compute you will always make compromises with fetching and retiring data which has it's own complexities. With this case, you're better off with spawning lightweight processes and have architectural benefits of higher level stack rather than doing it at a lower level. Again it always depends on context and contexts are not always simple that's why OS scheduler makes sure it uses miltiple strategies and code paths to schedule threads so none gets starved including the one running this scheduler ( even in single core system )
How can I check wa metric on mac ? The top command over there does not give all details.Checked activity monitor , it simply shows high CPU load when i do I/O intensive task.
❤❤❤❤
My Backend course backend.win
Hehe. Dot win are cheap. Hey. Could you do a review to members about their website or infraestructure? I want somebody with knowldage to tell me what i fucked up in my first website.
Hello bro I am from Pakistan. I am starting new tech career like development I choose to domain iOS and backend which one is good .
Whatever interests you the most. For me it’s backend.
for iOS you need a mac computer with 16 GB ram and 500+ GB storage, I would choose web and backend
Stay with backend, more jobs.
you may aswell just be an AI you just regurgitate information