launcher
launcher copied to clipboard
Too many idle wakeups
This is knowledge and working notes around launcher performance, and energy efficiency. It has been observed that the Activity Monitor launcher process will invariably demonstrate excessive Idle Wake Ups anywhere between 500 and 15000 per second.
Timers/Tickers
Inefficiencies:
launcher has ~1 dozen repeating timers/tickers used to do things like:
- Monitor the desktop process(es)
- Fetch control server data
- Cleanup/purge tasks
- Log writing
- Check for launcher/osquery auto-updates
- Backoff/retry logic
- Health checks
Remediation:
- Create energy efficient ticker for all scheduled tasks with interval > one minute.
- Consolidate frequent tickers to a central ticker and/or use OS APIs to provide tolerances in timers, so that they can be executed at the same time as other timers.
Osquery-Go
The code around the Thrift server can be improved
- Avoid unnecessary
os.Statcalls - Use an event based API to avoid polling