Gentoo Archives: gentoo-user

From: Jarry <mr.jarry@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Web Server Memory Issues
Date: Wed, 12 Jan 2011 22:07:38
Message-Id: 4D2E1F23.7010904@gmail.com
In Reply to: [gentoo-user] Web Server Memory Issues by Kaddeh
1 On 12. 1. 2011 19:59, Kaddeh wrote:
2
3 > P4 @ 3.0Ghz
4 > 2GB PC2 4200
5 > 2x 250GB drives in RAID1
6 > The system configurations are default for the most part with the server
7 > running MySQL and Apache.
8 > The problem that I am running into at this point, however is that the
9 > machine seems to run out of memory and will segfault either apache or
10 > mysql when does so, when apache segfaults, it is a recoverable error,
11 > when mysql does it, mysql can't recover short of restarting it.
12 > At this point, I have found a soft fix by running a cron job every 6
13 > hours or so to clear the cached memory, which seems to be the problem,
14 > however, I would like to find a more permanent fix to this issue.
15
16 First of all, find what is causing that excessive memory usage.
17 I think 2GB should be enough for moderate web with apache+mysql.
18
19 Second, use some monitoring software. Personally I'm using
20 "monit" and I am very satisfied with it. It can monitor processes
21 (if it is running, answering requests, etc), resources (disk,
22 memory, swap, cpu, i/o), files (content, permissions, checksums),
23 remote hosts (with some basic protocol checks i.e. http, ssh,
24 smtp, ftp, mysql, ntp, dns...), it can inform you about problems
25 (mail, log) and you can define rules what to do in case of anomalies
26 (i.e. if mysql is using to much memory, it will be restarted).
27
28 It can start/restart processes if they die (happened to me once
29 with sshd on server which was ~50 miles away from me). You can
30 put monit in inittab, so in case monit itself dies it is restarted
31 automatically. Etc, etc.
32
33 Jarry
34
35 --
36 _______________________________________________________________
37 This mailbox accepts e-mails only from selected mailing-lists!
38 Everything else is considered to be spam and therefore deleted.

Replies

Subject Author
Re: [gentoo-user] Web Server Memory Issues Kaddeh <kaddeh@×××××.com>