You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jerry Baker <je...@weirdness.com> on 2001/08/08 03:01:19 UTC

[PATCH] Mkae Apache Monitor Display Windows XP correctly

Index: ApacheMonitor.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/support/win32/ApacheMonitor.c,v
retrieving revision 1.2
diff -u -r1.2 ApacheMonitor.c
--- ApacheMonitor.c     2001/08/07 19:54:10     1.2
+++ ApacheMonitor.c     2001/08/08 00:58:33
@@ -212,7 +212,7 @@
             else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion ==
0)
                 strcpy(szVersion, "MS Windows 2000 ");
             else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion ==
1)
-                strcpy(szVersion, "Whistler ");
+                strcpy(szVersion, "MS Windows XP ");
             /* Test for product type.*/
 #ifdef VER_VORKSTATION_NT
             if (bOsVersionInfoEx)

Re: [PATCH] Mkae Apache Monitor Display Windows XP correctly

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Mladen Turk" <ml...@mail.inet.hr>
Sent: Thursday, August 09, 2001 5:18 AM

> Will Wrote;
> >
> > I will also hook in apr.lib (static, not dynamic) for
> > nothing more than table and pool create/destruct...
> >  Pools should make this app very memory-lite, since each iteratation can gain a
> > sub pool that is then destroyed cleanly (without the leaking resources).
> > Using a table or hash to track the installed/running services
> > (when there are many) will also be a nice improvement.
> 
> I disagree with that, if you only wish to use the apr for maintaining a
> service list. It a only a simple list so why using hash tables or something
> like that (brute force will beat any hash table for small number of items).
> I've created a static struct with 3 char pointers and a DWORD times 128 (for
> a reasonable number of services). I agree that when you are using only a 3
> services you have a overhead of 7296 bytes of static memory, but do you
> think that introducing apr would fit into that memory frame?
> Other thing is if you want to use the dynamic memory allocation for cases
> when there are more than 128(?????) services installed on one box, but still
> why using apr for that? Its only a simple linked list after all.

Then you don't follow the transactional power of pools :-)  Yes, the base list
(not a terribly huge structure) needs to stay in memory.  It even requires 256
byte buffers (gasp!) for each service identifier.  But that's not what worries
me much...

The actual querying should happen, not on heap (slow, hefty) but apr_palloc'ed
buffers.  When the enumeration is done (and after each enumerated service) we
dump the pool back into avail.  It should prove to be very lightweight, much
as httpd itself is :)

> >   TARGET:  500kb working set, or less!  Possible?  Don't know yet.
> 
> Simple WinMain eats around 300K.
> I'm also very sceptic about Task manager (if that's what are you using for a
> mem usage). For Example the previous program (winapi.c) in the attachment,
> report 848K of memory when compiled with VC and 856 with BCC. First time
> when the program is minimized it reports the 92K/100K of mem usage, and when
> restored again aroun 270K. (Very strange). Next time you minimize the window
> it reports 88/96K of mem usage.

I'll share your skepticizm, but that is more likely the resource consumption and
garbage collection that is sometimes less than optimal.  Plus, I'm not surprized,
startup code pages waste some space for a while, and should later be gc'ed out.


> I offer a patch that has a removed About box and tests the ImagePath
> Registry key for \apache, .exe, and --ntservice or -k runsevice. This gives
> you an option to have for an example a apachexxxxxxxxx.exe as a exe name.

I'll take it even a step further, and suggest httpd* would also be nice.  Maybe
something configurable?  Dunno.

Bill


RE: [PATCH] Mkae Apache Monitor Display Windows XP correctly

Posted by Mladen Turk <ml...@mail.inet.hr>.
> Guys...
>
>   with only 3 recognized apache services (more on that in a
> minute) ... it consumes
> a working set of 1.8 MB (!!!) we need to rip out a bit of this
> cruft.  K.I.S.S!

On my WIN2K box for 64 services it conumes 1.6MB

>   The about box is a waste (in most programs), but _especially_
> in a task bar
> application reporting the Windows OS (and all the dead-weight to
> go along with it.)
> A "What's This?" tooltip box is more than sufficient, no?  Only
> my touchpad has a real
> "About..." box, and it wastes no effort on reporting the Windows
> version :)

I agree that About box is not essentilal for program functionality, without
it the memory consumption is 100K lesser.

>   If they don't know which windows they are using, oh well.
>
>   I'll offer a patch Monday if nobody beats me to it.  (I'm
> following these
> discussions off-line).  I will also hook in apr.lib (static, not
> dynamic) for
> nothing more than table and pool create/destruct...
>   Pools should make this app very memory-lite, since each
> iteratation can gain a
> sub pool that is then destroyed cleanly (without the leaking resources).
> Using a table or hash to track the installed/running services
> (when there are
> many) will also be a nice improvement.

I disagree with that, if you only wish to use the apr for maintaining a
service list. It a only a simple list so why using hash tables or something
like that (brute force will beat any hash table for small number of items).
I've created a static struct with 3 char pointers and a DWORD times 128 (for
a reasonable number of services). I agree that when you are using only a 3
services you have a overhead of 7296 bytes of static memory, but do you
think that introducing apr would fit into that memory frame?
Other thing is if you want to use the dynamic memory allocation for cases
when there are more than 128(?????) services installed on one box, but still
why using apr for that? Its only a simple linked list after all.


>   TARGET:  500kb working set, or less!  Possible?  Don't know yet.

Simple WinMain eats around 300K.
I'm also very sceptic about Task manager (if that's what are you using for a
mem usage). For Example the previous program (winapi.c) in the attachment,
report 848K of memory when compiled with VC and 856 with BCC. First time
when the program is minimized it reports the 92K/100K of mem usage, and when
restored again aroun 270K. (Very strange). Next time you minimize the window
it reports 88/96K of mem usage.

> Bill
>
> [I've renamed each generation of Apache.exe by number, since all
> 7 versions I track are
> running on different ports.  Apache1.3.14.exe means more when I
> look at the process list
> than seeing 30 Apache's.  Of course, that breaks the association
> for the task bar app,
> as well.  I'll try working up some cute fix for this quandry next
> week, because I'd sure
> like to fold all 10 of my servers under this controller :)]

That is something that make sense.

I offer a patch that has a removed About box and tests the ImagePath
Registry key for \apache, .exe, and --ntservice or -k runsevice. This gives
you an option to have for an example a apachexxxxxxxxx.exe as a exe name.

P.S.
I'm not very familiar with a diff ( I've used a: diff -u xxx.xxx.old xxx.xxx
>>xxx.diff)


MT

Re: [PATCH] Mkae Apache Monitor Display Windows XP correctly

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Guys...

  with only 3 recognized apache services (more on that in a minute) ... it consumes
a working set of 1.8 MB (!!!) we need to rip out a bit of this cruft.  K.I.S.S!

  The about box is a waste (in most programs), but _especially_ in a task bar 
application reporting the Windows OS (and all the dead-weight to go along with it.)
A "What's This?" tooltip box is more than sufficient, no?  Only my touchpad has a real
"About..." box, and it wastes no effort on reporting the Windows version :)

  If they don't know which windows they are using, oh well.

  I'll offer a patch Monday if nobody beats me to it.  (I'm following these 
discussions off-line).  I will also hook in apr.lib (static, not dynamic) for
nothing more than table and pool create/destruct...

  Pools should make this app very memory-lite, since each iteratation can gain a
sub pool that is then destroyed cleanly (without the leaking resources).
Using a table or hash to track the installed/running services (when there are 
many) will also be a nice improvement.

  TARGET:  500kb working set, or less!  Possible?  Don't know yet.

Bill

[I've renamed each generation of Apache.exe by number, since all 7 versions I track are
running on different ports.  Apache1.3.14.exe means more when I look at the process list
than seeing 30 Apache's.  Of course, that breaks the association for the task bar app,
as well.  I'll try working up some cute fix for this quandry next week, because I'd sure
like to fold all 10 of my servers under this controller :)]

----- Original Message ----- 
From: "Jerry Baker" <je...@weirdness.com>
To: <ne...@apache.org>
Sent: Tuesday, August 07, 2001 8:01 PM
Subject: [PATCH] Mkae Apache Monitor Display Windows XP correctly


> Index: ApacheMonitor.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/support/win32/ApacheMonitor.c,v
> retrieving revision 1.2
> diff -u -r1.2 ApacheMonitor.c
> --- ApacheMonitor.c     2001/08/07 19:54:10     1.2
> +++ ApacheMonitor.c     2001/08/08 00:58:33
> @@ -212,7 +212,7 @@
>              else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion ==
> 0)
>                  strcpy(szVersion, "MS Windows 2000 ");
>              else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion ==
> 1)
> -                strcpy(szVersion, "Whistler ");
> +                strcpy(szVersion, "MS Windows XP ");
>              /* Test for product type.*/
>  #ifdef VER_VORKSTATION_NT
>              if (bOsVersionInfoEx)
>