Jump to content

How to set IPB 2.2 use Eaccelerator or Xcache or Mysqli?


Guest backdream

Recommended Posts

I see it in the feature list:
1. A caching class system has been installed. eaccelerator, disk caching, turck mmcache, and memcache are directly supported. Other caching engines can be used, however many do not have API's allowing IPB to take further advantage of them over their default behavior.
8. MySQLi driver support (automatically detected and selected) as well as MySQL5 support


but how to set my IPB to use it? Just set it in php.ini and install the extensions?

And please add Xcache(http://trac.lighttpd.net/xcache/wiki) support.

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

1. A caching class system has been installed. eaccelerator, disk caching, turck mmcache, and memcache are directly supported. Other caching engines can be used, however many do not have API's allowing IPB to take further advantage of them over their default behavior.


this mainly means those CACHING products for your server are now supported fully

Link to comment
Share on other sites

Yes, the caching systems are supported but you need to add a line to the conf_global.php to enable them.

Documentation will probably be released shortly with what to add.

MySQLi is automatically detected and used, unlike the caching sytems.

If I remember correctly, to enable eAccelerator support you add this at the top of conf_global.php (after <?php of course):
$INFO['use_eaccelerator'] = 1;

Rebuild all your caches after also.

Link to comment
Share on other sites

If I remember correctly, to enable eAccelerator support you add this at the top of conf_global.php (after <?php of course):


$INFO['use_eaccelerator'] = 1;



Rebuild all your caches after also.


How did you know this? I thought it is automatically enabled once you installed eaccelerator. I see many of the cached scripts by when running eaccelerator.php. :blink: and what about Zend? Do you need to add a line in conf_global.php too?
Link to comment
Share on other sites

damn, all this time I thought eaccelerator was enabled on my boards :o


In fact, if eAccelerator is installed on your server, it will cache php files. But IPB didn't do more about supporting it, it will be done with 2.2. IPB 2.2 will use some APIs of these caching systems to support them better.
Link to comment
Share on other sites

In fact, if eAccelerator is installed on your server, it will cache php files. But IPB didn't do more about supporting it, it will be done with 2.2. IPB 2.2 will use some APIs of these caching systems to support them better.


so should I add that line to conf_global.php to enable eaccelerator?
Link to comment
Share on other sites

I have had EAccelerator installed on my server for a long time and never heard about the alteration to the config file.

I just made that addition and rebuilt the caches and now the forum speed is like a scaled ape.

Thanks for the tip.

P.S. the correct change is:

$INFO['use_eaccelerator'] = '1';

Link to comment
Share on other sites

Here is an unofficial doc I wrote. Any php script can be cached by eaccelerator, however IPB 2.2 now utilizes API's provided by a few of the caching scripts so that it can directly store and retrieve data from memory.
@Invisionrocks, shouldn't be caused by the new caching engine support because member data isn't stored in cache...If in doubt, try disabling eaccelerator (if you have enabled it - if not, this issue is moot).

Invision Power Board Cache Support

Introduction
Invision Power Board uses a lot of relatively static, yet site-specific and configurable, data during page execution. An example of this would be the forum data - while it changes, and is dynamic, the forum structure itself does not change from page to page.

To counter-act resource issues, IPB caches relatively static data so that it does not need to access several individual tables on each page load. This article explains the methods IPB can cache this data, and how you can configure these methods. Included is also a brief overview of how you could create a new caching class, should you find it necessary.

If you decide to use an alternate cache class, after enabling it you may wish to log into your ACP and rebuild all of your caches under Tools & Settings, Cache Control. Click the button at the top right of the header, and click Rebuild All.

Database Cache (Default)
By default in IPB 2.2 (as occurred in IPB 2.1) Invision Power Board serializes and caches it's data in the ibf_cache_store database table. One query is used when the page first starts to load to pull the specific 'cache store' keys that it will use during page execution. No changes are necessary to use this cache method.

If you find that this database table repeatedly 'locks' (using MySQL) you can try setting this database table engine to InnoDB to attempt to prevent it from locking when multiple users are accessing the same data.

Disk Cache
If you find that your ibf_cache_store still locks after setting the table type to InnoDB, you can use the disk cache method if you prefer. In order to use this cache method

1) You cannot be running under safe_mode
2) Your ./cache folder must be CHMOD 777

When the method is enabled, IPB will create and write to files in this folder to pull the cache data it requires. While profiling the cache methods available in IPB, this method was found to be the slowest, and as such it is not recommended to use disk caching unless necessary.

To enable disk caching, open your ./conf_global.php file in a text editor. Find

and add after this line of code

$INFO['use_diskcache'] = 1;



Save the file and upload it back to your server.

Turck MMCache
Turck MMCache is no longer in development. The module has evolved into Eaccelerator, however if you have an older version of PHP with Turck MMCache installed, you can make use of IPB's support for it by modifying your conf_global.php file. Find:

and add after this line of code

$INFO['use_mmcache'] = 1;



Turck MMCache will cache the data into memory cutting access time drastically. Outside of IPB's support for cache storage, Turck MMCache also caches php code in a compiled state, reducing php execution time of scripts. More information about Turck MMCache can be found here

Eaccelerator
Eaccelerator is probably the most popular cache engine installed on shared and dedicated servers presently. Eaccelerator is a brach off of the original Turck MMCache software, and performs in the same manner as the original Turck MMCache. If you login to your ACP, click on PHPINFO, and search for "Eaccelerator" you may find it is already installed.

To enable IPB's support for eaccelerator, open conf_global.php and find

add after this line of code

$INFO['use_eaccelerator'] = 1;



More information regarding eaccelerator can be found here

MemCache
Memcache is a distributed memory object caching system with the intended implementation designed to reduce load to the database by storing data that is accessed consistently in memory. IPB can utilize memcache just as it utilizes Eaccelerator, or the database directly.

To enable IPB's support for memcache, open conf_global.php and find

and add after this line of code

$INFO['memcache_server_1'] = "SERVER ADDRESS HERE";$INFO['memcache_port_1'] = "SERVER PORT HERE";

$INFO['use_memcache'] = 1;



It is important to configure the server address and port when adding this information to your conf_global.php file.

Additionally, IPB can support up to two additional memcache slaves. If you have more than one memcache server, you can configure up to two more by adding

$INFO['memcache_port_2'] = "SERVER 2 PORT HERE";$INFO['memcache_server_3'] = "SERVER 3 ADDRESS HERE"; $INFO['memcache_port_3'] = "SERVER 3 PORT HERE";

$INFO['memcache_server_2'] = "SERVER 2 ADDRESS HERE";





Creating your own cache engine library
While we are not aware of any other third party cache engines available, if you wished to create a module to access one (such as custom in-house caching engine), two steps would need to be taken.

  • Modify ipsclass.php method init_cache_setup() and add code similar to the following

            $this->cachelib = new cache_lib( $this->vars['board_url'] );                        $this->cachelib->connect( $this->vars );

require KERNEL_PATH.'class_cache_memcache.php';




Point this to the name of the file you locate under ./ips_kernel (see the next step)

  • Create a new class to place in ./ips_kernel to support your cache library. This will be custom-developed to support your application, however here is a basic template with all the methods called from IPB

/*+--------------------------------------------------------------------------|   Invision Power Services Kernel [Cache Abstraction]|    Invision Power Board v<{%dyn.down.var.human.version%}>|   =============================================|   by Matthew Mecham|   (c) 2001 - 2005 Invision Power Services, Inc.|   http://www.invisionpower.com|   =============================================|   Web: http://www.invisionboard.com+---------------------------------------------------------------------------|   THIS IS NOT FREE / OPEN SOURCE SOFTWARE+---------------------------------------------------------------------------||   > Core Module|   > Module written by Brandon Farber|   > Date started: Friday 19th May 2006 17:33 ||    > Module Version Number: 1.0+--------------------------------------------------------------------------*//*** IPS Kernel Pages: Cache Object Core*    -- Memcache Cache Storage** Basic Usage Examples* * $cache = new cache_lib( 'identifier' );* Update:* $db->do_put( 'key', 'value' [, 'ttl'] );* Remove* $db->do_remove( 'key' );* Retrieve* $db->do_get( 'key' );* *          * @package        IPS_KERNEL* @subpackage    Cache Abstraction* @author       Brandon Mecham* @version        1.0*/class cache_lib{    var $identifier;    var $crashed        = 0;        var $link;            function cache_lib( $identifier='' )    {        // Object constructor if necessary    }            function connect( $server_info=array() )    {        // Connection/ error-checking/ initialization routine    }            function disconnect()    {        // Disconnect routine, if necessary, otherwise leave blank    }            function do_put( $key, $value, $ttl=0 )    {        // Puts data in cache    }        function do_get( $key )    {        // Retrieves and returns data from cache    }        function do_remove( $key )    {        // Removes data from cache    }}?>

<?php






















































































If an error is encountered during the library setup, set $this->crashed = 1 so that IPB will know not to access it throughout it's execution.

Notes

  • IPS will not install or support any third party cache engine libraries - you (or your host) must install any cache library (such as eaccelerator or memcache) and ensure it is operational. During troubleshooting, if we determine the cache engine itself is the fault of any issues, we may disable it to verify as such.
  • IPB only caches skin set data, and the data in ibf_cache_store - it does not cache all content
Link to comment
Share on other sites

  • 3 weeks later...

No, they are not the same thing. They do have SOME similarities however.

The main similarity is that they both cache php opcode so it doesn't have to be parsed at runtime.

The main DIFFERENCE, and this is where IPB's new support comes into play, is that with eaccelerator you can actually access the memory directly - storing data into memory, and retrieving data from memory (instead of the database). Zend optimizer offers no such support.

It's sound good. And please add Xcache(http://trac.lighttpd.net/xcache/wiki) support.



Have you read the feature list of that software? :)

Xcache does not appear to have any API's to let you access memory directly, as turck-mmcache, memcache, and eaccelerator do. In other words, you can install Xcache, and IPB does not have to do anything to support it - but it also cannot make use of any additional functionality. With the others that we added support for, there are additional API's to help alleviate resources, and is why IPB supports those (and not XYZ cache engine). If you find any other cache engines that DO have api's to let you directly store and retrieve from memory please let me know.
Link to comment
Share on other sites

Xcache does not appear to have any API's to let you access memory directly, as turck-mmcache, memcache, and eaccelerator do. In other words, you can install Xcache, and IPB does not have to do anything to support it - but it also cannot make use of any additional functionality. With the others that we added support for, there are additional API's to help alleviate resources, and is why IPB supports those (and not XYZ cache engine). If you find any other cache engines that DO have api's to let you directly store and retrieve from memory please let me know.



It have :)

http://trac.lighttpd.net/xcache/wiki/XcacheApi/

:blink:"> <IMG style= :wub:"><IMG style=:wub:">
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...