logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache Losing Post Data
Author
StephenJ



Joined: 06 Nov 2007
Posts: 2

PostPosted: Tue 06 Nov '07 23:55    Post subject: Apache Losing Post Data Reply with quote

Greetings,

I am running Apache 2.0.54 in Windows w/ PHP 5.2.4, we are also using mod_rewrite for close to 90% of the page requests.

We are running into an issue where Apache seems to randomly completely lose the data that was POSTed to the page. We have ran a packet sniffer and we have identified in the data which requests failed in this way. At a packet level the data is correctly formed and is arriving at the server.

When that data reaches the PHP page the POST data is completely missing and so is the RAW post data that could normally be found in php://input and other places.

Somewhere between the network card and PHP that data is lost so my belief is that Apache is dropping the ball somewhere.

Mind you the occurence of this is fairly random, sometimes the same person can submit the form 4 or 5 times and the data will come through on the 5th POST.

Our site has a fair amount of traffic, serving around 12 million pages a month. The webserver is not maxed out however, it stil has plenty of overhead.

Can anyone think of some further diagnostic measures I can take to track this down? Or does this issue sound familiar to anyone? The Apache bug database has some similar issues in it, but no resolutions. This issue effects a relatively small number of users, but it's still too many.

Thanks in advance.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Wed 07 Nov '07 7:22    Post subject: Reply with quote

You might want to add this to your httpd.conf:
Code:
LoadModule logio_module modules/mod_logio.so
and then add this to the end of your LogFormat string:
Quote:
%<I%<X %>I%>X
This will show four additional things in your access.log:
    . the number of bytes received for the original request
    . the connection status of the original request
    . the number of bytes received for the final request
    . the connection status of the final request
The "original" and "final" requests apply when Apache redirects a request internally. Usually they will be the same.

These log codes are documented here for Apache 2.0.

When the problem happens, you should try to find the request in logs\access.log and see if all the POST data got to the main request, or if the request was redirected internally with a different size. At least you will find out if the POST data is getting to Apache. This presumes the POST data is big enough that you can tell whether it was present by the byte count. The byte count will always be a few hundred bytes for headers, etc. - even if the POST data is missing.

If the problem only happens with SSL, it might be Apache Bug 43738.

Are you using just php5apache2.dll and AddType, or something else: like php5apache2_filter.dll or FastCGI?

You might also want to check these variables in your PHP.ini:
    variables_order = "EGPCS"
    post_max_size = ???
    always_populate_raw_post_data = On
Apache 2.0 has a LimitRequestBody directive, but this is not set by default. Seems unlikely because this should cause an error message.

-tom-
Back to top
StephenJ



Joined: 06 Nov 2007
Posts: 2

PostPosted: Wed 07 Nov '07 17:21    Post subject: Reply with quote

I appreciate the tips!

I added the mod_logio LoadModule and the extra log items and it appears on these requests that both the original and final request are the same size. In this particular case they were around 7k so there was definitely data in the request and it definitely seems to have been passed to both the original and final page.

This problem is not occuring on SSL pages.

We are using FastCGI (fcgid) now, but this issue also existed when we running mod_php.

The PHP.ini settings that you refer to were all set except always_populate_raw_post_date (because I was using read(php://input), and LimitRequestBody is set to about 45 megs.

I appreciate the help so far, anything else you can think of?

-Stephen
Back to top


Reply to topic   Topic: Apache Losing Post Data View previous topic :: View next topic
Post new topic   Forum Index -> Apache