LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > High APC Fragmentation

Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2012, 11:22 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Question High APC Fragmentation

Hi,

I use 2-cpu license litespeed.
I use apc and i have uploaded apc.php.
my apc.ttl is 0.
But apc.php shows very high fragmentation every time i refresh apc.php (my site is busy site), it can reach up to 50%.
what should i do?

Code:
apc.cache_by_default	1
apc.canonicalize	1
apc.coredump_unmap	0
apc.enable_cli	1
apc.enabled	1
apc.file_md5	0
apc.file_update_protection	2
apc.filters	
apc.gc_ttl	3600
apc.include_once_override	0
apc.lazy_classes	0
apc.lazy_functions	0
apc.max_file_size	20M
apc.mmap_file_mask	
apc.num_files_hint	1000
apc.preload_path	
apc.report_autofilter	0
apc.rfc1867	0
apc.rfc1867_freq	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_
apc.rfc1867_ttl	3600
apc.serializer	default
apc.shm_segments	1
apc.shm_size	256M
apc.slam_defense	1
apc.stat	1
apc.stat_ctime	0
apc.ttl	0
apc.use_request_time	1
apc.user_entries_hint	4096
apc.user_ttl	7200
apc.write_lock	1
Attached Images
File Type: jpg apc.jpg (53.9 KB, 7 views)
Reply With Quote
  #2  
Old 04-19-2012, 01:31 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
try increase apc.shm_size (=> 512M)

also apc.stat=0

Last edited by webizen; 04-19-2012 at 01:39 AM..
Reply With Quote
  #3  
Old 04-19-2012, 06:17 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by webizen View Post
try increase apc.shm_size (=> 512M)

also apc.stat=0
thanks, apc.stat is 0 now, but once i changed apc.shm_size to 512m, i started getting 503 error on all domains on my server.

Eventhough i have enough free ram (i think)
Code:
root@mybox [/home/xxxxx]# free -m
total used free shared buffers cached
Mem: 12001 7501 4500 0 1229 3169
-/+ buffers/cache: 3102 8899
Swap: 2047 0 2047
Once i reverted it back to 256m, the 503 error gone. Do you think i need to upgrade my RAM although i have "enough" (IMO) ram?
__________________
I use litespeed

Last edited by semprot; 04-19-2012 at 10:45 AM..
Reply With Quote
  #4  
Old 04-19-2012, 10:08 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
increase memory limit (soft/hard) in lsphp5 external app by 256M
Reply With Quote
  #5  
Old 04-19-2012, 09:48 PM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by webizen View Post
increase memory limit (soft/hard) in lsphp5 external app by 256M
Thanks.. It works.. At least i will try to increase memory limit once i get 503 / high fragmentation again..
__________________
I use litespeed

Last edited by semprot; 04-23-2012 at 12:53 PM..
Reply With Quote
  #6  
Old 04-26-2012, 01:39 PM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
After the litespeed was rebuilt recently, i started getting random 503 errors (not always as old situation) -- even with less traffic.
even though memory soft & hard limit have been set to 1024mb.

APC settings are still the same, at least :
- shm_size is 512mb
- ttl is 0
- stat is 0

Probably some other old litespeed settings were gone?
Is there any other settings other than memory soft & hard limit that i should check?
__________________
I use litespeed

Last edited by semprot; 04-26-2012 at 01:43 PM..
Reply With Quote
  #7  
Old 04-26-2012, 03:14 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
Pls chk error log & stderr.log for any context
Reply With Quote
  #8  
Old 04-26-2012, 08:07 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
Quote:
After the litespeed was rebuilt recently, i started getting random 503 errors
try
apc.mmap_file_mask=/tmp/APC.XXXXXX
Reply With Quote
  #9  
Old 04-27-2012, 08:44 PM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
Quote:
Originally Posted by semprot View Post
After the litespeed was rebuilt recently, i started getting random 503 errors (not always as old situation) -- even with less traffic.
even though memory soft & hard limit have been set to 1024mb.

APC settings are still the same, at least :
- shm_size is 512mb
- ttl is 0
- stat is 0

Probably some other old litespeed settings were gone?
Is there any other settings other than memory soft & hard limit that i should check?
why set ttl = 0 your memory usage will keep increasing, usually for APC i have something like

Code:
apc.ttl=7200
apc.user_ttl=3600
apc.gc_ttl = 600
never had any problems with Litespeed and LSPHP + APC

Of course make sure you aren't using LSPHP with phpSuExec for opcode cache use. I have a mysqlmymonlite.sh script to check for that http://mysqlmymon.com/#litespeedstats

Code:
phpSuExec = 0
Code:
------------------------------------------------
Litespeed Server & LSAPI PHP Info:
------------------------------------------------
Litespeed web server version: 4.1.12
WHM / Cpanel version: 11.32.2.25

LSPHP phpSuExec status: 
  < phpSuExec >0
  < phpSuExecMaxConn >20

WHM's PHP Handler config:
/usr/local/cpanel/bin/rebuild_phpconf --current

Available handlers: dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: dso
SUEXEC: enabled
RUID2: not installed

PHP 5.3.10 (litespeed) (built: Feb  7 2012 03:02:29)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Reply With Quote
  #10  
Old 04-28-2012, 06:54 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by eva2000 View Post
why set ttl = 0 your memory usage will keep increasing, usually for APC i have something like

Code:
apc.ttl=7200
apc.user_ttl=3600
apc.gc_ttl = 600
never had any problems with Litespeed and LSPHP + APC

Of course make sure you aren't using LSPHP with phpSuExec for opcode cache use. I have a mysqlmymonlite.sh script to check for that http://mysqlmymon.com/#litespeedstats

Code:
phpSuExec = 0
Code:
------------------------------------------------
Litespeed Server & LSAPI PHP Info:
------------------------------------------------
Litespeed web server version: 4.1.12
WHM / Cpanel version: 11.32.2.25

LSPHP phpSuExec status: 
  < phpSuExec >0
  < phpSuExecMaxConn >20

WHM's PHP Handler config:
/usr/local/cpanel/bin/rebuild_phpconf --current

Available handlers: dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: dso
SUEXEC: enabled
RUID2: not installed

PHP 5.3.10 (litespeed) (built: Feb  7 2012 03:02:29)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Actually before i set ttl to 0, my fragmentation is very very high. And i read solution to set ttl to 0. And it is fine.
However after everything is fine, i rebuild the php & litespeed for some reason.
Now everything is screwed, apc wont work properly.

I asked on stackoverflow but still no solution.

http://stackoverflow.com/questions/1...etimes-success
__________________
I use litespeed
Reply With Quote
Reply

Tags
apc, fragmentation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:10 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.