Heroku Postgres RAM for Memcache Cache and Memory

I have a Heroku web application and am trying to understand the difference / trade-offs between adding a Memcached instance with 1 GB of RAM and adding 1 GB of RAM to my Postgres server.

If I added an instance of Memcached, I would probably use Johnny Cache (for Django - http://packages.python.org/johnny-cache/ ).

Should I expect a similar performance improvement from two options? In general, what is the advantage of using memcache or increasing the size of the Postgres cache. (I understand that people often run memcache on the database server, so there should be one).

I appreciate that this is probably a very naive question, but I could not find anything to clarify my confusion through Google.

+4
source share
1 answer

Postgres for maximum performance requires a sufficient amount of cache to save the most frequently used object (indexes, tables). Thus, in setting shared_buffers there is a tipping point. After this point, increasing shared buffers doesn't help much.

It is good to leave some of the RAM for caching at the file system level.

See http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server for more details.

As for memcache, this is a completely different beast ... It can be used directly from the application to have ultrafast storage with unchanged key storage.

All three properties make memcached different from a relational database (RDB).

  • ultrafast (RDB - no)
  • intermittent (RDB)
  • key-value only (RDB is much better)
+1
source

Source: https://habr.com/ru/post/1440837/


All Articles