1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xcache or apc + memcache ?

Discussion in 'General PHP and MySQL Discussions' started by optimus, Nov 11, 2013.

  1. optimus

    optimus Member

    Hi,

    I have an forum with ~100 users online and some good activity, but my php gona crazy now i'm ussing nginx as webserver + php-fpm 5.4 and memcache, there are some writes from notification system and my vps have an huge load ~3.0 with 2 core and 1gb ram.

    What sugestion can be better for me with this configuration, work to user APC or xcache in same time with memcache ? and which configuration need to use.

    Right now have this
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array(
                                            'caching'                      => true,
                                            'automatic_serialization'    => true,
                                            'lifetime'                    => 7200,
                                            'cache_id_prefix' => 'forumxs_'
    );
    
    
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
                'servers' =>array(
                                array(
                                    'host' => '127.0.0.1', // your memcached server ip /address
                                    'port' => 11211        // memcached port
                                )
                            ),
                'compression' => false
    );
     
  2. MattW

    MattW Well-Known Member

    Yes, use Xcache or APC as your OPCode cache for the compiled PHP pages.

    I personally don't use memcached for the back end, and have Xcache do that as well.
     
  3. optimus

    optimus Member

    Code:
    $config['cache']['backend'] = 'Xcache';
    and
    Code:
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
    'servers' =>array(
    array(
    'host' => '127.0.0.1', // your memcached server ip /address
    'port' => 11211 // memcached port
    )
    ),
    'compression' => false
    );
    in same time, or xcache will compile it by default without to edit something in config.php ?
     
  4. MattW

    MattW Well-Known Member

    Xcach will just work for your compiled PHP pages. If you want to use it for the back end caching, you need to remove the memcached settings in the config.php file.

    If you want to still use memcached, leave the config file as it is
     
  5. optimus

    optimus Member

    Thank you, I do how you say, now xcache compile entire page, for variable need to be added in config.php, now for me is much better, from ~2 - 3 load come down to 0.30-0.40, taigachat is a killer for xenforo my chat is verry used 1 - 2 msg / second.

    [​IMG]
     

Share This Page