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
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
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?
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...
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.
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.