[ic] mod_interchange and Apache MaxClients

John1 list_subscriber at yahoo.co.uk
Thu Nov 17 18:46:57 EST 2005

On Thursday, November 17, 2005 8:33 PM, kevin at cursor.biz wrote:

> I'm thinking about the PSP hanging issue and how that could effect
> things and I'm lead to believe that the following is happening:
>    1. User submits a request that causes a call to the PSP to be
>       made.
>    2. The PSP is taking its sweet time, so IC waits for a response.
>    3. 10 seconds later, mod_interchange gives up and resubmits the
>       user's request.  This compounds the problem.
I am trying to understand the basics of the 
apache<->mod_interchange<->interchange communication process...

So what happens if mod_interchange resubmits to interchange whilst it is 
waiting for a response?  Does it queue the resubmission, or just send a 
reply back saying it is still waiting and then drops the resubmissions?  If 
it queues the resubmissions, what does it do if the PSP does eventually get 
back with a reply after say 40 seconds?  Does it then drop the 2 

>    4. Loop back to #2 ten times, with a two second delay between
>       attempts.
That's interesting 10 seconds + 2 second delay = 12 seconds x 10 retries = 
120 seconds, which is exactly the length of time (give or take a few 
seconds) it takes the browser to give up with "Cannot find server or DNS 
error".  I assume this is not a coincidence?

> The above will probably wind up eating a lot of sockets, and also
> munch its way through your processes leading to the problems reported.
Would it be worth adding the following to Ron's script to show the number of 
Unix sockets in use before restarting Apache and Interchange?

netstat -nx | sed '1,2d' | awk '{print $5,$8}' | sed -e 's/:[0-9]*//g' | 
sort | uniq -c | sort -n

Or would this not really add any useful information?

> I believe the following, posted earlier in this thread, is a symptom
> of the later failures, rather than the initial cause:
>> [Thu Nov 10 20:15:11 2005] [error] [client x.x.x.x] Malformed header
>>  return by Interchange:
>> [Thu Nov 10 20:15:11 2005] [error] [client x.x.x.x] Premature end of
>> script headers: /home/xxxxxx/public_html/favicon.ico
> Can you check your logs to see if you can spot anything that looks
> like "Failed to select the response header."
Well I have plenty of entries recently like this:
[Thu Nov 17 16:02:35 2005] [error] (111)Connection refused: access to 
/index.html failed for x.x.x.x, reason: Connection failed


[Thu Nov 17 21:12:42 2005] [error] (104)Connection reset by peer: access to 
/index.html failed for x.x.x.x, reason: error sending headers to client

I guess it is this latter error that you are referring to?

> I could be wrong, but the above sounds plausible.
> Possible workarounds, if you find the above error message.
>    1. Upgrade Interchange.  Upgrade it now!  See the wget comments.
Would upgrading to the wget Payment.pm actually solve the above?  Presumably 
the issue of mod_interchange resubmitting requests ensuing munching of 
sockets and processes would still apply to the wget approach?  Is that so?

Do we actually *know* what is "wrong" with Net::SSLeay, or is it just a case 
of "we know Net:SSLeay and LWP seems to cause terminated output with 
Authorizenet and other payment modules whereas wget deosn't"?

>    1.1. Upgrade everything else while you're at it.  I see people are
>       still using Red Hat 7 and Perl 5.6 for some reason.
I guess I will get round to it eventually... :-)

Are there any notable advantages to upgrading from Perl 5.6?

Is there anything about sticking with Red Hat 7.3 that should cause me 
particular concern?

>    2. Add "ConnectTries 1" to the mod_interchange <Location>
>       parameters in your Apache configuration.  This will cause the
>       initial timeout to force a failure, rather than retry the
> request.
Are there any negative consequences to doing this, that would actually 
matter in practice?

Are there any good reasons why mod_interchange may get timeouts in the 
normal course of a customer browsing the site?

Does this mean that if it takes more than IC_DEFAULT_TIMEOUT for the 
Interchange service to respond to a page request the customer's browser will 
return "Cannot find server or DNS error"?

>    3. Increase the mod_interchange timeout.  This can only be done by
>       editing mod_interchange.c, to increase the IC_DEFAULT_TIMEOUT
>       definition, and recompiling mod_interchange.so.  Perhaps I
>       should make that configurable in the Apache config.
What would you suggest for IC_DEFAULT_TIMEOUT?

Again, what would the negative consequences be of increasing 

Are the negative consequences really going to matter in practice?

> Give the above a try and see if any of it works.
I certainly will!  Thank you very much Kevin!!

BTW, have you any idea where is my original post about payment service 
provider (PSP) timeouts and Net::SSLeay?  The mailing list doesn't seem to 
have mailed me a copy (even though I have it configured to mail me copies of 
all posts including my own).  But you have obviously seen it Kevin.  Ron & 
Jeff, did the mailing list send you a copy?

Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

More information about the interchange-users mailing list