APC Cache / PhpBB3

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

APC Cache / PhpBB3

Post by diskaranze »

Hi,
I try to use APC Cache with Phpbb 3.0.10.
We have a dedicated server, with 4gb ram and quadcore doubleprocessor.
Apc installed.
phpbb is 3.0.10, basic installed, since first version, not mod'ed.

I changed config.php acm_type line to "apc"..
but board still using file-caching (/cache)...

How can I enable APC for Phpbb3 completely..
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: APC Cache / PhpBB3

Post by Erik Frèrejean »

diskaranze wrote:I changed config.php acm_type line to "apc"..
but board still using file-caching (/cache)...
Aren't these old files from before the switch? Clear that directory and see whether they are re-generated. If you change the config entry there isn't a reason phpBB will use a different backend.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

I cannot see any acitivities at "apc.php" status file.
Apc enabled on the server.
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: APC Cache / PhpBB3

Post by Erik Frèrejean »

diskaranze wrote:I cannot see any acitivities at "apc.php" status file.
which acp status file?

Have you tried clearing the cache directory to verify phpBB is actually caching to file?

Please fill out the Support Request Template Generator and post it back here to enable us to assist you better.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

Support Request Template
What version of phpBB are you using? phpBB 3.0.10
What is your board's URL? - (Huge forumi 35.000 usersi 2GB db)
Who do you host your board with? Own dedicated server
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
What version of phpBB3 did you update from? phpBB 3.0.9
What styles do you currently have installed? moded SubSilver
What language(s) is your board currently using? english
Which database type/version are you using? MySQL 5
What is your level of experience? New to PHP but not phpBB
When did your problem begin? No answer given
Please describe your problem. I want use APC Accelerator for PhpBB
Generated by SRT Generator
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: APC Cache / PhpBB3

Post by Erik Frèrejean »

Erik Frèrejean wrote:
diskaranze wrote:I cannot see any acitivities at "apc.php" status file.
which acp status file?

Have you tried clearing the cache directory to verify phpBB is actually caching to file?
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

Sorry, Not ACP
APC Status file.
apc.php, coming with APC Accelerator pckg.

I cannot enable APC for PhpBB..
I think, my board still using /cache system, via file-caching.

my board has a huge users and db, we need better performance and increasin traffic.
But in last months running too much slowly, we got too much "mysql socks error"..
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: APC Cache / PhpBB3

Post by Erik Frèrejean »

diskaranze wrote:I cannot enable APC for PhpBB..
I think, my board still using /cache system, via file-caching.
Please verify, by clearing the directory and reload a page. If the files get regenerated it indeed uses the file cache. Right now we're guessing on what *might* be happening.
diskaranze wrote:APC Status file.
apc.php, coming with APC Accelerator pckg.
Are you sure that you correctly installed APC?
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

Erik Frèrejean wrote:
diskaranze wrote:I cannot enable APC for PhpBB..
I think, my board still using /cache system, via file-caching.
Please verify, by clearing the directory and reload a page. If the files get regenerated it indeed uses the file cache. Right now we're guessing on what *might* be happening.
diskaranze wrote:APC Status file.
apc.php, coming with APC Accelerator pckg.
Are you sure that you correctly installed APC?
Yes, now i deleted:
[root@host forum]# cd cache
[root@host cache]# rm -rf *

Reload forum page, re-generated cache-files..
But i edited "config.php" cache related line:
$acm_type = 'apc';


I think APC installed correctly, when i look at php information table:
-apc section-
http://img35.imageshack.us/img35/3318/capture27b.jpg

Maybe i do wrong in "usr/lib/local/php.ini" APC section.

my php.ini APC Section:

Code: Select all

; Enable apc extension module
extension = apc.so

; Options for the APC module version >= 3.1.3
; See http://www.php.net/manual/en/apc.configuration.php

; This can be set to 0 to disable APC.
apc.enabled=1
; The number of shared memory segments to allocate for the compiler cache.
apc.shm_segments=1
; The size of each shared memory segment, with M/G suffixe
apc.shm_size=100M
; A "hint" about the number of distinct source files that will be included or
; requested on your web server. Set to zero or omit if you're not sure;
apc.num_files_hint=1024
; Just like num_files_hint, a "hint" about the number of distinct user cache
; variables to store.  Set to zero or omit if you're not sure;
apc.user_entries_hint=4096
; The number of seconds a cache entry is allowed to idle in a slot in case this
; cache entry slot is needed by another entry.
;apc.ttl=7200
apc.ttl = 7200
apc.user_ttl = 7200
; use the SAPI request start time for TTL
apc.use_request_time=1
; The number of seconds a user cache entry is allowed to idle in a slot in case
; this cache entry slot is needed by another entry.
;apc.user_ttl=7200
; The number of seconds that a cache entry may remain on the garbage-collection list.
apc.gc_ttl=3600
; On by default, but can be set to off and used in conjunction with positive
; apc.filters so that files are only cached if matched by a positive filter.
apc.cache_by_default=1
; A comma-separated list of POSIX extended regular expressions.
apc.filters = "apcx\.php$"
; The mktemp-style file_mask to pass to the mmap module
apc.mmap_file_mask=/tmp/apc.XXXXXX
;apc.mmap_file_mask = "${path}\tmp\apc.XXXXXX"
; This file_update_protection setting puts a delay on caching brand new files.
apc.file_update_protection=2
; Setting this enables APC for the CLI version of PHP (Mostly for testing and debugging).
apc.enable_cli=0
; Prevents large files from being cached
apc.max_file_size=1M
; Whether to stat the main script file and the fullpath includes.
apc.stat=1
; Vertification with ctime will avoid problems caused by programs such as svn or rsync by making
; sure inodes havn't changed since the last stat. APC will normally only check mtime.
apc.stat_ctime=1
; Whether to canonicalize paths in stat=0 mode or fall back to stat behaviour
apc.canonicalize=0
; With write_lock enabled, only one process at a time will try to compile an
; uncached script while the other processes will run uncached
apc.write_lock=1
; Logs any scripts that were automatically excluded from being cached due to early/late binding issues.
apc.report_autofilter=0
; RFC1867 File Upload Progress hook handler
apc.rfc1867=0
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600
; Optimize include_once and require_once calls and avoid the expensive system calls used.
apc.include_once_override=0
apc.lazy_classes=0
apc.lazy_functions=0
; Enables APC handling of signals, such as SIGSEGV, that write core files when signaled.
; APC will attempt to unmap the shared memory segment in order to exclude it from the core file
apc.coredump_unmap=0
; Records a md5 hash of files.
apc.file_md5=0
; not documented
apc.preload_path
apc.serializer=igbinary
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: APC Cache / PhpBB3

Post by Erik Frèrejean »

diskaranze wrote:
Erik Frèrejean wrote:
diskaranze wrote:I cannot enable APC for PhpBB..
I think, my board still using /cache system, via file-caching.
Please verify, by clearing the directory and reload a page. If the files get regenerated it indeed uses the file cache. Right now we're guessing on what *might* be happening.
diskaranze wrote:APC Status file.
apc.php, coming with APC Accelerator pckg.
Are you sure that you correctly installed APC?
Yes, now i deleted:
[root@host forum]# cd cache
[root@host cache]# rm -rf *
That in it self should be enough. If APC is configured incorrectly it probably would thrown an error because it doesn't fall back to the file cache.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

So, in this case, it seems like my phpbb doesnt take acm_type option via config.php
in the other hand, APC installed correctly but "apc.php" status file have no any activities...

what should I do?
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: APC Cache / PhpBB3

Post by igorw »

Which files are being re-generated in /cache? Can you paste a full list? The thing is: template compilation does not use the cache driver, so it will always compile to disk. You may simply be seeing the template compilation in the cache directory.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

Yes, most of template files caching..

[root@host cache]# ls
ctpl_admin_acp_logs.html.php ctpl_en-email_privmsg_notify.txt.php tpl_boxxx_memberlist_view.html.php tpl_boxxx_ucp_footer.html.php
ctpl_admin_acp_main.html.php ctpl_tr-email_forum_notify.txt.php tpl_boxxx_message_body.html.php tpl_boxxx_ucp_header.html.php
ctpl_admin_acp_users_avatar.html.php ctpl_tr-email_privmsg_notify.txt.php tpl_boxxx_overall_footer.html.php tpl_boxxx_ucp_main_front.html.php
ctpl_admin_acp_users_feedback.html.php ctpl_tr-email_topic_notify.txt.php tpl_boxxx_overall_header.html.php tpl_boxxx_ucp_pm_history.html.php
ctpl_admin_acp_users.html.php queue.php tpl_boxxx_pagination.html.php tpl_boxxx_ucp_pm_message_footer.html.php
ctpl_admin_acp_users_overview.html.php tpl_boxxx_attachment.html.php tpl_boxxx_posting_attach_body.html.php tpl_boxxx_ucp_pm_message_header.html.php
ctpl_admin_acp_users_prefs.html.php tpl_boxxx_breadcrumbs.html.php tpl_boxxx_posting_body.html.php tpl_boxxx_ucp_pm_viewfolder.html.php
ctpl_admin_acp_users_profile.html.php tpl_boxxx_faq_body.html.php tpl_boxxx_posting_buttons.html.php tpl_boxxx_ucp_pm_viewmessage.html.php
ctpl_admin_acp_users_signature.html.php tpl_boxxx_forumlist_body.html.php tpl_boxxx_posting_poll_body.html.php tpl_boxxx_ucp_remind.html.php
ctpl_admin_acp_users_warnings.html.php tpl_boxxx_index_body.html.php tpl_boxxx_posting_preview.html.php tpl_boxxx_viewforum_body.html.php
ctpl_admin_message_body.html.php tpl_boxxx_jumpbox.html.php tpl_boxxx_posting_review.html.php tpl_boxxx_viewtopic_body.html.php
ctpl_admin_overall_footer.html.php tpl_boxxx_login_body.html.php tpl_boxxx_posting_topic_review.html.php tpl_boxxx_viewtopic_print.html.php
ctpl_admin_overall_header.html.php tpl_boxxx_mcp_footer.html.php tpl_boxxx_searchbox.html.php
ctpl_admin_permission_mask.html.php tpl_boxxx_mcp_front.html.php tpl_boxxx_search_results.html.php
ctpl_en-email_forum_notify.txt.php tpl_boxxx_mcp_header.html.php tpl_boxxx_ucp_agreement.html.php

When i look at APC Opcode Cache, monitoring page: apc.php
No activities.

Code: Select all

General Cache Information
APC Version	3.1.9
PHP Version	5.2.17
APC Host	-
Server Software	Apache
Shared Memory	1 Segment(s) with 100.0 MBytes
(mmap memory, pthread mutex Locks locking)
Start Time	2012/02/06 11:49:23
[b]Uptime	0 minutes[/b]
File Upload Support	1
apc.php says: "Uptime 0 minutes"
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: APC Cache / PhpBB3

Post by igorw »

Well that's entirely unrelated to phpBB's caching.

APC provides two things. A opcode cache and an in-memory key-value store.

The opcode cache is the "PHP acceleration" mechanism that caches the opcodes of PHP files. This is nothing specific to phpBB. It will basically make any PHP file faster because it doesn't have to parse the PHP language on every page load. It just executes the cached bytecode/opcodes. This is for some reason not working, and you should try googling for 'apc "Uptime 0 minutes"'.

The key-value store is what phpBB's APC cache driver uses. It provides a simple interface to store data in memory, which makes it faster than a file-based caching. It seems to be working just fine. At least it's not storing anything on the filesystem.

Hope that helps.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
diskaranze
Registered User
Posts: 8
Joined: Mon Feb 06, 2012 11:43 am

Re: APC Cache / PhpBB3

Post by diskaranze »

Thanks Igor.
Actually I am reading APC Uptime 0 Minutes related pages from Google.
Most of people have ask same things about APC & PhpBB problems..

Regards,
Locked

Return to “[3.0.x] Support Forum”