Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Some trace file to track timings of a process Post 303029731 by saraperu on Thursday 31st of January 2019 09:32:23 AM
Old 01-31-2019
Some trace file to track timings of a process

I will initiate a process from Server1 and the flow is as follow

Code:
Server1 --> Web server --> Application server --> DB Server

Note all seperate unix servers.

Now I need to put a trace for that process to track the timings from each server.

Like the below trace should be there:

Code:
Server1(09:00:00) --> Web Server(09:00:03) --> Application Server (9:00:05) -->DB Server (9:00:59)
Server1(09:02:30) <-- Web Server(09:02:03) <-- Application Server (9:01:05) <-- DB Server (9:01:03)

With this I can understand in performance bottleneck layer.

Please help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Track Sftp process

Hi, I am using sftp in my bash script. I wanted to know whether if there is any way that we can track whether sftp has been successful or not.. Does sftp return any codes? Thanks in adv (9 Replies)
Discussion started by: borncrazy
9 Replies

2. Linux

how to trace iowait to a certain process

Hi all, Under top command you could see some iowait output. Is any way to locate which process(s) is causing the high percentage of iowait? 17:48:39 up 19 days, 18:54, 3 users, load average: 3.24, 3.14, 3.17 392 processes: 389 sleeping, 1 running, 2 zombie, 0 stopped CPU states: cpu user... (3 Replies)
Discussion started by: will_mike
3 Replies

3. AIX

Trace the process responsible for locking filesystem ?

Hi, Sometimes when I want to unmount some filesystem I get "The requested resource is busy." error. In such a case I try to find and kill process that uses that filesystem. I do that on random. Is there a right way to find whitch prosesses use filesystem resource at given time ? thanks... (1 Reply)
Discussion started by: vilius
1 Replies

4. Solaris

Help to trace process consuming more space

Hi all, We have a server having much processes running. It is very difficuilt to trace the exact consuming more memory. Howerver, it shows CPU usage in sequence but how memory? Tried working with TOP command. Please let me know if something not clear. Thanks, Deepak (5 Replies)
Discussion started by: naw_deepak
5 Replies

5. Shell Programming and Scripting

how to track a log file of one process and mail that logfile to a group?

Hi Friendz, I have 14 DB load scripts say 1,2,3....14. I want a script to call each script automatically, and after completion of every script, it needs to track the logfile and mail that log file to a group.and again it should run the next script in sequence 1,2,3...14 Please help me,need... (1 Reply)
Discussion started by: shirdi
1 Replies

6. UNIX for Advanced & Expert Users

How to trace an AIX Process?

Hello, I execute an application on my Unix AIX Server and that one crashes after reading some files. These files are very big (80 Mbytes), the application is a CVS Repository. I have found with a comparaison on a Solaris Server that there are system limitations on my AIX Server in the... (2 Replies)
Discussion started by: steiner
2 Replies

7. AIX

How to trace cpu/memory usage for a process

I don't know when the process will start and end, I need write a script to trace it's cpu/memory usage when it is runing. How to write this script? (2 Replies)
Discussion started by: rainbow_bean
2 Replies

8. Shell Programming and Scripting

Script to monitor a process and track status in a file

i have a scenario where i need a script that monitors a process "Monitor" based on process id... there can be any number of instances of this running... i start this across 4 servers in NFS. Now i need a file which has the process ids of the process that are currently in execution at any... (9 Replies)
Discussion started by: niteesh_!7
9 Replies

9. Linux

Trace an extinct process

Hi gurus, Just wanted to know if there is any way to trace the PID of a process that has already completed it's job and exited. My tomcat server was found in a hung state and we restarted it. Now we have found that someone has ran a kill -9 "pid" and wanted to know if it is the PID of tomcat.... (1 Reply)
Discussion started by: Hari_Ganesh
1 Replies

10. UNIX for Advanced & Expert Users

Trace Process performance Using PID

Hi, i want to track a process using its PID in SOLARIS. i have a code in C++ , which memory is increasing steeply increasing every 20 days, from the code i couldn't see any memory leak. is there any way in UNIX where with the help of PID i can trace the Process usage evry hour. ... (3 Replies)
Discussion started by: senkerth
3 Replies
Net::Server::PreFork(3) 				User Contributed Perl Documentation				   Net::Server::PreFork(3)

NAME
Net::Server::PreFork - Net::Server personality SYNOPSIS
use Net::Server::PreFork; @ISA = qw(Net::Server::PreFork); sub process_request { #...code... } __PACKAGE__->run(); DESCRIPTION
Please read the pod on Net::Server and Net::Server::PreForkSimple first. This module is a personality, or extension, or sub class, of the Net::Server::PreForkSimple class which is a sub class of Net::Server. See Net::Server::PreForkSimple. This personality binds to one or more ports and then forks "min_servers" child process. The server will make sure that at any given time there are "min_spare_servers" available to receive a client request, up to "max_servers". Each of these children will process up to "max_requests" client connections. This type is good for a heavily hit site, and should scale well for most applications. (Multi port accept is accomplished using flock to serialize the children). At this time, it does not appear that this module will pass tests on Win32 systems. Any ideas or patches for making the tests pass would be welcome. SAMPLE CODE
Please see the sample listed in Net::Server. COMMAND LINE ARGUMENTS
In addition to the command line arguments of the Net::Server base class and the Net::Server::PreForkSimple parent class, Net::Server::PreFork contains several other configurable parameters. You really should also see Net::Server::PreForkSimple. Key Value Default min_servers d+ 5 min_spare_servers d+ 2 max_spare_servers d+ 10 max_servers d+ 50 max_requests d+ 1000 serialize (flock|semaphore|pipe) undef # serialize defaults to flock on multi_port or on Solaris lock_file "filename" POSIX::tmpnam check_for_dead d+ 30 check_for_waiting d+ 10 max_dequeue d+ undef check_for_dequeue d+ undef child_communication 1 undef min_servers The minimum number of servers to keep running. min_spare_servers The minimum number of servers to have waiting for requests. Minimum and maximum numbers should not be set to close to each other or the server will fork and kill children too often. max_spare_servers The maximum number of servers to have waiting for requests. See min_spare_servers. max_servers The maximum number of child servers to start. This does not apply to dequeue processes. check_for_waiting Seconds to wait before checking to see if we can kill off some waiting servers. child_communication Enable child communication to parent via unix sockets. If set to true, will let children write to the socket contained in $self->{server}->{parent_sock}. The parent will be notified through child_is_talking_hook where the first argument is the socket to the child. The child's socket is stored in $self->{server}->{children}->{$child_pid}->{sock}. CONFIGURATION FILE
"Net::Server::PreFork" allows for the use of a configuration file to read in server parameters. The format of this conf file is simple key value pairs. Comments and white space are ignored. #-------------- file test.conf -------------- ### server information min_servers 20 max_servers 80 min_spare_servers 10 min_spare_servers 15 max_requests 1000 ### user and group to become user somebody group everybody ### logging ? log_file /var/log/server.log log_level 3 pid_file /tmp/server.pid ### access control allow .+.(net|com) allow domain.com deny a.+ ### background the process? background 1 ### ports to bind host 127.0.0.1 port localhost:20204 port 20205 ### reverse lookups ? # reverse_lookups on ### enable child communication ? # child_communication #-------------- file test.conf -------------- PROCESS FLOW
Process flow follows Net::Server until the loop phase. At this point "min_servers" are forked and wait for connections. When a child accepts a connection, finishs processing a client, or exits, it relays that information to the parent, which keeps track and makes sure there are enough children to fulfill "min_servers", "min_spare_servers", "max_spare_servers", and "max_servers". HOOKS
The PreFork server has the following hooks in addition to the hooks provided by PreForkSimple. See Net::Server::PreForkSimple. "$self->run_n_children_hook()" This hook occurs at the top of run_n_children which is called each time the server goes to start more child processes. This gives the parent to do a little of its own accountting (as desired). Idea for this hook came from James FitzGibbon. "$self->parent_read_hook()" This hook occurs any time that the parent reads information from the child. The line from the child is sent as an argument. "$self->child_is_talking_hook()" This hook occurs if child_communication is true and the child has written to $self->{server}->{parent_sock}. The first argument will be the open socket to the child. BUGS
Tests don't seem to work on Win32. Any ideas or patches would be welcome. TO DO
See Net::Server AUTHOR
Paul T. Seamons paul@seamons.com THANKS
See Net::Server SEE ALSO
Please see also Net::Server::Fork, Net::Server::INET, Net::Server::PreForkSimple, Net::Server::MultiType, Net::Server::Single Net::Server::SIG Net::Server::Daemonize Net::Server::Proto perl v5.12.1 2007-03-23 Net::Server::PreFork(3)
All times are GMT -4. The time now is 06:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy