Eli Marmor wrote:
Johann Bertscheit wrote:

> I analyzed the difference in speed - and I found the reason:
> for debugging purposes I set the SSLLogLevel to "debug" on WIN32 but not on cygwin.
> When I set the SSLLogLevel back to "info" then the speed difference is gone.

Wow...
I wouldn't imagine that such a flag may cause a so big hit to the
performance...
Once, I thought of writing a monitoring tool for Apache to analyze
bottlenecks (contrary to profile, not only CPU bottlenecks, but
also I/O). I already wrote such a tool for other applications, and
it worked great, and it could find the problem with logging
immediately. However, I don't have any idea how to implement it in
a multithreading environment, such as the WIN32 port of Apache.

> The problem occurs when a switch of VirtualHosts occur!
> I have 2 VirtualHosts configured in my httpd.conf.
> - one on port 443
> - another on port 5443
> (- and the normal port 80)
> Also I checked the dependency with SSLLogLevel, because I noticed that the SSL-logfile
> is garbled prior(!) the crash - It seems to be that 2 processes write in the logfile without sync!
> But even if I set SSLLogLevel to "warn" the crash occurs!
> To reproduce the problem it seems you need two requests to a semi-complex html-page
> (I have a frameset with 3 frames and with approx. 20 images)
> first from  http://host:443/page.html
> then from http://host:5443/page.html
> try it several times (maybe also with different pages) and the crash occurs!
> ...
> I use winnt 4.0.
>
> The following crash occurs while serving 'https://...' pages
> (e.g. frameset with 3 frames and with approx. 20 images)
>
> The crash is not always reproduceable but occurs again and again.

It looks exactly as a multithreading conflict.

Do you tried to reproduce my problem?
Do you have have a running WIN32-apache on WINNT with several virtual hosts and no problems when you have a switching access to the virtual hosts ?
(I have the problem with Apache_1.3.9-mod_ssl_2.4.9-openssl_0.9.4-WIN32-i386.rar)
But I would expect a multi-threading problem to affect any compiler,
so I'm not sure if this is the problem here too.
I think the cygwin apache is not multi threaded, because it starts e.g. 10 seperate httpd processes and has no  "ThreadsPerChild" directive in its httpd.conf -
so that would be one argument to the fact that the cygwin apache works and the WIN32 not.
To check it, you may try to set "ThreadsPerChild" to 1; It will slow
your performance VERY heavily, so it will require you to spend about
100 times the average time needed to crash your Apache before, i.e.
if Apache crashed once per a minute with the old configuration, with
"ThreadsPerChild" set to 1, you will need a hour or two in order to
be *100%* sure that the problem is over.
I tried it and it works!!! I tried the below test 100 times and no crashes any more!
The problem is gone with ThreadsPerChild 1.

The problem is there with ThreadsPerChild 50 - and is 100% reproduceable with
two browser windows:
- in one you have eg. https://host:443/test.html (with many images in it)
- in the other you have e.g. https://host:5443/test.html (same as above)
If you press reload in both windows (very fast: the second reload while the other window is still loading the images) the crash is almost 100% certain!
 

If it is, we can look for a
problem with lockings or static memory areas, conflicting with each
other. If it is not, then the problem is probably with the compiler.
I include my httpd.conf - so you can reproduce the problem more easily.
It is still hard to imagine that there is a so critical bug in MSVC,
so I think about another option: You wrote that you inserted various
modifications into the sources;
I made NO changes to the binary  Apache_1.3.9-mod_ssl_2.4.9-openssl_0.9.4-WIN32-i386.rar.
I made changes to thi cygwin apache - but these changes are purely syntactical (some defines are missing in compiling openssl, one function in mod_proxy is not there etc...)
Is it possible that one of them
resolved a multithreading/locking problem?
No.
But as sayed above I think the cygwin apache is not multi-threaded but only multi-process -
so I think thats the reason why cygwin works.
And of course, there is a possibility that the Cygwin multithreading
is simply better...

One last possibility: You mentioned that your WIN32 version supported
also mod_rewrite and mod_proxy, while the Cygwin version didn't; Did
you access them when the crashes occured?  Maybe the multithreading
in them is buggy?

I do not use mod_proxy or mod_rewrite for my test (look above) - its simply serving a local html-page.
Regarding your debugging stuff and stack: Seems that we need my
patches urgently, so the debugging information will be more readable.
It would be good to have a apache with debug info - so that when an crash occurs - the crash place would be stated symbolically.
I finished the migration to 1.3.12-2.6.2, so I'll submit the patches
today later.
Then, if you can apply the patches and re-build your
WIN32 version, but with "installd" rather than installr, and provide
us with the results of the debugger, it will be great.
I have no build environment for the WIN32 apache (I have no MSVC++ 6.0 / MASM etc... ) -
I only use the binary versions.
So it would be nice if you have a binary apache with debug infos turned on.
--
Eli Marmor
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]
-- 
                               \\\|///
                                /   \
                               ( o o )
+--------------------------.oo0O-(_)-O0oo.-------------------------------+
|                                                                        |
| Johannes A. Bertscheit     Phone: +49 821 54 40 46                     |
| Dipl.Informatiker (Univ.)  FAX:   +49 821 52 37 34                     |
| JB Management & Consulting Mobil: +49 172 84 05 109                    |
| Faerberstrasse 5           EMail: [EMAIL PROTECTED]             |
| D-86157 Augsburg           EMail-Mobil: [EMAIL PROTECTED] |
| Germany                                                                |
|                          .oooO                                         |
|                          (   )   Oooo.                                 |
+----------------------------\ (----(   )--------------------------------+
                              \_)    ) /
                                    (_/
 

 



Reply via email to