After this:

So, i made some tests. I generated 200 pages local - right on the server. perl simashin.cgi params > file_name.html

The result is : * Each of 200 pages generates till the end -> </html> without any errors. So we can make conclusion, that the cgi script works fine * This static generated pages can easily load with browser. So we make the conclusion that problems not in content of page.

So the problem can be only in connection(provider, home server, router, something that i can`t even imagine :) ...) or in apache

Thinking about - how can i find the weak place I think it is time to some tests with LWP

I wrote simple LWP script, which getting this problem page -

#!/usr/bin/perl use HTTP::Request::Common; require LWP::UserAgent; use Data::Dumper; $ua = new LWP::UserAgent; $ua -> timeout(60); $request = new HTTP::Request ('GET',"http://sitename/script.cgi?parame +ter1=value1&parameter2=value2"); $response = $ua -> request($request); print Dumper($response);

I exec this script in cycle like this

 for i in 1..n; do test.pl > test_$i.html; done

You can do it as you like(right in perl script maybe)

I did something about 200 test, and after it making some changes in network,apache,router etc... settings, and analyzing the result of execution.

So i had only ~5% of pages loaded to the end, after day of testing. So i decided to test apache(doing generation of this page) i edit the test script and wrote there localhost instead of full domain name, and run it local. The apache works good without mistakes, after couple of hours i saw that 99% of pages was generated to the end... So apache works fine.

So the problem now can only be in network or network devices.I thought on my provider first, but my network connection seems to be good - i have 2-3ms ping and always 10mbit in each direction connection.

So i begin to trace network, running tcpdump, making loads with telnet, trying to analyze errors and cases when page stops to download, but can find nothing.

Network adapters seems works fine too, so i decide to try connection without my router - dlink dir300(which gives Internet to 3 +wifi computers), the 1 day gone while i made my linux server work with my provider connection type :D, they(provider) said that it can be done only through a couple numbers of router or through windows special program, but it is not true, as always, now i know that i can do it from linux :D. Arrggghh, about the problem - what do you think - it is works fine...

So the problem is in this router. Moreover when this errors begins the first problem device on which i thought - was this router(ugly little box :) ), because router is closed device(it has only web interface for settings) and you can`t understand working it or not, you can`t to know how it actually works, what is the load of it cpu and so on. But i did not want to test the connection without it, because of hardness to configure linux server with my provider connection.

After understanding where is the weak place i gather home network back(with router), and begin to make some tests, so the problem was - when the redirection of ports working on router, we have only 5% good results with this big script, so i remove the redirection for my linux server(but now it is all open in internet :( ), and now all works fine

P.S. So, from time i begin a linux user and have linux sysadmin work, i begin to hate these closed boxes on which you do not have the full control, but this is progress and for usual users it is great devices, which easily can be configured... More over if we try to control all things ourselves in our life we will be crazy :D

P.S.2. Thanks to all who helps me.

P.S.3. I hope this post can help all other who searching the solution for this apache errors with cgi


In reply to Re: CGI page sometimes do not loading, apache write error by simak
in thread CGI page sometimes do not loading, apache write error by simak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.