Memcached

software development

#1

Hi,
I’ve a wiki (mediawiki) and am trying to install memcached. I could not get any decent documentation on how to get it running and have my mediawiki be benefited. Can anyone tell me how to do this ? Basically I’m looking for information on linking memcached and mediawiki.

Thanks in advance for any help,
Gandharvan


#2

I’m almost 100% positive you can’t run memcached on DreamHost, as ProcWatch (the program they have running to monitor and kill memory/CPU intensive processes) would certainly kill the memcached daemon.

If you’re trying to use memcached from other server with your mediawiki hosted on DH, then I appologize, as I have no experience with mediawiki.


#3

I agree. I looked into it a bit for my small MediaWiki site and I think the DH wiki confirms that you can’t run memcached.

Free unique IP and $67 off with promo code [color=#CC0000]FLENSFREEIP67[/color] or use [color=#CC0000]FLENS97[/color] for $97 off. Click here for more options


#4

Hi,

Can you tell me how to install memcache on Dreamhost VPS ?

Thanks.


#5

I’d love to know how to do this too - my database is being killed at the moment and memcache would help to solve a lot of my problems.


#6

Would it, though? Memcached is not magic pixie dust — applications have to be specifically written to support it. Most are not. We actually experimented with using memcached internally and concluded that adapting our code base to support it was not worthwhile.

Installing memcached on DreamHost VPS should be trivial, though. Just log in as an admin user and sudo apt-get install memcached
The default size is 64 MB. I believe you can tune that in /etc/defaults/memcached.

Make sure to change the settings to not allow network access, though — otherwise, anybody on the Internet will be able to read and modify the contents of your cache. That would be BAD.


#7

Thank you very much for your advice. It was very helpful, particularly the warning regarding security. I appreciate there will be extra programming work to integrate this intelligently into my site, but I think the benefit will be that I can reduce the load on my database server which should lead to a more responsive site for my users.

The missing step for me was not knowing about the ‘Manage Admin Users’ screen. I mistakenly thought that my PS shell user would have administrator access (I’ve just found out that there is an extra screen to create admin users documented here: http://wiki.dreamhost.com/Users#Shell_Users). I’d previously tried sudo’ing but got security errors and hadn’t realized that this extra screen existed.


#8

For anybody else, I’ve now installed memcached on my PS. It was actually fairly simple in the end. Here’s the steps I took:

  1. Install memcached (important to use an admin account!)
  1. If not already, install a custom php.ini - this page here is helpful (the “Easy Auto Copy Script” seems to work well for a lot of people).

  2. Next, link memcached to PHP. This is done via adding a single line to your custom php.ini (I’ve added it at the bottom).

N.B. The above path might be different on your server, so to find the right path you can run this command:

  1. Lastly, restart your web server for the settings to take effect.

To prove that the install was successful, load up a phpinfo() script in your browser and you should see a section with the title “memcache”.

Anyway, hope this helps somebody…


#9

Hi Jon

I did what you said and every works ok but will not show up in <?php phpinfo(); ?>

Using a dedicated server and pulling out my hair with this!

Can anyone help?


#10

This doesn’t seem to work. This is the error output I get…

[code]Reading package lists… Done
Building dependency tree… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
memcached: Depends: libevent1 (>= 1.1a) but it is not installable
E: Broken packages[/code]