Module 2 challenge: Performance Tuning in Python Scripts :Troubleshooting and Debugging Techniques (Google IT Automation with Python Professional Certificate) Answers 2025
1. Primary reason the backup script takes over 20 hours
❌ The script is network-bound
❌ The script is CPU-bound
❌ The script is memory-bound
✔️ The script is I/O-bound
2. Best description of rsync
❌ rsync is a networking monitoring tool
❌ rsync duplicates all files without checking for changes
✔️ rsync efficiently transfers/syncs files by comparing modification time and size
❌ rsync controls administrative user access
3. Purpose of psutil.disk_io_counters()
❌ Configure network interface parameters
❌ Monitor real-time network traffic
✔️ Retrieve disk I/O statistics
❌ Estimate file space usage
4. Compressing files improved script efficiency
❌ False
✔️ True
5. Performance metrics explored (select all that apply)
✔️ Monitoring network bandwidth
❌ Checking power consumption
❌ Analyzing GPU performance
✔️ Checking CPU usage
6. Meaning of psutil.cpu_percent() = 0.6
❌ CPU at 60%
❌ 0.6 cores available
✔️ CPU utilization is 0.6%, very low
❌ Function error
7. Purpose of Pool class in multiprocessing
❌ Create a single process per task
✔️ Manage a pool of worker processes
❌ Synchronize execution of processes
❌ Limit CPU usage
8. Module/method to execute rsync command in Python
❌ os module with system()
❌ rsync module with sync()
✔️ subprocess module with call()
❌ files module with copy()
9. Correct rsync command with verbose output
❌ rsync /home/user/docs /backup/docs -v
❌ rsync -v /backup/docs /home/user/docs
✔️ rsync -v /home/user/docs /backup/docs
❌ rsync /backup/docs /home/user/docs
10. Does multisync.py backup sequentially?
✔️ True
❌ False
📌 Summary Table
| Q# | Correct Answer(s) |
|---|---|
| 1 | I/O-bound ✔️ |
| 2 | Efficient transfer by comparing time/size ✔️ |
| 3 | Retrieve disk I/O statistics ✔️ |
| 4 | True ✔️ |
| 5 | Network bandwidth ✔️, CPU usage ✔️ |
| 6 | CPU utilization 0.6% ✔️ |
| 7 | Manage pool of worker processes ✔️ |
| 8 | subprocess.call() ✔️ |
| 9 | rsync -v /home/user/docs /backup/docs ✔️ |
| 10 | True ✔️ |