in reply to Re: Re: Profiling a forking program
in thread Profiling a forking program

Ah, so I assume you want to profile your program to see how much time it spends waiting for a lock? One way you could have a go at this, given that your profiling tools only reliably work on one process, is to run two instances of your server, but accessing the same DBM file. Of course, this assumes the locking is done externally from the program (for example with a lock file instead of a semaphore in shared memory or some such beastie).

Assuming this is the case, than you run one instance of your server and put load on it until it starts to slow down. You then run another instance, on a different port presumably, and limit that one to one connection only (either by connecting only once or putting limitations in the forking code, heck, even by not forking at all). You can then reliably profile that server's execution. As long as you generate load on the other server instance, and hence generate contention for the lock, you should get a reliable answer from this as to whether your program spends most of its time waiting for the lock.

CU
Robartes-

  • Comment on Re: Re: Re: Profiling a forking program