1 |
>>>> I ran into an out of memory problem. The first mention of it in the |
2 |
>>>> kernel log is "mysqld invoked oom-killer". I haven't run into this |
3 |
>>>> before. I do have a swap partition but I don't activate it based on |
4 |
>>>> something I read previously that I later found out was wrong so I |
5 |
>>>> suppose I should activate it. Is fstab the way to do that? I have a |
6 |
>>>> commented line in there for swap. |
7 |
... |
8 |
> Switching from prefork to threads and vice versa can be very |
9 |
> difficult depending on which modules and libraries your site uses. It is not |
10 |
> on the list of things you should try first. Or second. Maybe 37th. |
11 |
> I wouldn't expect adding swap to do much in this case. Your site gets |
12 |
> hit hard, Mysql is a bit slow, Apache processes start stacking up, the |
13 |
> system starts swapping, disk is really slow compared to RAM, and everything |
14 |
> grinds to a complete halt possibly locking the machine up. |
15 |
> |
16 |
> The easiest thing to try is to turn off keepalives so child processes |
17 |
> aren't hanging around keeping connections up. Also lower the number of |
18 |
> Apache children to 8 * number of processors or a minimum of 32. Test a bit. |
19 |
> Turning off keep alive can cause problems for Flash based uploaders to your |
20 |
> site and code that expect the connection to stay up. For most sites this |
21 |
> shouldn't matter. |
22 |
> |
23 |
> Next I'd look at tuning your Mysql config. If you've never touched |
24 |
> my.cnf, by default it's set to use 64MB IIRC. You may need to raise this to |
25 |
> get better performance. key_buffer and innodb_buffer_pool_size are the only |
26 |
> two I'd modify without knowing more. |
27 |
|
28 |
I use the default MyISAM tables and it looks like there are three |
29 |
key_buffer definitions in my.cnf. One under [mysqld] is 16M, one |
30 |
under [isamchk] is 20M, and one under [myisamchk] is 20M. All |
31 |
defaults. Should I increase them all to 64M? |
32 |
|
33 |
- Grant |