Ask Your Question
2

Configuring memcached in Webfaction

asked 2012-04-24 16:49:29 -0500

zaf gravatar image zaf
554 8 9 26

I try to install memcached coz I've realized it solves many things. I have actually 3 askbot sites, one is the production environment and the other two are for development/testing purposes.

I'm hosted on Webfaction, in a plan with 256MB allowed memory. I read their instructions about memcached here and here which explain a lot but I still have questions coz I m new in python and django:

  1. At command memcached -d -m memory -s ~/memcached.sock how much memory should I set?
  2. Do I have to download anything from the refered link, or I just run PYTHONPATH=$HOME/webapps/django_app/lib/python2.7/ easy_install-2.7 --install-dir=$HOME/webapps/django_app/lib/python2.7/ --script-dir=$HOME/webapps/django_app/bin/ python-memcached ?
  3. How can I be sure that memcached is set up and works properly?
  4. Is it better to configure memcached for all my 3 sites?.
delete close flag offensive retag edit

Comments

I asked also in webfaction, but I still don't know how much memory should I give to memcached. Any suggestions I would really appreciate! Thank you! (webfaction post is here)

zaf ( 2012-04-25 15:07:46 -0500 )edit

same problem here dude, and memcache will not work you have to use redish something like name redish redish evegny said me so....

Pramvir ( 2012-04-28 15:39:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-04-28 15:51:25 -0500

Evgeny gravatar image Evgeny flag of Chile
11329 50 84 183
http://askbot.org/

updated 2012-04-28 16:13:47 -0500

For the application it does not matter how much memory you assign to the memcached instance (or any other type of cache). If you give less - the application might appear a little slower and that will be all.

Give as much as you can without running out of available memory.

Django application requires between 30 and 40 megabytes per process (that memory for the process itself - cache is a separate issue), if internationalization is enabled (in askbot it is mandatory).

Regarding your setup - I would do development on your home computer. It does help to have identical setup for the staging instance, but if you feel you are limited in the amount of memory - you can have cache-less staging instance (using "dummy" cache backend). Also, you can try setting it up so that you use only one python process to conserve even more memory.

link publish delete flag offensive edit

Comments

I have some caching issues, with answers not appearing etc, and I have seen posts here like this and this, so I suppose it solves many things not just getting things faster.

zaf ( 2012-04-28 16:22:01 -0500 )edit
3

It could be that you have stale cache, to fix that, start django shell in the same virtual environment and clear the cache manually.

python manage.py shell #in the virtual env
#then in the shell type:
from django.core.cache import cache
cache.clear()

We might need to add a management command that does the same... Please try the command above.

Evgeny ( 2012-04-28 16:32:24 -0500 )edit

thanks buddy, I tried it and I'll check the results and let you know (the caching issues do not appear always, so i'll test it few days. thanks again.

zaf ( 2012-04-28 16:43:20 -0500 )edit

It also could be that your several sites compete for the same cache.

Evgeny ( 2012-04-28 16:46:22 -0500 )edit

I have no idea if cache and memcache are the same or are correlated anyhow, just to mention, I ve set up memcache only in one site (production is not live yet).

zaf ( 2012-04-28 16:50:04 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2012-04-24 16:49:29 -0500

Seen: 276 times

Last updated: Apr 28 '12