Posts

Showing posts from November, 2021

Avoiding Slowness

Don't exaust resources find ways to free up  don't use in parallel unless have enough resources Don't repeat a slow action if result can be stored for faster access Avoid expensive actions if needed do once and store before using in loop keep only what is needed ex: last 5 users who logged on break out of loop when found what is needed

Monitoring Tools

  Most or all tools mentioned from Google Automation: Trouble Shooting & Debugging Coursera course. Resources include: CPU  top shows % cpu used;  system usage; Total should not be more than the # of cores time <call to script or pgm> the memory  memcached the disk IO topio the network connection iftop - monitors bandwidth the graphics card multiple ab -n <times> to get the average timing of <times> requests code profilers profilers are specific to each programming language. So we would use: gprof to analyze a C program c-Profile module to analyze a Python program.   pprofile3 for example: pprofile3 -f callgrind -o profile.out   < call to script or pgm> kcachegrind   a graphical interface for looking into pprofile 3 output files used to see  which functions are called by our program,  how many times each function was called and  how much time are programs spent on each of them. Where and what is the ...

Trouble Shooting & Debugging - Tools

 Initially tools mentioned in Google Automation: Trouble Shooting & Debugging Coursera course Useful Tools WEEK 2 Videos - review for tools! to get more info: tcpdump  and  Wireshark  can show us ongoing network connections, and help us analyze the traffic going over our cables ps, top, or free  can show us the number and types of resources used in the system.   strace  to look at the system calls made by a program, or  ltrace  to look at the library calls made by the software. Debuggers  (often programming language specific) let us  follow  the code line by line,  inspect  changes in variable assignments,  interrupt  the program when a specific condition is met,  and more . we can modify the code,  we can change it so that it provides more  logging  information. To check for  IO problems : iotop  similar to top that lets us see which processes are using the most i...

Trouble Shooting & Debugging - Terms & Steps

Notes and basics from Google Automation: Trouble Shooting & Debugging Coursera course Trouble shooting - fixing system Debugging - fixing program code Cache stores data in a form that's faster to access than its original form.   M emory leak -  when memory which is no longer needed is not getting released.  WEEK 2 Videos - review for terms and steps! Debugging Process figuring out the problem and its solution require some creativity.  We need to come up with new ideas of what could be failing, and ways to check for that.  And once we know what's failing, we need to imagine how to solve it.  To take it a step further, once we've solved a problem, we can start thinking about how to prevent it from happening again Steps to solve a problem Gather information super important resource to solve a problem is the reproduction case , which is a clear description of how and when the problem appears Finding the root cause most difficult step.  key: ...