문제

we have a web application (racktables) that's giving us grief on our production box. whenever users try to run a search, it gives the following error:

Pdo exception: PDOException

SQLSTATE[HY000]: General error: 5 Out of memory (Needed 2057328 bytes) (HY000)

I cannot recreate the issue on our backup server. The servers match except for the fact that in production we have 16GB RAM and our backup we have 8GB. It's a moot point though because both are running 32 bit os's and so are only using 4GB of RAM. we also have set up a swap partition...

Here's what i get back from the "free -m" command in production:

prod:/etc# free -m
             total         used         free       shared      buffers
Mem:          3294         1958         1335            0          118
-/+ buffers:               1839         1454
Swap:         3817          109         3707
prod:/etc# 

I've checked to make sure that my.cnf on both boxes match. The database from production was replicated onto the backup server... so the data matches as well.

I guess our options are to:

A) convert the o/s to 64 bit so we can use more RAM. 
B) start tweaking some of the innodb settings in my.cnf. 

But before I try either A or B, I wanted to know if there's anything else I should compare between the two servers... seeing how the backup is working just fine. There must be a difference somewhere that we are not accounting for.

Any suggestions would be appreciated.

도움이 되었습니까?

해결책

I created a script to simulate load on the backup server and was able to then to recreate the out of memory error message. In the end, i added the "join_buffer_size" setting to my.cnf and set it 3 MBs. That has resolved the issue.

ps. I downloaded and ran tuning-primer.sh as well as mysqltuner.pl to narrow down the issues.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top