Re: Apache process crashes, utilizing high memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




P.S. to clarify, your application is running within that process, which is why a memory like makes it grow

On Thu, 29 Aug 2019 at 8:50 am, Nigel B. Peck <nigelbpeck@xxxxxxxxx> wrote:

It stops when you change to 1 because it kills the child process after every single request! Try upgrading Apache to a recent version if you’re concerned about that, but this is not likely at all to because of Apache. Perhaps others with more experience have thoughts on this situation?

On Thu, 29 Aug 2019 at 3:52 am, Arnav Garg <arnav.garg@xxxxxxxxxxxxx> wrote:

Hi Nigel Sir,

 

Thanks for your continuous support and prompt reply. I had one more query as follows:

 

>> I’m not suggesting it’s a memory leak in Apache, rather in the application(s) that you’re running on Apache.

 

After my investigation and your suggestion, I had tuned my apache-server with MaxConnectionPerChild to a value “1” and things started to change. The memory consumption did not rise in comparison with other values. Also, I tried with MaxConnectionPerChild to “100”, but the results were same as MaxConnectionPerChild  set to “0” i.e. high memory consumption within few seconds. So I couldn’t understand why memory leak is related to our application(CKAN) & not apache, as memory consumption changes with this parameter(i.e. MaxConnectionPerChild).

 

So, if you can please suggest/clarify as to, why do you think my “application”- CKAN(an open data portal) is having a problem? I think memory leak is from Apache side.

 

Thanks & regards,

Arnav

 

 

 

From: Arnav Garg [mailto:arnav.garg@xxxxxxxxxxxxx]
Sent: Wednesday, August 28, 2019 12:00 PM
To: users@xxxxxxxxxxxxxxxx
Subject: RE: Apache process crashes, utilizing high memory

 

Hi Nigel,

 

Thanks for your prompt reply, I had one more doubt:

 

While keeping the value of MaxConnectionPerChild to 1, my memory consumption do not increase as rapidly as it was earlier when it was set to 0.

 

Here are the statistics:

 

My initial memory was :

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

ckan-ap+ 12793  0.2  0.0 304068  6096 ?        Sl   06:35   0:00 ckan_default      -k start

ckan-ap+ 12794  0.2  0.0 304068  6104 ?        Sl   06:35   0:00 ckan_default      -k start

ckan-ap+ 12795  0.0  0.0 304076  6104 ?        Sl   06:35   0:00 ckan_default      -k start

ckan-ap+ 12796  0.0  0.0 304068  6104 ?        Sl   06:35   0:00 ckan_default      -k start

 

After firing 105 requests/per sec for 5 times with a Thread delay of 360 milliseconds using Jmeter.

 

The memory after firing the requests

 

Case 1: When I used to have MaxConnectionPerChild “0”:

 

The output observed using “top” command:

 

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

ckan-ap+ 12793 14.4  1.5 1444920 124880 ?      Sl   06:35   0:13 ckan_default      -k start

ckan-ap+ 12794 14.0  1.4 1441080 119300 ?      Sl   06:35   0:13 ckan_default      -k start

ckan-ap+ 12795 14.8  1.5 1442120 120724 ?      Sl   06:35   0:14 ckan_default      -k start

ckan-ap+ 12796 14.5  1.5 1442616 120904 ?      Sl   06:35   0:13 ckan_default      -k start

 

Case 2: When MaxConnection PerChild  was set to “1”.

 

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

ckan-ap+ 13448 13.6  1.3 845368 108904 ?      Sl   06:39   0:11 ckan_default      -k start

ckan-ap+ 13449 11.6  1.3 845376 104560 ?       Sl   06:39   0:09 ckan_default      -k start

ckan-ap+ 13450 11.7  1.2 844608 102696 ?       Sl   06:39   0:09 ckan_default      -k start

ckan-ap+ 13451 11.8  1.2 844344 102392 ?       Sl   06:39   0:09 ckan_default      -k start

 

The value highlighted in yellow remains almost the same or nearby when the performance testing was done for 2 hours.

 

Case 3: When MaxConnectionPerChild  was set to “100”.

Output:  same as Case 1.

 

Doubt:

if you can please let us know on the performance or any side effects if I keep the value of MaxConnectionPerChild as 0 , 1 and 100?

 

Thanks & Regards

Arnav

 

>> I’m suggesting 100 because it seems you have a memory leak, so looking to make sure they are restarted before that takes up too much memory. The cost is the overhead of spawning a new process every X number of connections.

 

>> If you set it higher then your memory leak will have more effect.

 

Will there be any performance impact

 

 

From: Nigel B. Peck [mailto:nigelbpeck@xxxxxxxxx]
Sent: Thursday, August 22, 2019 11:10 AM
To:
users@xxxxxxxxxxxxxxxx
Subject: Re: Apache process crashes, utilizing high memory

 

On Thu, 22 Aug 2019 at 12:02 am, Arnav Garg <arnav.garg@xxxxxxxxxxxxx> wrote:

Hi Nigel,

 

Thanks for your prompt reply.

Can you please help me in clarifying some of my doubts?

1.       What is the significance of setting MaxConnectionsPerChild to a value between 1-100 ?

2.       What are the possible reasons for not setting MaxConnectionsPerChild to a high value, greater than 100 ?

It specifies the number of connections that a child process will serve before being closed and a new one spawned. Having it as 0 means there’s no limit so they just keep running.

 

I’m suggesting 100 because it seems you have a memory leak, so looking to make sure they are restarted before that takes up too much memory. The cost is the overhead of spawning a new process every X number of connections.

 

If you set it higher then your memory leak will have more effect.

 

Best thing is to set it and then monitor and load test the server to get data to guide decisions on what works for your situation. And identify and fix the memory leak :)

 

Hope that helps.

 

Nigel

 

Web Technologies and Linux Admin Mentor

 

 

 


The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or NECTI or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of NECTI or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.


The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or NECTI or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of NECTI or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux