Troubleshooting
This page covers common issues and their solutions.
Installation Issues
“No module named ‘iops_profiler’”
Problem: Python cannot find the iops_profiler module.
Solutions:
Verify the package is installed:
>> pip list | grep iopsCheck you’re using the correct Python environment:
>> which python >> which pip
In Jupyter, verify the kernel matches your environment:
import sys print(sys.executable)
Reinstall the package:
>> pip install --force-reinstall iops-profiler
Import Errors for Dependencies
Problem: Missing matplotlib, numpy, or other dependencies.
Solution:
>> pip install matplotlib numpy ipython psutil
If you still have issues, try reinstalling all dependencies:
>> pip install --upgrade iops-profiler[dev]
Extension Loading Issues
“%load_ext iops_profiler” Fails
Problem: Extension fails to load with an error.
Check the error message:
- “ModuleNotFoundError”
See installation issues above.
- “ImportError” mentioning psutil/matplotlib
Install the missing dependency:
>> pip install psutil matplotlib numpy- Other errors
Try restarting the kernel and reloading:
%load_ext iops_profiler
Runtime Issues
No I/O Operations Detected
Problem: The profiler shows 0 operations even though your code performs I/O.
Common causes:
Caching: The OS cached your operations. Solution:
# Close files properly with open('test.txt', 'w') as f: f.write('data') # File is automatically closed and flushed
Buffering: Python is buffering writes. Solution:
# Flush explicitly f = open('test.txt', 'w') f.write('data') f.flush() # Force write to disk f.close()
Too fast: Operations completed in < 1ms. Solution: Profile larger operations.
Wrong platform: Using Windows with very small operations. Solution: Test with larger files.
macOS-Specific Issues
Password Prompt Doesn’t Appear
Problem: No password dialog shows up on macOS.
Solutions:
Check System Preferences > Security & Privacy > Privacy > Accessibility
Ensure Terminal or Jupyter is allowed to control your computer
Try running the cell again - sometimes it takes a moment
Restart Jupyter and try again
If using JupyterLab, try classic Notebook
Permission Denied on macOS
Problem: Error about lacking permissions to run fs_usage.
Solutions:
Make sure you entered the correct password
Your account needs admin privileges to use fs_usage
Try running from Terminal instead of an IDE
“Operation not permitted” on macOS
Problem: fs_usage fails even with password.
Solutions:
Give Terminal/Jupyter “Full Disk Access” in System Preferences > Security & Privacy
Restart Terminal/Jupyter after granting access
Try with sudo in a terminal:
>> sudo fs_usage -w -f filesystem
Linux-Specific Issues
/proc/[pid]/io Not Available
Problem: Cannot read I/O stats from /proc.
Solutions:
Verify you’re on Linux 2.6.20+:
>> uname -rCheck /proc is mounted:
>> mount | grep procIn containers, ensure /proc is accessible
Permission Issues in Containers
Problem: Cannot access I/O statistics in Docker/Kubernetes.
Solutions:
Don’t use
--privilegedunless necessary; instead ensure /proc is mountedUse
--pid=hostto access host process information (use cautiously)Check container security policies
Windows-Specific Issues
Inaccurate Operation Counts
Problem: Operation counts seem wrong or zero.
Explanation: Windows aggregates I/O operations differently than Linux. This is expected behavior.
Solutions:
Focus on bytes read/written and throughput rather than operation counts
Use relative comparisons (strategy A vs B) rather than absolute numbers
For precise measurements, use Linux
Performance Issues
Profiling Takes Too Long
Problem: The %%iops cell runs much slower than without profiling.
Expected overhead: 1-5% in most cases.
If overhead is higher:
Histogram mode: Adds overhead. Try without
--histogramflagmacOS: Privilege elevation adds overhead. Expected behavior
Many small operations: Tracking overhead becomes significant
Histogram Issues
Histogram Not Generated
Problem: Using --histogram flag but no histogram appears.
Causes:
Platform: Histograms not supported on Windows
No operations: Your code didn’t perform measurable I/O
matplotlib missing: Install with
pip install matplotlib
Empty or Sparse Histograms
Problem: Histogram has very few bars or looks empty.
Solutions:
Perform more I/O operations with varied sizes:
%%iops --histogram import tempfile # Create multiple files of different sizes for i in range(10): with open(f'/tmp/test_{i}.txt', 'w') as f: f.write('x' * (1024 * (i + 1)))
Use operations that create diverse I/O patterns
Results Interpretation Issues
Unexpected Results
Problem: Results don’t match expectations.
Common causes:
OS Caching:
# First run - actual I/O %%iops with open('test.txt', 'r') as f: data = f.read() # Second run - might be cached! %%iops # May show 0 reads with open('test.txt', 'r') as f: data = f.read()
Buffering: Python/OS buffers hide true I/O patterns
Async I/O: Some libraries use async I/O that’s hard to measure
Inconsistent Results Between Runs
Problem: Same code gives different results each time.
This is normal! I/O performance varies based on:
System load
Cache state
Background processes
Disk state and fragmentation
Best practices:
Run multiple times and average results
Warm up the system with a practice run
Close other applications
Use relative comparisons
Very High IOPS Numbers
Problem: IOPS numbers seem unrealistically high.
Causes:
Cached operations: Data came from cache, not disk
Buffered writes: OS buffering operations
Fast storage: Modern SSDs can achieve 100k+ IOPS
Verify:
%%iops
import os
# Force sync to disk
f = open('test.txt', 'w')
f.write('data' * 10000)
f.flush()
os.fsync(f.fileno())
f.close()
Very Low or Zero Throughput
Problem: Throughput shows 0 or very low values.
Causes:
No actual bytes transferred (operations were metadata only)
Operations too fast to measure accurately
All operations were cached
Getting More Help
If none of these solutions work:
Check GitHub Issues: github.com/lincc-frameworks/iops-profiler/issues
Enable Debug Output: Add this to your notebook:
import logging logging.basicConfig(level=logging.DEBUG)
Gather Information: When reporting issues, include:
Python version:
python --versionOS and version:
uname -a(Linux/Mac) orver(Windows)Package version:
pip show iops-profilerFull error message and traceback
Minimal code to reproduce the issue
File an Issue: Create a new issue with the information above
Next Steps
Return to User Guide for usage instructions
Review Platform-Specific Notes for platform-specific information
Try the notebooks/index examples