Whats the trick?
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Frank Doud
  2. Tuesday, 11 September 2012
  3.  Subscribe via email
mod_fcgid & APC.
Rate this post:
  1. 11.09.2012 10:09:53
  2. # 1
Frank Doud Accepted Answer
Posts: 41
Joined: 21.08.2010
0
Votes
Undo
HI,

 Off the beaten path. Some of us do follow closely your words on your blog :D

Anywhos. I had gone ahead and built a server with this post in mind.
http://cloudlinux.com/blog/clnews/hosting-thousands-of-customers-on-a-cpanel-server.php

Following your advice as close as possible. Everything works except for one combination. mod_fcgid & APC. I just cannot get these two to play together as APC  uptime never exceeds 1 minute at which point it restarts and clears all the cache entries (both system and user).

Did I miss something?

Thanks
Frank
  1. 11.09.2012 10:09:31
  2. # 2
Igor Seletskiy Accepted Answer
Posts: 1200
Joined: 09.02.2010
0
Votes
Undo
Frank, 

Something for me to run. TBH: I tested eAccelerator, but given that eAccelerator wasn't updated in ages -- just assumed that APC would work. Will test (within 2 weeks) and do another post.
  1. 11.09.2012 11:09:58
  2. # 3
Steve Venter Accepted Answer
Posts: 28
Joined: 24.06.2010
0
Votes
Undo
I look forward to reading the results of your tests, Igor. We are always looking for better/more stable/optimised ways to configure our cloudlinux servers.
  1. 11.09.2012 14:09:00
  2. # 4
Richard Hordern Accepted Answer
Posts: 219
Joined: 19.03.2011
0
Votes
Undo
I think I might know why this is happening. When APC\'s cache gets full it empties itself.

I wonder if the 4 to 8 MB limit isn\'t too low for it to function correctly.

We are thinking about paying the extra and instead of 128GB ram go fo 256GB ram and try running APC with a 64MB limit thus limiting the number of times the cache gets full.


If you haven\'t got too many sites on the server yet, could you try increasing APC\'s memory limit to at least 32MB to see if this solves the problem ?
  1. 11.09.2012 14:09:17
  2. # 5
Frank Doud Accepted Answer
Posts: 41
Joined: 21.08.2010
0
Votes
Undo
Hi,

I already had adjusted for that:

Runtime Settings
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 1M
apc.mmap_file_mask /tmp/apc.g8R04l
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 64M
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
  1. 11.09.2012 14:09:04
  2. # 6
Steve Venter Accepted Answer
Posts: 28
Joined: 24.06.2010
0
Votes
Undo
Have you tried using xcache instead? We switched all our servers that were using apc to xcache, and have found it significantly more stable.
  1. 11.09.2012 23:09:20
  2. # 7
Frank Doud Accepted Answer
Posts: 41
Joined: 21.08.2010
0
Votes
Undo
Thanks for the suggestion. I am going to hang out and see what Igor comes up with.


Thanks
Frank
  1. 12.09.2012 03:09:53
  2. # 8
Richard Hordern Accepted Answer
Posts: 219
Joined: 19.03.2011
0
Votes
Undo
Try changing this line :

apc.mmap_file_mask /tmp/apc.g8R04l 

Should be (to use memory and not disk…) :

apc.mmap_file_mask=/apc.shm.XXXXXX
  1. 16.09.2012 04:09:05
  2. # 9
Richard Hordern Accepted Answer
Posts: 219
Joined: 19.03.2011
0
Votes
Undo
I've just noticed, you say APC doesn't keep cache more then 1 minute…


Could it be this fastcgid setting ? :

FcgidIdleTimeout 60

If a fastcgi process is destroyed then it's cache will be too…


With this set to 60, on a busy site the cache will do it's job well but on a site with only a few visits per day the cache will work so long as the visiters don't spend more then 60s before reloading or changing page.


Can you try setting it to 180s and see if the cache lasts longer then two minutes ?
  1. 16.09.2012 14:09:04
  2. # 10
Frank Doud Accepted Answer
Posts: 41
Joined: 21.08.2010
0
Votes
Undo
Hi,

I believe this is the main issue:
APC is not very effective when using mod_fcgid. It just can\'t share its memory across subsequent requests to the same php code if those requests get routed to seperate php-cgi processes.

Chances are there is a work around. Its just above my pay scale LOL
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.