Reputation: 4222
I have a master server, that crawls data on web, and do indexing. And after that it starts mirroring to all the mirror server.
For that I use rsync and rsh.
But before start updating in mirror server, it takes time. I want to find where that delay occurs.
My understanding
It might be takes time in reverse DNS Lookup.
My questions
EDITED
Tell me where can I add log to note the time consumed?
If my understanding and questions are not upto mark or relevant according to the task that I want, then please correct me, and give me better path, so that I can achieve my goal.
Thanks in advance. Looking for your kind response.
Edit No. 2
Basically I am analyzing the time consumed to determine the delay reason. Nothing to modufy the existing code.
My task is to analyze the code , and find the reason of delay. Thats it.
I think now all the things of my task is clear to you.
Upvotes: 0
Views: 172
Reputation: 5395
Before changing rsh, you may try using strace to see which system calls take longer.
strace -c will produce a list of system calls and % of time used by those calls. (should help with the second question also)
For the DNS look-up to be evident you can use ltrace:
example:
ltrace -c -o log.txt wget http://dkjflsdfjka/
Then log.txt will have something like:
root@host:~# head log.txt
% time seconds usecs/call calls function
------ ----------- ----------- --------- --------------------
74.27 0.130779 130779 1 getaddrinfo
6.63 0.011680 33 344 strlen
3.05 0.005371 35 152 free
2.98 0.005255 35 147 malloc
2.74 0.004830 38 127 fgets
then you can see ... the getaddrinfo call is taking most of the time
Upvotes: 1