0

PHP Fatal error: PHP Startup: apc_mmap: mmap failed: in Unknown on line 0

[Sun Aug 11 06:45:16 2013] [notice] seg fault or similar nasty error detected in the parent process

The system (Ubuntu 12.04.2) was at 18% of total memory and APC was using 32% of apc.shm_size, so it wasn't for lack of memory. Any ideas what could be going wrong?

I also have these two entries at the same time in syslog

Aug 11 06:45:16 ip-10-145-209-85 rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="718" x-info="http://www.rsyslog.com"] rsyslogd was HUPed

Aug 11 06:45:16 ip-10-145-209-85 rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="718" x-info="http://www.rsyslog.com"] rsyslogd was HUPed

Nick
  • 171
  • 1
  • 1
  • 6
  • Looks like logrotation is taking place? – Marki Aug 18 '13 at 16:48
  • Ok... "every 4th sunday"... maybe not logrotation after all. What does the crontab contain? – Marki Aug 18 '13 at 17:02
  • Crontab does not contain anything for that time, but the logs do in fact rotate at that exact time. Why would that mess with APC, and what could I do to fix? – Nick Aug 18 '13 at 17:10
  • Well if the logs rotate then there is something either in the user's crontab (/var/spool/cron.../) or the system crontabs (/etc/crontab, /etc/cron.d/, /etc/cron.something). I suppose if apc crashes at that moment it doesn't like when logfiles are moved away, maybe you also need to give a signal to APC just like rsyslog gets a signal. If I were you I would investigate in that direction (APC/logrotation). – Marki Aug 18 '13 at 18:05

1 Answers1

1

let's take closer look:

PHP Fatal error: PHP Startup: apc_mmap: mmap failed: in Unknown on line 0

First keyword is "PHP Startup". This means that process is reloaded/restarted/respawn etc. But service couldn't start. Reason for respawn? There are lot of them. I'm quite sure there is nothing to do with the cron and logrotation.

Second keyword is "apc_mmap: mmap failed". I guess there is not enough shared memory.

Check sysctl -a|grep shmmax. Tune it to reasonable maximum.

Please update post with apc configuration from php.ini.

GioMac
  • 4,544
  • 4
  • 27
  • 41
  • The system has 15GB of memory and was at 40% when apache crashed, here are some settings: kernel.shmmax = 15032385536 apc.shm_size=5G apc.ttl=86400 apc.shm_segments=1 apc.max_file_size=10M apc.rfc1867 = On – Nick Aug 19 '13 at 05:20
  • hm... memory_limit ? – GioMac Aug 19 '13 at 10:13
  • memory_limit = 128M – Nick Aug 20 '13 at 04:43
  • Distro? Package versions? any "segfaults" in /var/log/syslog? – GioMac Aug 20 '13 at 04:54
  • I think I found the cause. I ran out of ionodes in my session folder. Whenever that limit is reached by sunday morning, the server crashes. – Nick Aug 31 '13 at 22:37