1

I've got a Python process that is running as a daemon, using daemon runner, in the background. Its purpose is to query for some information from another computer on the network every 15 minutes, do some processing, and then send it somewhere else for logging. However, every so often, the processing bit takes much longer and the CPU usage for the process spikes for an extended period of time. Is there any way to figure out what might be happening during that time? I do have the daemon source.

Surreal Dreams
  • 26,055
  • 3
  • 46
  • 61
mp94
  • 1,209
  • 3
  • 11
  • 23

1 Answers1

0

The best thing to do is instrument the daemon with logging statements (using either the logging module or print statements with timestamps), and redirect the output to a log file. Then you can watch the logfile (perhaps using multitail) and note the output when you see the CPU spike.

David Eyk
  • 12,171
  • 11
  • 63
  • 103