[SAC] OOM killer on tracsvn

Sandro Santilli strk at kbt.io
Tue Sep 6 06:43:51 PDT 2016


On Tue, Sep 06, 2016 at 01:44:58PM +0200, Markus Neteler wrote:
> 
> On a machine short of memory I usually run some cronjob which restarts
> the apache server just before the OOM killer starts...
> In this case it is likely a bad approach.

The problem with OOM killer is that it makes it impossible for a
process to take responsibility over memory usage. For example,
an SQL query could just fail (aborting the transaction) if it
would not be able to allocate enough memory, while this is impossible
with an OOM Killer active because the operating system would never
let the process know that there's not enough memory.

> In the first place we should optimize the Apache settings and DB(s) to
> have a smaller memory footprint.

First step to optimization is understanding what's going on.
Does anyone have an idea about how to tell _which_ Apache-served
applications are taking up the most memory ? It's somewhat easier
when Apache only acts as a proxy (as for the Gogs case), but much
harder with in-process apache extensions (as for trac).

Current situation:

 Mem:   8200012k total,  2532680k used,  5667332k free,    52508k buffers
 Swap:  4096568k total,    68612k used,  4027956k free,  1271972k cached

Top 21 processes in memory usage order are 21 apache forks, from:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
31541 www-data  20   0  419m  82m  10m S    0  1.0   0:03.80 /usr/sbin/apache2 -k start

--strk;


More information about the Sac mailing list