-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/10/2013 12:05 AM, Grant wrote:
>>> The responses all come back successfully within a few seconds.
>>>  Can you give me a really general description of the sort of 
>>> problem that could behave like this?
>> 
>> Your server is just a single computer, running multiple
>> processes. Each request from a user (be it you or someone else)
>> requires a certain amount of resources while it's executing. If
>> there aren't enough resources, some of the requests will have to
>> wait until enough others have finished in order for the resources
>> to be freed up.
> 
> Here's where I'm confused.  The requests are made via a browser and
>  the response is displayed in the browser.  There is no additional
>  processing besides the display of the response.

You're running a client-side script that causes the *server* to do work.
The more work the server has to do, the slower it will perform for both
serving up your requests and those of other users. This is completely
independent of the work the client has to do.


> The responses are received and displayed within about 3 seconds of
>  when the requests are made.  Shouldn't this mean that all
> processing related to these transactions is completed within 3
> seconds?

There's client-side processing in handling the server's response, but
there's also server-side processing in handling the client's request.
What Stroller called a wall of text was a crash course in how a server
can have too many things to do in a short amount of time, and some of
the side-effects you can see--like having two nominally-3s queries both
appear to take 6s, from the client's perspective.

> If so, I don't understand why apache2 seems to bog down a bit for 
> about 10 minutes afterward.

Now that's a new (and important!) piece of information. Your server
runs slow for 10 *minutes* after your script has made its request?

To me, that indicates that important data wound up getting swapped to
disk on the server, and the slow behavior reported by other users is
the result of that data being swapped back in on-demand.

That also indicates that your script's requests (and, possibly,
request pattern) cause some process in the server to allocate far more
memory than usual, which is why the server is swapping things to disk.

Why, exactly, the server is consuming so much memory depends on a lot
of factors.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRGS3FAAoJED5TcEBdxYwQs7oH/3Xy0d85bNJ2QtQ4YcTF7g9E
TPZbwAUrwxrYf828AMlCUMOww2d1wr0DQOm4lBrzOb/93C8iwGKTjtu1dBaOspdC
mEdVmkFXF8YUB8yA3SiSgteHNCDrN27UyJQNP7mOK8PXwri4BYyxTUEJ0UyZXc4F
oIoSweHQg7tmyKN7Rudd69axREJ9yIpKt4lw7JZWHhX25hTVxWYF1zRDxNNC1vJ+
kQWSE3ZcP8EdotmcpARPF7N4leHOyU1+Rw9XatLVbb2W23Fza/4+Mqeam9fbObgH
w1mdMCzIUxlUL91nU7Zc0zzb2qYS7Te1N7bOcFr1fXowcCBagUdzOKjEcshket0=
=sWpw
-----END PGP SIGNATURE-----

Reply via email to