Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have a problem with my APC and Apache. Since i have been installed APC on my VPS, i face to many problems. Here is one of them.

My Apache keeps falling down, server port :80 is available, but its giving me error message.

My Configuration: /etc/php5/conf.d/apc.ini

extension=apc.so
apc.shm_size=30
apc.shm_segments=1
apc.write_lock = 1
apc.rfc1867 = On
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/dev/zero
apc.enable_cli=1

Error in Apache Log:

    [Tue Mar  4 13:49:42 2014] [apc-error] apc_mmap: mmap failed: Cannot allocate memory
    [Tue Mar  4 13:49:47 2014] [apc-error] apc_mmap: mmap failed: Cannot allocate memory
    [Tue Mar  4 13:49:47 2014] [apc-error] apc_mmap: mmap failed: Cannot allocate memory
    [Tue Mar  4 13:48:39 2014] [apc-warning] Unable to allocate memory for pool. in /var/www/vhosts/xxx.com/xxx/application/libraries/Engine/Loader.php on line 103.

I dont know why i have this problems, when in my APC.ini i have apc.shm_size defined.

share|improve this question
    
Please provide more info about your system. Free RAM, PHP & apc version etc. Maybe you just ran out of memory or if your apc version is above If your version is 3.1.5 you might have to add a M to apc.shm_size –  justlovingIT Mar 4 at 13:42
    
I post my solution bellow. –  Seik Mar 4 at 14:05

1 Answer 1

-> PHP Version 5.3.3-7+squeeze18
-> APC Version  3.1.3p1
->      total       used       free     shared    buffers     cached
Mem:     4096       2699       1396          0          0     1205


My Apache Error Log is clean now after i setup apc.ini as this:

extension=apc.so
apc.shm_size=96
apc.shm_segments=1
apc.write_lock = 1
apc.rfc1867 = On
apc.ttl=3600
apc.user_ttl=3600
apc.gc_ttl=3600
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1

I think the trouble makes apc.mmap_file_mask and shm_size is incrased without problem. Now my apache is clean.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.