MyBB Community Forums

Full Version: MyBB doesn't full support Memcache?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi guys,

My server had config caching system, i'm using Memcache and config follow Unix Socket function. I tried search info about setup memcache without TCP/IP, but may MyBB doesn't support full function for that.

Here default contents inc/config.php
$config['cache_store'] = 'memcache';

/**
 * Memcache configuration
 *  If you are using memcache as your data-cache,
 *  you need to configure the hostname and port
 *  of your memcache server below.
 *
 * If not using memcache, ignore this section.
 */

$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;
It's TCP/IP only.

I need use Unix Socket for performance and security like example
'memcached://unix:/where/memcached.sock'

How can i do that or waiting for new version for MyBB?
Hi,
(2012-02-11, 04:09 AM)killed Wrote: [ -> ]...follow Unix Socket function....

Socket Functions?

Quote:Socket Functions

The following scenario depicts a typical sequence of events in a network application using stream sockets:

A server application issues a socket call, which returns an integer that is the socket descriptor, allocated to the AF_INET addressing family.

The server uses the bind function to bind a name to the socket and allow the network access to the socket.

The server issues the listen call to signal the network that it is ready to accept connections from other applications.

The server issues an accept call to accept the connection request.

A client application issues a connect call to the server.

The client and server conduct read/write operations.

The socket is disconnected with a close call.
http://support.sas.com/documentation/onl...2bsdsf.htm

Well.... Smile

#
Let's try it this way
Answer: Part 1)

a) Your MyBB is on some type of server (either the Net or a LAN)
b) Memcached (on the same server as MyBB) doesn't require any TCP/IP connection, just localhost ~Source (Securing Memcache in 2 Minutes)


##
Answer: Part 2)
Use a non-standard port in your boot script and also replace/add this:
OPTIONS="-l 127.0.0.1" instead of the default OPTIONS="" after ' CACHESIZE= '
  • Now Memcache listens only on localhost w/ No TCP/IP.
  • If you are doing caching on several servers (distributed) then my post does not answer the question.

Hope this helps, I was just now taking a second look at Memcache w/ MyBB.



He's talking about using a unix socket...

As far as I'm aware, MyBB only allows the traditional connection via IP.
(2012-02-11, 05:48 AM)euantor Wrote: [ -> ]He's talking about using a unix socket...

As far as I'm aware, MyBB only allows the traditional connection via IP.

Both the IP and sockets are not relevant if Memcache is on the same server as MyBB (just use localhost)

(2012-02-11, 05:52 AM)seeker Wrote: [ -> ]
(2012-02-11, 05:48 AM)euantor Wrote: [ -> ]He's talking about using a unix socket...

As far as I'm aware, MyBB only allows the traditional connection via IP.

Both the IP and sockets are not relevant if Memcache is on the same server as MyBB (just use localhost)

I still don't think you're getting it. A UNIX socket can only be used for a local connection and is generally deemed to be far faster than connecting to an IP (even the internal 127.0.0.1 IP) - especially under high laod. Might want to read this: http://en.wikipedia.org/wiki/Unix_domain_socket

@StefanT: Glad to see the issue's been recognised as I too would prefer to use a socket with memcache.
(2012-02-11, 01:20 PM)euantor Wrote: [ -> ]...
I still don't think you're getting it....

Most of it, almost there:

...communication occurs entirely within the operating system kernel.
  • Memcache operates by placing data into memory. So I thought it could still function, as a cache, no matter how the forum is being served.
  • Varnish, for example, will serve what it can from it's cache and then ask the server for the rest.
  • Why can't the "socket system" access Memcache at 127.0.0.1?

ps. Just trying to learn something new, but we can also drop this at any time, thanks.






You can access Memcache via 127.0.0.1, though you have to specify a port within your configuration. I believe memcache offers either a socket OR port connection so you have to choose between the two (could be wrong, it's a while since I actually set memcache up). As for what content it serves up, it behaves like any other caching system (including Varnish) in that if the data's cached and you atempt to call the data from the cache, that's where it'll come from. otherwise, the data will just have to be manipulated by PHP.
Thank all my friends.
I will try follow StefanT
What results do you get if you set the port to 0 as instructed by php in inc/config.php?

$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;

Try it as port 0 and the host as your socket.

If that doesn't work edit the core code to be 0 and then just those couple lines need to be changed.

if(!$memcache['port'])
{
$memcache['port'] = "0";
}

Pages: 1 2