Permalink
Browse files

Importing Memcache Manager from Google Project.

  • Loading branch information...
1 parent 56acd63 commit f394179241ed2509653f1de78b6e2b5725051f7f @peter-schmalfeldt peter-schmalfeldt committed Dec 4, 2010
Showing with 10,649 additions and 0 deletions.
  1. +115 −0 README
  2. +846 −0 memcache/docs/MemcacheManager/MemcacheManager.html
  3. +66 −0 memcache/docs/MemcacheManager/_classes---class_MemcacheManager.php.html
  4. +66 −0 memcache/docs/MemcacheManager/_index.php.html
  5. +13 −0 memcache/docs/blank.html
  6. +24 −0 memcache/docs/classtrees_MemcacheManager.html
  7. +282 −0 memcache/docs/elementindex.html
  8. +279 −0 memcache/docs/elementindex_MemcacheManager.html
  9. +26 −0 memcache/docs/errors.html
  10. +24 −0 memcache/docs/index.html
  11. +35 −0 memcache/docs/li_MemcacheManager.html
  12. +32 −0 memcache/docs/media/banner.css
  13. +144 −0 memcache/docs/media/stylesheet.css
  14. +27 −0 memcache/docs/packages.html
  15. +250 −0 memcache/reports/report.html
  16. +73 −0 memcache/reports/report_sample1.html
  17. +233 −0 memcache/reports/report_sample2.html
  18. +573 −0 memcache/reports/report_sample3.html
  19. +820 −0 memcache/source/classes/class_MemcacheManager.php
  20. +88 −0 memcache/source/index.php
  21. +106 −0 memcached/docs/MemcacheManager/MemcachedReport.html
  22. +66 −0 memcached/docs/MemcacheManager/_classes---class_MemcachedReport.php.html
  23. +2,191 −0 memcached/docs/MemcachedManager/MemcachedManager.html
  24. +66 −0 memcached/docs/MemcachedManager/_classes---class_MemcachedManager.php.html
  25. +80 −0 memcached/docs/MemcachedManager/_index.php.html
  26. +13 −0 memcached/docs/blank.html
  27. +24 −0 memcached/docs/classtrees_MemcacheManager.html
  28. +24 −0 memcached/docs/classtrees_MemcachedManager.html
  29. +495 −0 memcached/docs/elementindex.html
  30. +74 −0 memcached/docs/elementindex_MemcacheManager.html
  31. +476 −0 memcached/docs/elementindex_MemcachedManager.html
  32. +35 −0 memcached/docs/errors.html
  33. +24 −0 memcached/docs/index.html
  34. +34 −0 memcached/docs/li_MemcacheManager.html
  35. +35 −0 memcached/docs/li_MemcachedManager.html
  36. +32 −0 memcached/docs/media/banner.css
  37. +144 −0 memcached/docs/media/stylesheet.css
  38. +32 −0 memcached/docs/packages.html
  39. +247 −0 memcached/reports/report.html
  40. +222 −0 memcached/reports/report_sample.html
  41. +1,770 −0 memcached/source/classes/class_MemcachedManager.php
  42. +361 −0 memcached/source/classes/class_MemcachedReport.php
  43. +75 −0 memcached/source/index.php
  44. +7 −0 memcached/source/tags.sql
View
@@ -0,0 +1,115 @@
+PHP Classes & Examples for both Memcache & Memcached modules. Source code includes Sample Reports as well as Documentation. Currently tested to work with memcached 1.4.3 & pecl extension 2.2.5.
+
+Our Memcached Class now supports key tagging !!! Add by key, delete by key, search by key, use namespacing... whatever... you're the boss ;)
+
+Also, if you have not already checked it out, we have a sweet tool to generate a report on your Memcached memory usage. See our Sample Report !
+
+http://www.manifestinteractive.com/usenet/memcached/reports/report_sample.html
+
+----------
+Introduction
+----------
+
+This project will host PHP Classes & Examples for both Memcache & Memcached modules. Source code includes Sample Reports as well as Documentation. Currently tested to work with memcached 1.4.3 & pecl extension 2.2.5.
+
+----------
+Details
+----------
+
+My efforts are to make it easier to "visualize" our Memcache servers. I would love to hear your thoughts on ways this might be achieved. So far I am focusing on:
+
+ * Showing Visual Graphs with Memory Usage
+ * Highlighting Potential Problems that may need to be addressed
+ * Still leaving room for your own customizations
+ * I look forward to any feedback you have and am happy to work in any worthwhile features you may want added.
+
+----------
+Known Issue with PECL 2.2.5 & Memcached 1.4.3
+----------
+
+There is a known issue that might cause some headaches for some people. Fortunately Harv over at php.net has already worked out a solution. If you are running Memcached 1.4.3 with the PECL extension 2.2.5, you will not be able to delete a key. If you did a var_dump(debug_backtrace()); you would see an error that reads CLIENT_ERROR bad command line format. Usage: delete <key> [noreply].
+
+To fix this, search for a file named memcache.c and go to line 1494 and in the mmc_delete() function replace:
+
+command_len = spprintf(&command, 0, "delete %s %d", key, time);
+
+with
+
+command_len = spprintf(&command, 0, "delete %s", key);
+
+Once you have saved the file... just recompile, restart apache, and you are good to go.
+
+Here is the Original Thread where I found the fix from Harv.
+
+Hope this helps somebody like it helped me.
+
+----------
+Definitions
+----------
+
+In case you have had a rough time trying to wrap your head around what some of the variables are actually for... here is a comprehensive list and a link to the resources where we discovered this information. Hope this helps! If it doesn't, head over to our Google Group to ask for help.
+
+While you are reading these statistical definitions... keep in mind that the most useful statistics from those given here are the number of cache hits, misses, and evictions.
+
+A large number of get_misses may just be an indication that the cache is still being populated with information. The number should, over time, decrease in comparison to the number of cache get_hits. If, however, you have a large number of cache misses compared to cache hits after an extended period of execution, it may be an indication that the size of the cache is too small and you either need to increase the total memory size, or increase the number of the memcached instances to improve the hit ratio.
+
+A large number of evictions from the cache, particularly in comparison to the number of items stored is a sign that your cache is too small to hold the amount of information that you regularly want to keep cached. Instead of items being retained in the cache, items are being evicted to make way for new items keeping the turnover of items in the cache high, reducing the efficiency of the cache.
+
+Server Statistics
+
+accepting_conns Accepting Connections 1 or 0 to indicate whether the server is currently accepting connections or not.
+version Memcache Version Version string of this instance.
+pid Process ID Process id of the memcached instance.
+pointer_size Pointer Size Size of pointers for this host specified in bits (32 or 64).
+threads Threads Number of worker threads requested.
+rusage_system System CPU Usage Total system time for this instance (seconds:microseconds).
+rusage_user User CPU Usage Total user time for this instance (seconds:microseconds).
+time Time Current time (as epoch).
+uptime Uptime Uptime for this memcached instance (seconds:microseconds).
+
+To get the start time for your service, just subtract time from uptime (uptime-time).
+
+Memory Usage
+
+limit_maxbytes Memory Allocation Number of bytes this server is allowed to use for storage.
+bytes Memory In Use Current number of bytes used by this server to store items.
+bytes_read Total Read Memory Total number of bytes read by this server from network.
+bytes_written Total Written Memory Total number of bytes sent by this server to network.
+
+To get available memory, just subtract bytes from limit_maxbytes (limit_maxbytes-bytes).
+
+Connection Information
+curr_connections Current Connections Current number of open connections.
+total_connections Total Connections Total number of connections opened since the server started running.
+conn_yields Connection Yields Number of yields for connections.
+connection_structures Connection Structures Number of connection structures allocated by the server.
+
+Still not 100% sure what connection_structures or conn_yields are... Anyone?
+
+Memcache Statistics
+
+listen_disabled_num Listeners Disabled The number of times socket listeners were disabled due to hitting the connection limit.
+evictions Evections Number of valid items removed from cache to free memory for new items.
+cmd_flush CMD Flush Used Total number of flush requests.
+cmd_get CMD Get Used Total number of retrieval requests.
+cmd_set CMD Set Used Total number of storage requests.
+cas_badval CAS Bad Value Number of keys that have been compared and swapped, but the comparison (original) value did not match the supplied value.
+cas_hits CAS Hits Number of keys that have been compared and swapped and found present.
+cas_misses CAS Misses Number of items that have been compared and swapped and not found.
+get_hits Get Hits Number of keys that have been requested and found present.
+get_misses Get Misses Number of items that have been requested and not found.
+delete_hits Delete Hits Number of keys that have been deleted and found present.
+delete_misses Delete Misses Number of items that have been delete and not found.
+incr_hits Increment Hits Number of keys that have been incremented and found present.
+incr_misses Increment Misses Number of items that have been incremented and not found.
+decr_hits Decrement Hits Number of keys that have been decremented and found present.
+decr_misses Decrement Misses Number of items that have been decremented and not found.
+
+Pretty much anything that is a miss can be bad. Evictions can be bad too. Read the notes above for more info.
+
+Item Information
+
+curr_items Current Items Current number of items stored by this instance.
+total_items Total Items Total number of items stored during the life of this instance.
+
+And that does it... for this version of Memcached anyway (1.4.3)
Oops, something went wrong.

0 comments on commit f394179

Please sign in to comment.