Caching for SMF

Started by Night09, May 15, 2008, 07:25:29 PM

Previous topic - Next topic

Night09

    SMF supports caching through the use of accelerators. The currently supported accelerators include:

  • APC
  • eAccelerator
  • Turck MMCache
  • Memcached
  • Zend Platform/Performance Suite (Not Zend Optimizer)
What accelerator would SMF recommend to use rather than just supported ?

I know these ones are compatable but was wondering which is best to use overall.

Ben_S

I'd go with APC personally.
Liverpool FC Forum with 14 million+ posts.

dschwab9

For just a single server, APC is probably the best bet.  Although there are some issues, especially with 64 bit systems, with it not expiring items correctly and then crashing with the cache gets full.  For multiple web servers, memcache is almost essential since it can share the cache between multiple servers as well as distribute the memory usage among multiple machines.

We run memcache here and I'm really happy with it.

el-brujo

I'm using now eAccelerator, but i want to install APC and tell the changes  :P

H

I use APC on my sites. Xcache is also good if you use Lighttpd as your webserver and will be supported in 2.0b4+
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

rsw686

I was APC on my 64bit Fedora box. Works great for me and has decreased the page creation time by half. I haven't run into stability issues either.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Ben_S

Quote from: dschwab9 on May 16, 2008, 11:56:34 PM
Although there are some issues, especially with 64 bit systems, with it not expiring items correctly and then crashing with the cache gets full. 

Those issues are present with 32 bit systems too.
Liverpool FC Forum with 14 million+ posts.

dschwab9

Didn't realize it happens on 32 bit also.  What's interesting is I use it on zuwharrie.com, which is relatively high traffic with no problems, but when we ran it here, we were crashing the servers twice a week.

Ben_S

My old box was running cent os 32bit and was having the problem, the only way to avoid it was the set the cache large enough never to fill up fully.
Liverpool FC Forum with 14 million+ posts.

Sarge

I never had problems with APC on CentOS 4.6 64-bit.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Ben_S

As far as I could tell, ou would only have the problem if the cache got full, and the server was very busy & two processes were trying to clear the cache at the same time, that would send it into a loop crashing apache.
Liverpool FC Forum with 14 million+ posts.

stanaca

What is APC and why there is need of caching the smf?
...

H

Quote from: stanaca on May 22, 2008, 11:50:40 AM
What is APC and why there is need of caching the smf?


APC stands for alternative php cache and is one cache for php.

Caching is needed on busy sites to speed up page loads and decrease strain on the server :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

el-brujo


H

-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

hartiberlin

Quote from: nightbre on May 15, 2008, 07:25:29 PM
   SMF supports caching through the use of accelerators. The currently supported accelerators include:

  • APC
  • eAccelerator
  • Turck MMCache
  • Memcached
  • Zend Platform/Performance Suite (Not Zend Optimizer)
What accelerator would SMF recommend to use rather than just supported ?

I know these ones are compatable but was wondering which is best to use overall.

Do these above caches also work on a MySQL 4 database or only
on MySQL 5 database ?

As I am on servage.net hosting there it is told:




SMF has not been able to detect a compatible accelerator on your server.


SMF supports caching through the use of accelerators. The currently supported accelerators include:

* APC
* eAccelerator
* Turck MMCache
* Memcached
* Zend Platform/Performance Suite (Not Zend Optimizer)

Caching will only work on your server if you have PHP compiled with one of the above optimizers, or have memcache available.

SMF performs caching at a variety of levels. The higher the level of caching enabled the more CPU time will be spent retrieving cached information. If caching is available on your machine it is recommended that you try caching at level 1 first.

Note that if you use memcached you need to provide the server details in the setting below. This should be entered as a comma separated list as shown in the example below:
"server1,server2,server3:port,server4"

Note that if no port is specified SMF will use port 11211. SMF will attempt to perform rough/random load balancing across the servers.

===========


How can I setup the caching ?
Is there a cache, that also works with SMF 1.1.5 on server clusters ?
(clustered hosting) ?



dschwab9

The caches have nothing to do with the database, so the MySQL version doesn't matter at all.  However, your host would have to have one of the caching systems installed on the server before you will be able to use caching.

hartiberlin

Hmm,
I had another email exchange with my hoster and
they say, they have already running
EAccelerator on my cluster, where I am hosted.

Have a look at:

http://c37.servage.net/phpinfo.php

It says:

PHP Version 5.2.3

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v3.1.24, Copyright (c) 2002-2006, by ionCube Ltd., and
    with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies


So it seems
eAccelerator v0.9.5.1 is
running, but SMF 1.1.5 does
not recognize it.

So how can I enable caching in my admin control panel ?

Must there be still some other options enabled ?

青山 素子

eAccelerator must be built with content caching enabled. It's not a default setting.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


hartiberlin

Could this content caching still be enabled after the installation of it ?

Where and how ?

Many thanks.

timi

I'm using now eAccelerator its good cache forums.

hartiberlin

Quote from: timi on June 24, 2008, 09:09:38 AM
I'm using now eAccelerator its good cache forums.

Hi,
how did you setup eAccelerator ,
so that in the SMF admin panel it is recognized ?

What does it say in the SMF admin panel ?
What caching level is supported ?
Many thanks.

青山 素子

No, you have to re-compile eAccelerator. It's a build-time option only. You can disable content caching after it is built, but if that feature was never enabled in the configuration stage, it simply doesn't exist.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


hartiberlin

In my hosting cluster
http://c37.servage.net/phpinfo.php
the following
options are enabled:

eAccelerator
eAccelerator support   enabled
Version    0.9.5.1
Caching Enabled    true
Optimizer Enabled    true
Memory Size    67,108,828 Bytes
Memory Available    3,824 Bytes
Memory Allocated    67,105,004 Bytes
Cached Scripts    587
Removed Scripts    0
Cached Keys    0

Directive                                                                     Local Value   Master Value
eaccelerator.allowed_admin_path                                   no value   no value
eaccelerator.cache_dir   /var/cache/eaccelerator   /var/cache/eaccelerator
eaccelerator.check_mtime                                         1                     1
eaccelerator.compress                                                   1               1
eaccelerator.compress_level                                        9                    9
eaccelerator.debug                                                      0                  0
eaccelerator.enable                                                      1                  1
eaccelerator.filter                                                         no value   no value
eaccelerator.log_file                                                       no value   no value
eaccelerator.name_space                                                 no value   no value
eaccelerator.optimizer                                                      1                    1
eaccelerator.shm_max                                                    0                  0
eaccelerator.shm_only                                                     0                   0
eaccelerator.shm_prune_period                                      0                    0
eaccelerator.shm_size                                                     64                  64
eaccelerator.shm_ttl                                                       0                     0


===================================================


But SMF 1.1.5 still says, it could not detect any compatible caching...

So which parameter must be changed ?

Many thanks for your help.

Regards, Stefan.

青山 素子

#24
There is a configuration parameter missing. This means it was not compiled with content caching. If it was, you'd see "eaccelerator.content" in the list.

You must build eAccelerator with the "--with-eaccelerator-content-caching" flag or it will not support caching content. The "--with-eaccelerator-shared-memory" option might also be needed as SMF needs the _get and _put methods. Note that this is flagged as dangerous for shared hosting, so if you are on shared, your host might refuse.

All the compile-time flags are at: CompileConfiguration - eAccelerator - Trac
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


hartiberlin

Quote from: Motoko-chan on June 26, 2008, 12:56:19 PM
Note that this is flagged as dangerous for shared hosting, so if you are on shared, your host might refuse.


Many thanks for your fast answer..

Well, yes, I am on a clustered hosting at servage.net

What exactly is dangerous for the shared hosting ?
Which flags ?

Many thanks.

hartiberlin

P.S:
Would be sufficient for SMF to detect and use a supported caching just to compile
it with the
"--with-eaccelerator-content-caching" flag ?


青山 素子

Quote from: hartiberlin on June 26, 2008, 01:07:49 PM
Well, yes, I am on a clustered hosting at servage.net

What exactly is dangerous for the shared hosting ?
Which flags ?

As I said above, the "--with-eaccelerator-shared-memory" flag is marked on the documentation as possibly dangerous because it could allow someone to fill the cache. I don't think this is necessary for working.


Quote from: hartiberlin on June 26, 2008, 01:12:02 PM
P.S:
Would be sufficient for SMF to detect and use a supported caching just to compile
it with the
"--with-eaccelerator-content-caching" flag ?

No, that flag must be passed when eAccelerator is compiled from source code. You cannot change that once it has been built. Your host would need to re-build eAccelerator with this option. This has nothing to do with SMF.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


hartiberlin

So from your experience it might be
sufficient,
if my hoster would recompile the new
0.9.5.3 version
with the

"--with-eaccelerator-content-caching" flag

and then SMF 1.1.5
would recognize and could use the caching ?

hartiberlin

Could my hoster just compile the new
version 0.9.5.3

over the old version 0.9.51
and just use the



"--with-eaccelerator-content-caching" flag

during compilation and

and then SMF 1.1.5
would recognize and could use the caching ?

Or must also PHP 5.x be newly installed ?

hartiberlin

How fast must a page build up with EAccelerator working
when there are about 30 queries to the database ?

Without caching, I am getting in this moment for instance:

Page created in 0.148 seconds with 28 queries.


at my site  overunity.com

Will this be much faster with caching ?

青山 素子

A few things:


  • The edit button is there for a reason. If you need to add to your last post, edit it. Posting multiple times just makes it harder to follow things.
  • If they use that flag, it should be sufficient, according to my understanding. Building a new version of PHP depends on if they built eAccelerator as a shared object or built it directly into PHP. The host will know best how to go about it.
  • If you are getting those kinds of times, you really don't need to consider caching right now. It won't have a very big impact yet.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


hartiberlin

#32
Quote from: Motoko-chan on June 26, 2008, 02:36:11 PM

  • If you are getting those kinds of times, you really don't need to consider caching right now. It won't have a very big impact yet.


Well, what will caching then do at all ?

Where will I see a speed difference ?

Does it save any database queries ?
Cause I am limited to 100.000 queries per hour to the database at my hoster...

My hoster just informed me, that they will not recompile the eAccelerator for
their cluster, so I will have to live without the caching...
too bad...

Many thanks.

青山 素子

Quote from: hartiberlin on June 27, 2008, 04:22:37 PM
Well, what will caching then do at all ?

Under heavy demand, it will help reduce the load required on the server because much of the content will be determined already. By the time you really need it, you'll probably be on a VPS or full dedicated solution.


Quote from: hartiberlin on June 27, 2008, 04:22:37 PM
Where will I see a speed difference ?

Page creation times, mostly.


Quote from: hartiberlin on June 27, 2008, 04:22:37 PM
Does it save any database queries ?
Cause I am limited to 100.000 queries per hour to the database at my hoster...

Yes, it will. On a base SMF install it can cut queries by 25% for the main page.


Quote from: hartiberlin on June 27, 2008, 04:22:37 PM
My hoster just informed me, that they will not recompile the eAccelerator for
their cluster, so I will have to live without the caching...
too bad...

I didn't really expect they would do this. Most big hosts aren't responsive to changing things on their servers.

I guess I'll mark this as solved for now. If it isn't, mark it unsolved and reply with anything further.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


hartiberlin

Now my account is on a new cluster that supports:
eAccelerator

SMF has detected that your server has eAccelerator installed.

So now, I can enable
Level 1 caching

How much should I set the memcache setting ?

What would be the best setting for it ?

Many thanks.

hartiberlin

So, hs got nobody any idea, how to set this memcache parameter when
using eAccelerator ?

Many thanks in advance.

Regards, Stefan.

青山 素子

That field is only if you are using memcached.

Quote
Note that if you use memcached you need to provide the server details in the setting below. This should be entered as a comma separated list as shown in the example below:
"server1,server2,server3:port,server4"
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Advertisement: