mysql and oom-killer

mysql and oom-killer

am 05.08.2010 20:43:09 von ekilimchuk

--0016363b827af8f4f0048d17eb17
Content-Type: text/plain; charset=ISO-8859-1

Hello!

I use CentOS 5.4 with LAMP. On the server runs heavy cgi-programs. MySQL use
75% (100% = 8GB) of memory. When cgi programs use more than 25% of memory
and all SWAP file (8GB), kernel run OOM-Kiler wich kill mysqld procces.

I use:

echo "0" > /proc/sys/vm/swappiness - This allows to reduce using of SWAP.

I want to use:
echo "-17" > /proc/`pidof mysqld`/oom_adj - This allows save mysqld when run
oom-killer.

Someone used this option?

--0016363b827af8f4f0048d17eb17--

Re: mysql and oom-killer

am 05.08.2010 20:47:49 von Walter Heck

It would be a lot better to make sure your server doesn't turn
OOM-psycho on you. The most common case of this happening is that you
have set the memory-settings in your my.cnf in such a way that it
allows MySQL to use more memory then you have available. Could you
post your my.cnf here by chance?

Walter Heck
Engineer @ Open Query (http://openquery.com)

On Fri, Aug 6, 2010 at 02:43, Евгений =
Килимчук wro=
te:
> Hello!
>
> I use CentOS 5.4 with LAMP. On the server runs heavy cgi-programs. MySQL =
use
> 75% (100% =3D 8GB) of memory. When cgi programs use more than 25% of memo=
ry
> and all SWAP file (8GB), kernel run OOM-Kiler wich kill mysqld procces.
>
> I use:
>
> echo "0" > /proc/sys/vm/swappiness - This allows to reduce using of =C2=
=A0SWAP.
>
> I want to use:
> echo "-17" > /proc/`pidof mysqld`/oom_adj - This allows save mysqld when =
run
> oom-killer.
>
> Someone used this option?
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: mysql and oom-killer

am 05.08.2010 21:02:57 von ekilimchuk

--00c09f899228c99768048d183218
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

Mysql used 5GB (buffers + 400 connections) of memory, but CGI-script some
time made heavy load when used many memory and used SWAP. OOM-killer must
kill new cgi-forks, wich use many memory, but it kill mysqld and sshd.

2010/8/5 Walter Heck - OlinData.com

> It would be a lot better to make sure your server doesn't turn
> OOM-psycho on you. The most common case of this happening is that you
> have set the memory-settings in your my.cnf in such a way that it
> allows MySQL to use more memory then you have available. Could you
> post your my.cnf here by chance?
>
> Walter Heck
> Engineer @ Open Query (http://openquery.com)
>
> On Fri, Aug 6, 2010 at 02:43, å×ÇÅÎÉ=CA ëÉÌÉÍÞ=D5=
=CB
> wrote:
> > Hello!
> >
> > I use CentOS 5.4 with LAMP. On the server runs heavy cgi-programs. MySQ=
L
> use
> > 75% (100% =3D 8GB) of memory. When cgi programs use more than 25% of me=
mory
> > and all SWAP file (8GB), kernel run OOM-Kiler wich kill mysqld procces.
> >
> > I use:
> >
> > echo "0" > /proc/sys/vm/swappiness - This allows to reduce using of
> SWAP.
> >
> > I want to use:
> > echo "-17" > /proc/`pidof mysqld`/oom_adj - This allows save mysqld whe=
n
> run
> > oom-killer.
> >
> > Someone used this option?
> >
>



--=20
Best regards,

Eugene Kilimchuk

--00c09f899228c99768048d183218--

Re: mysql and oom-killer

am 05.08.2010 21:05:31 von ekilimchuk

--0016364edcdcff8e98048d183b3a
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

I can't write my config parameters now.

5 Á×ÇÕÓÔ=C1 2010 =C7. 23:02 ÐÏÌØÚÏ×ÁÔÅ=CC=
=D8 å×ÇÅÎÉ=CA ëÉÌÉÍÞÕË
ÎÁÐÉÓÁ=CC:

> Mysql used 5GB (buffers + 400 connections) of memory, but CGI-script some
> time made heavy load when used many memory and used SWAP. OOM-killer must
> kill new cgi-forks, wich use many memory, but it kill mysqld and sshd.
>
> 2010/8/5 Walter Heck - OlinData.com
>
> It would be a lot better to make sure your server doesn't turn
>> OOM-psycho on you. The most common case of this happening is that you
>> have set the memory-settings in your my.cnf in such a way that it
>> allows MySQL to use more memory then you have available. Could you
>> post your my.cnf here by chance?
>>
>> Walter Heck
>> Engineer @ Open Query (http://openquery.com)
>>
>> On Fri, Aug 6, 2010 at 02:43, å×ÇÅÎÉ=CA ëÉÌÉÍÞ=
ÕË
>> wrote:
>> > Hello!
>> >
>> > I use CentOS 5.4 with LAMP. On the server runs heavy cgi-programs. MyS=
QL
>> use
>> > 75% (100% =3D 8GB) of memory. When cgi programs use more than 25% of
>> memory
>> > and all SWAP file (8GB), kernel run OOM-Kiler wich kill mysqld procces=
..
>> >
>> > I use:
>> >
>> > echo "0" > /proc/sys/vm/swappiness - This allows to reduce using of
>> SWAP.
>> >
>> > I want to use:
>> > echo "-17" > /proc/`pidof mysqld`/oom_adj - This allows save mysqld wh=
en
>> run
>> > oom-killer.
>> >
>> > Someone used this option?
>> >
>>
>
>
>
> --
> Best regards,
>
> Eugene Kilimchuk
>



--=20
Best regards,

Eugene Kilimchuk

--0016364edcdcff8e98048d183b3a--

Re: mysql and oom-killer

am 05.08.2010 22:09:10 von Johan De Meersman

--000e0cd5662a9ee5bd048d191f75
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

You don't want to mess with OOM too much - you risk it killing off other
useful/critical things, like SSH daemons, the Apache root, what have you.

Add more memory to the box or split the webserver off to another system, I'=
d
say.


2010/8/5 å×ÇÅÎÉ=CA ëÉÌÉÍÞÕË om>

> I can't write my config parameters now.
>
> 5 Á×ÇÕÓÔ=C1 2010 =C7. 23:02 ÐÏÌØÚÏ×ÁÔÅ=CC=
=D8 å×ÇÅÎÉ=CA ëÉÌÉÍÞÕË
> ÎÁÐÉÓÁ=CC:
>
> > Mysql used 5GB (buffers + 400 connections) of memory, but CGI-script so=
me
> > time made heavy load when used many memory and used SWAP. OOM-killer mu=
st
> > kill new cgi-forks, wich use many memory, but it kill mysqld and sshd.
> >
> > 2010/8/5 Walter Heck - OlinData.com
> >
> > It would be a lot better to make sure your server doesn't turn
> >> OOM-psycho on you. The most common case of this happening is that you
> >> have set the memory-settings in your my.cnf in such a way that it
> >> allows MySQL to use more memory then you have available. Could you
> >> post your my.cnf here by chance?
> >>
> >> Walter Heck
> >> Engineer @ Open Query (http://openquery.com)
> >>
> >> On Fri, Aug 6, 2010 at 02:43, å×ÇÅÎÉ=CA ëÉÌÉÍÞ=
ÕË
> >> wrote:
> >> > Hello!
> >> >
> >> > I use CentOS 5.4 with LAMP. On the server runs heavy cgi-programs.
> MySQL
> >> use
> >> > 75% (100% =3D 8GB) of memory. When cgi programs use more than 25% of
> >> memory
> >> > and all SWAP file (8GB), kernel run OOM-Kiler wich kill mysqld
> procces.
> >> >
> >> > I use:
> >> >
> >> > echo "0" > /proc/sys/vm/swappiness - This allows to reduce using of
> >> SWAP.
> >> >
> >> > I want to use:
> >> > echo "-17" > /proc/`pidof mysqld`/oom_adj - This allows save mysqld
> when
> >> run
> >> > oom-killer.
> >> >
> >> > Someone used this option?
> >> >
> >>
> >
> >
> >
> > --
> > Best regards,
> >
> > Eugene Kilimchuk
> >
>
>
>
> --
> Best regards,
>
> Eugene Kilimchuk
>



--=20
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--000e0cd5662a9ee5bd048d191f75--

Re: mysql and oom-killer

am 05.08.2010 22:35:41 von ekilimchuk

--0016364ed6da6f7204048d197ea5
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

When OOM-killer kill mysqld, I had a critical corrupted tables. My database
is a very big. I think Apache with cgi-scripts not critical process in this
story. And sshd is a real true.

6 Á×ÇÕÓÔ=C1 2010 =C7. 0:09 ÐÏÌØÚÏ×ÁÔÅÌØ=
Johan De Meersman
ÎÁÐÉÓÁ=CC:

> You don't want to mess with OOM too much - you risk it killing off other
> useful/critical things, like SSH daemons, the Apache root, what have you.
>
> Add more memory to the box or split the webserver off to another system,
> I'd say.
>
>
> 2010/8/5 å×ÇÅÎÉ=CA ëÉÌÉÍÞÕË ..com>
>
> I can't write my config parameters now.
>>
>> 5 Á×ÇÕÓÔ=C1 2010 =C7. 23:02 ÐÏÌØÚÏ×ÁÔÅ=
ÌØ å×ÇÅÎÉ=CA ëÉÌÉÍÞÕË
>> ÎÁÐÉÓÁ=CC:
>>
>> > Mysql used 5GB (buffers + 400 connections) of memory, but CGI-script
>> some
>> > time made heavy load when used many memory and used SWAP. OOM-killer
>> must
>> > kill new cgi-forks, wich use many memory, but it kill mysqld and sshd.
>> >
>> > 2010/8/5 Walter Heck - OlinData.com
>> >
>> > It would be a lot better to make sure your server doesn't turn
>> >> OOM-psycho on you. The most common case of this happening is that you
>> >> have set the memory-settings in your my.cnf in such a way that it
>> >> allows MySQL to use more memory then you have available. Could you
>> >> post your my.cnf here by chance?
>> >>
>> >> Walter Heck
>> >> Engineer @ Open Query (http://openquery.com)
>> >>
>> >> On Fri, Aug 6, 2010 at 02:43, å×ÇÅÎÉ=CA ëÉÌÉ=CD=
ÞÕ=CB
>> >> wrote:
>> >> > Hello!
>> >> >
>> >> > I use CentOS 5.4 with LAMP. On the server runs heavy cgi-programs.
>> MySQL
>> >> use
>> >> > 75% (100% =3D 8GB) of memory. When cgi programs use more than 25% o=
f
>> >> memory
>> >> > and all SWAP file (8GB), kernel run OOM-Kiler wich kill mysqld
>> procces.
>> >> >
>> >> > I use:
>> >> >
>> >> > echo "0" > /proc/sys/vm/swappiness - This allows to reduce using of
>> >> SWAP.
>> >> >
>> >> > I want to use:
>> >> > echo "-17" > /proc/`pidof mysqld`/oom_adj - This allows save mysqld
>> when
>> >> run
>> >> > oom-killer.
>> >> >
>> >> > Someone used this option?
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Best regards,
>> >
>> > Eugene Kilimchuk
>> >
>>
>>
>>
>> --
>> Best regards,
>>
>> Eugene Kilimchuk
>>
>
>
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>



--=20
Best regards,

Eugene Kilimchuk

--0016364ed6da6f7204048d197ea5--

Re: mysql and oom-killer

am 06.08.2010 06:36:08 von Rob Wultsch

2010/8/5 Евгений Кил=D0=
¸Ð¼Ñ‡ÑƒÐ=BA :
> When OOM-killer kill mysqld, I had a critical corrupted tables. My databa=
se
> is a very big. I think Apache with cgi-scripts not critical process in th=
is
> story. And sshd is a real true.
>

OOM is configurable via the proc filesystem via /proc//oom_adj .
You can set the processes that you do not want to get killed to a
negative number, if I remember correctly, and that will help to
prevent them from being killed by OOM.

So let's say mysqld pid is 123456, you could
echo -17 > /proc/123456/oom_adj
and then it would be less likely to be selected by OOM to be killed.



--
Rob Wultsch
wultsch@gmail.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: mysql and oom-killer

am 06.08.2010 06:37:35 von Rob Wultsch

2010/8/5 Rob Wultsch :
> 2010/8/5 Евгений Кил=D0=
¸Ð¼Ñ‡ÑƒÐ=BA :
>> When OOM-killer kill mysqld, I had a critical corrupted tables. My datab=
ase
>> is a very big. I think Apache with cgi-scripts not critical process in t=
his
>> story. And sshd is a real true.
>>
>
> OOM is configurable via the proc filesystem via /proc//oom_adj .
> You can set the processes that you do not want to get killed to a
> negative number, if I remember correctly, and that will help to
> prevent them from being killed by OOM.
>
> So let's say mysqld pid is 123456, you could
> echo -17 > /proc/123456/oom_adj
> and then it would be less likely to be selected by OOM to be killed.
>
>
>
> --
> Rob Wultsch
> wultsch@gmail.com
>

And I should have stated that this in significant use by the
PostgreSQL community.

--=20
Rob Wultsch
wultsch@gmail.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg