473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How can we maintain the counters for each process of apache without using getmypid()

Suppose I have a php script. Now i am benchmarking that script using apache benchmark tool. Let us say with the command. ab -n 10 -c 4 filename.php Many different apache processes will be created so as to fulfill the requests.

Suppose total 4 processes are created to fulfill this request. Now, Let us say that the processes have ids p1,p2,p3,p4 and requests are r1,r2,.....r10.

As an example assume how requests are completed.

p1 p2 p3 p4 r1 r2 r3 r4

Suppose r2 got completed. So, r5 assigned to p2.

p1 p2 p3 p4 r1 r5 r3 r4

Suppose r4 got completed. So, r6 assigned to p4.

p1 p2 p3 p4 r1 r5 r3 r6

Suppose r3 got completed. So, r7 assigned to p3.

p1 p2 p3 p4 r1 r5 r7 r6

Suppose r1 got completed. So, r8 assigned to p1.

p1 p2 p3 p4 r8 r5 r7 r6

Suppose r7 got completed. So, r9 assigned to p3.

p1 p2 p3 p4 r8 r5 r9 r6

Suppose r5 got completed. So, r10 assigned to p2.

p1 p2 p3 p4 r8 r10 r9 r6

Now, at some point r6,r9,r8,10 also got completed.

Now we can see that which process has completed which requests.

process p1 p2 p3 p4 requests r1,r8 r2,r5,r10 r3,r7,r9 r4,r6 counter 2 3 3 2

p1,p2,p3,p4 exists the pids of the process. Also, the counter that which process has fulfilled which request exists. Now, in php i can get the pid of which process has called it by getmypid() function and maintain a counter to store how many requests are fulfilled by the process. So, i can know for all the requests fulfilled.

Please provide me some good way where i can get the same knowledge but without relying on the getmypid function.

Thanks a lot.
Feb 5 '13 #1
1 1902
Luuk
1,047 Expert 1GB
I dont know if its a good way,
But you can add '%P' to your LogFormat
see: http://httpd.apache.org/docs/2.0/mod...og_config.html

The information about pids will be added to your logfile, and can be counted....
Feb 9 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: TJ | last post by:
Anyone know how to display process id's (normally found by going to Component Services and switching to applications to 'Status View') in a web page? I'm trying to keep remote users from having...
2
by: Ralph Snart | last post by:
Is there a way to alternate table row colors without using the position() mod 2 trick? I'm in a series of nested xsl:for-each elements, about 3 deep, and I want to alternate the table row color...
5
by: reddy | last post by:
I am trying to insert a node into an XMLFile. using XMLTextwriter. My Question is Is it possible to do without using XMLDocument. Because its loading all the the file into memory. I just want to...
2
by: raymond | last post by:
Hi, Is it possible to create a proxy client class or a web service method by VS.NET without using wsdl? My stupid client is using a xml schema (.xsd) to describe all their web service methods...
3
by: Gregor Wind | last post by:
Hello all, for my image processing application I need a large amount of virtual memory. I read, that it is normaly possible to get 2GB of virtual memory for each process and when you modify the...
6
by: eBob.com | last post by:
How do you make a loop iterate early without using a GoTo? (I guess I've done too much structured programming and I really don't like using GoTos.) Here's my code ... For Each Thing As OFI...
11
by: ulyses | last post by:
Let's assume I have following file: 2938929384902491233..... 923949919199191919112.... File contains INTs only. What is more they are huge. For example first row in file may contain integer...
3
by: Marcel Brekelmans | last post by:
Hi, I was wondering if it's possible to install/uninstall a service from code without using the InstalUtil.exe tool with the /i and /u flags. As far as I can Google everyone is doing it that...
30
by: ceeques | last post by:
Hi I am a novice in C. Could you guys help me solve this problem - I need to convert integer(and /short) to string without using sprintf (I dont have standard libray stdio.h). for...
9
by: Pygmalion | last post by:
I have found dozen of useful PHP counters on the web. However, nobody is working for my web pages, since administrator does not want to enable the possibility that PHP could be called from HTML. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.