-
Notifications
You must be signed in to change notification settings - Fork 0
FaceBook memcached
Explorer edited this page Aug 22, 2018
·
3 revisions
-
TCP connection
A) memcached server had to maintain thousands of TCP connection to diff app server.
This was taking up a lot of memory.
Two ways to solve this. - UDP. Memory usage goes down with UDP.
- Have memcache client that maintains one connection from a web server to the memcache server. Instead of every thread in the Web server having its own connection with the Memcached.
B) If TCP packets are dropped, then TCP doesn't retransmit for 250 ms. UDP can be used to get around this as well.
-
Memcache tiers needs to be kept in Sync using Memcache proxy. For example if there is delete to an entry in the DB, then this needs to be rempoved form the memcache as well. So the SQL server that deletes it also updates the memcache. Then memcache proxy works with other memcache proxies to
delete this info from all the memcache servers. -
Memory Optimization: Instead of allocating memory in powers of 2. Memory was allocated in powers of 1.3. For example if we need 1025 bytes, we would end up allocation 2048 if we use power of 2.
-
CPU time Optimization