LISTSERV mailing list manager LISTSERV 15.5

Help for LINUX-L Archives


LINUX-L Archives

LINUX-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave LINUX-L
Reply | Post New Message
Search Archives


Subject:

Re: Need Help with Memory Errors on LAMP Server

From:

Steve Jensen <[log in to unmask]>

Reply-To:

Platform Independent Linux List! <[log in to unmask]>

Date:

Thu, 28 Jul 2011 12:05:10 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (1 lines)


You have no swap space ... probably not needed in most cases w/ 3gb of
ram, but it may be related to your issue

dd if=/dev/zero of=/swapfile bs=1K count=100000
mkswap /swapfile
swapon /swapfile

That will create a 1gb file, make it swap, and activate it.


Steve @ "the other college"



---
Steve Jensen
Santa Fe College
Gainesville, Fl

[log in to unmask]
ICQ # 3440385

---



On 07/28/2011 12:05 PM, Michael Herchel wrote:
> Also, the host is media temple. I have contacted their support several times, but they're unable to help out with this one...
>
> After running df -h, I get the following output, which looks fine to me. Keep in mind that I have just rebooted the server and ran this command.
>
> Thanks,
>
> [root@xxxx xxxx]# df -h
> Filesystem Size Used Avail Use% Mounted on
> /dev/vzfs 96G 38G 59G 40% /
> /dev/simfs 96G 38G 59G 40% /tmp
> /dev/simfs 96G 38G 59G 40% /var/tmp
> none 1.5G 4.0K 1.5G 1% /dev
> tmpfs 1.5G 0 1.5G 0% /usr/local/psa/handlers/before-local
> tmpfs 1.5G 0 1.5G 0% /usr/local/psa/handlers/before-queue
> tmpfs 1.5G 0 1.5G 0% /usr/local/psa/handlers/before-remote
> tmpfs 1.5G 0 1.5G 0% /usr/local/psa/handlers/info
> tmpfs 1.5G 0 1.5G 0% /usr/local/psa/handlers/spool
> [root@ xxxx xxxx]#
>
>
> Michael Herchel
> Network Administrator
> Florida High School Athletic Association
> http://www.fhsaa.org
> (352) 372-9551 x120 | [log in to unmask]
> ----------
> Become a FHSAA Official! Earn part-time income! Your local high schools need umpires and referees.
> http://www.BecomeAnOfficial.org
>
>
> -----Original Message-----
> From: Platform Independent Linux List! [mailto:[log in to unmask]] On Behalf Of Michael Herchel
> Sent: Thursday, July 28, 2011 11:57 AM
> To: [log in to unmask]
> Subject: Re: Need Help with Memory Errors on LAMP Server
>
> Dan: Thanks for your help. Below is the output of top (without any options) left running. After I exited out of top, the memory condition was apparent. In the meantime, I will reboot the server and try your suggestions.
>
> Alexander: This is CentOS 5.5. Not 100% sure of the Apache version (/etc/init.d/httpd -v doesn't tell me).
>
> Currently, when I look at top, it shows 3 apache processes each using 15% of memory, but they seem to vary.
>
> Although it doesn't appear to be a linear rise that would indicate some type of memory leak, it seems to rise, go down, then rise more, etc. Finally, it won't do anything.
>
> It isn't any type of individual action ...this is a standard public facing website with most users being anonymous. I haven't tried aggressive memory limits on php.ini. Its currently set to 256M because the content creators typically upload large images (capped at 2M) that get resized. However, I have verified that this is not what is creating this condition (there are only a few content creators, and I'm aware of what they're doing).
>
> Please let me know if there are any more suggestions. Thanks,
>
> --------------------------------------------------------------------------------
> [root@xxxx xxxx]# top
> top - 11:44:05 up 1:51, 1 user, load average: 0.10, 0.10, 0.08
> Tasks: 38 total, 1 running, 37 sleeping, 0 stopped, 0 zombie
> Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> Mem: 3088056k total, 3088056k used, 0k free, 0k buffers
> Swap: 0k total, 0k used, 0k free, 0k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 1 root 15 0 10356 728 608 S 0.0 0.0 0:02.42 init
> 7381 root 17 -4 12612 676 356 S 0.0 0.0 0:00.00 udevd
> 7891 root 15 0 5916 608 488 S 0.0 0.0 0:00.01 syslogd
> 7902 dbus 18 0 21264 692 484 S 0.0 0.0 0:00.00 dbus-daemon
> 7968 sw-cp-se 15 0 58968 1240 560 S 0.0 0.0 0:00.00 sw-cp-serverd
> 7979 root 15 0 62632 1200 644 S 0.0 0.0 0:00.00 sshd
> 7989 root 18 0 21652 960 736 S 0.0 0.0 0:00.00 xinetd
> 8008 root 25 0 13172 596 464 S 0.0 0.0 0:00.00 couriertcpd
> 8010 root 18 0 3664 380 312 S 0.0 0.0 0:00.00 courierlogger
> 8028 root 15 0 13172 640 500 S 0.0 0.0 0:00.00 couriertcpd
> 8052 root 18 0 3664 456 380 S 0.0 0.0 0:00.00 courierlogger
> 8059 root 15 0 13172 644 500 S 0.0 0.0 0:00.00 couriertcpd
> 8061 root 18 0 3664 452 380 S 0.0 0.0 0:00.00 courierlogger
> 8069 root 18 0 13172 644 500 S 0.0 0.0 0:00.00 couriertcpd
> 8072 root 18 0 3664 452 380 S 0.0 0.0 0:00.00 courierlogger
> 8084 qmails 18 0 3852 548 440 S 0.0 0.0 0:00.00 qmail-send
> 8086 qmaill 18 0 3804 548 460 S 0.0 0.0 0:00.00 splogger
> 8087 root 18 0 3844 448 336 S 0.0 0.0 0:00.00 qmail-lspawn
> 8088 qmailr 18 0 3844 460 340 S 0.0 0.0 0:00.00 qmail-rspawn
> 8089 qmailq 18 0 3800 408 328 S 0.0 0.0 0:00.00 qmail-clean
> 9390 root 18 0 11936 1440 1176 S 0.0 0.0 0:00.02 mysqld_safe
> 9543 mysql 18 0 336m 107m 6552 S 0.0 3.6 1:07.66 mysqld
> 9712 root 18 0 104m 44m 2460 S 0.0 1.5 0:01.03 spamd
> 9774 popuser 18 0 104m 43m 968 S 0.0 1.4 0:00.00 spamd
> 10030 root 18 0 429m 20m 9332 S 0.0 0.7 0:00.33 httpd
> 10036 apache 18 0 217m 7364 472 S 0.0 0.2 0:00.00 httpd
> 11386 root 18 0 20876 1184 580 S 0.0 0.0 0:00.01 crond
> 11502 apache 15 0 1077m 741m 98m S 0.0 24.6 1:49.86 httpd
> 11546 apache 15 0 1035m 690m 87m S 0.0 22.9 1:44.07 httpd
> 11548 apache 15 0 1080m 744m 101m S 0.0 24.7 1:50.49 httpd
> 17908 root 15 0 96584 3704 2840 S 0.0 0.1 0:00.19 sshd
> 18289 erik 15 0 96584 2040 1160 S 0.0 0.1 0:00.66 sshd
> 18303 erik 15 0 12068 1608 1268 S 0.0 0.1 0:00.00 bash
> 19543 root 15 0 76520 2624 1972 S 0.0 0.1 0:00.00 su
> 19824 root 15 0 12072 1644 1276 S 0.0 0.1 0:00.01 bash
> 20009 root 15 0 12616 1220 936 R 0.0 0.0 0:05.06 top
> 25653 apache 18 0 813m 418m 85m S 0.0 13.9 1:45.85 httpd
> 30492 apache 18 0 907m 481m 95m S 0.0 16.0 2:01.99 httpd
>
> [root@xxxx xxxx]# ls
> bash: fork: Cannot allocate memory
> --------------------------------------------------------------------------------
>
>
>
>
>
>
>
> Michael Herchel
> Network Administrator
> Florida High School Athletic Association
> http://www.fhsaa.org
> (352) 372-9551 x120 | [log in to unmask]
> ----------
> Become a FHSAA Official! Earn part-time income! Your local high schools need umpires and referees.
> http://www.BecomeAnOfficial.org
>
>
> -----Original Message-----
> From: Platform Independent Linux List! [mailto:[log in to unmask]] On Behalf Of Dan Stoner
> Sent: Thursday, July 28, 2011 9:59 AM
> To: [log in to unmask]
> Subject: Re: Need Help with Memory Errors on LAMP Server
>
> Hi Michael,
>
> It sounds like you might actually be hitting a disk space issue, or
> apache is trying to create a temporary file and the permissions changes
> you made are causing this to fail.
>
> Notice you said
>
> "(tried to allocate 22864841 bytes) in /var/www.."
>
>
> Please run this command to see how your disk space looks:
>
> # df -h
>
>
> Please run this command to capture some process and memory information
> about the VPS guest:
>
> # top -b -n 1 | head -n 20
>
> Also please run these commands (if you can) when you are in the "failed"
> state, or shortly before you think the failure will occur.
>
>
>
> BTW, you didn't mention who is providing your VPS service. Not sure if
> that matters but some providers give really great technical support and
> would be happy to help.
>
>
> - Dan Stoner
>
>
>
> On 07/28/2011 09:37 AM, Michael Herchel wrote:
>> Hi,
>>
>> I have Apache, PHP and MySQL running on a CentOS 5.5 VPS.
>>
>> The problem is that some apache processes continually eat up memory which causes my CMS to fail (Fatal error: Out of memory (allocated 2097152) (tried to allocate 22864841 bytes) in /var/www..). And, when I'm logged in via SSL, I get "bash: fork: Cannot allocate memory".
>>
>> The only temporary solution is to reboot the server, but the problem re-occurs every 30 or so minutes.
>>
>> This server has ample memory for its traffic (3GB of memory and ~1500 visits/day), and this is a new issue (with no changes in the CMS (Drupal))
>>
>> This problem seemed to start when I untarred a large file on the server and attempted to reset the permissions of the extracted files. Honestly, I don't know how this could result in persistent memory errors- but that's what I did.
>>
>> I also installed APC opcode cache on the server with the goal of helping out. After I installed this (using this guide: http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html), I did not restart the apache process for several days. During that time the memory errors disappeared.
>>
>> However, when I did restart the process, the memory errors reappeared.
>>
>> So. I'm a bit of a Linux newbie (actually a Windows admin). Any help is appreciated. And, if anyone is willing to sit down with me in the next couple days and help me resolve this issue, I'd be willing to give up $100 and a couple beers for your time :)
>
>
>>
>>
>> Michael Herchel
>> Network Administrator
>> Florida High School Athletic Association
>> http://www.fhsaa.org
>> (352) 372-9551 x120 | [log in to unmask]
>> ----------
>> Become a FHSAA Official! Earn part-time income! Your local high schools need umpires and referees.
>> http://www.BecomeAnOfficial.org
>


Back to: Top of Message | Previous Page | Main LINUX-L Page

Permalink



LISTS.UFL.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager