{"id":6663,"date":"2014-04-20T21:49:17","date_gmt":"2014-04-20T21:49:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/memcached-debuging-server-logs-monitor-the-memcached-servers-collection-of-common-programming-errors\/"},"modified":"2014-04-20T21:49:17","modified_gmt":"2014-04-20T21:49:17","slug":"memcached-debuging-server-logs-monitor-the-memcached-servers-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/memcached-debuging-server-logs-monitor-the-memcached-servers-collection-of-common-programming-errors\/","title":{"rendered":"Memcached Debuging\/Server Logs Monitor the Memcached Servers?-Collection of common programming errors"},"content":{"rendered":"<p>I have chat engine which is based on the Memcached variables, putting them into arrays and reading them in other end via jquery,<\/p>\n<p><strong>which works fine 95% of the times, however when the server load is high memcached (presume its the memcached) the crash and browser gets stucks up.<\/strong><\/p>\n<p>I dont think its jquery issue since this only happens when the server load is very high.<\/p>\n<p><strong>I need a way to monitor the memcached servers or somehow write a log file into where the fails\/errors comes in&#8230;<\/strong><\/p>\n<p>Any idea on how i can do this ? or any idea why memcached servers fails ? I run the memcached as follows<\/p>\n<pre><code>$GLOBALS['MemCached'] = FALSE;\n$GLOBALS['MemCached'] = new Memcache;\n$GLOBALS['MemCached']-&gt;pconnect('localhost', 11211);\n<\/code><\/pre>\n<p>My memcached config is as follows<\/p>\n<pre><code>#! \/bin\/sh\n#\n# chkconfig: - 55 45\n# description:  The memcached daemon is a network memory cache service.\n# processname: memcached\n# config: \/etc\/sysconfig\/memcached\n# pidfile: \/var\/run\/memcached\/memcached.pid\n\n# Standard LSB functions\n#. \/lib\/lsb\/init-functions\n\n# Source function library.\n. \/etc\/init.d\/functions\n\nPORT=11211\nUSER=memcached\nMAXCONN=1024\nCACHESIZE=128\nOPTIONS=\"\"\n\nif [ -f \/etc\/sysconfig\/memcached ];then \n    . \/etc\/sysconfig\/memcached\nfi\n\n# Check that networking is up.\n. \/etc\/sysconfig\/network\n\nif [ \"$NETWORKING\" = \"no\" ]\nthen\n    exit 0\nfi\n\nRETVAL=0\nprog=\"memcached\"\npidfile=${PIDFILE-\/var\/run\/memcached\/memcached.pid}\nlockfile=${LOCKFILE-\/var\/lock\/subsys\/memcached}\n\nstart () {\n    echo -n $\"Starting $prog: \"\n    # Ensure that \/var\/run\/memcached has proper permissions\n    if [ \"`stat -c %U \/var\/run\/memcached`\" != \"$USER\" ]; then\n        chown $USER \/var\/run\/memcached\n    fi\n\n    daemon --pidfile ${pidfile} memcached -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P ${pidfile} $OPTIONS\n    RETVAL=$?\n    echo\n    [ $RETVAL -eq 0 ] &amp;&amp; touch ${lockfile}\n}\nstop () {\n    echo -n $\"Stopping $prog: \"\n    killproc -p ${pidfile} \/usr\/bin\/memcached\n    RETVAL=$?\n    echo\n    if [ $RETVAL -eq 0 ] ; then\n        rm -f ${lockfile} ${pidfile}\n    fi\n}\n\nrestart () {\n        stop\n        start\n}\n\n\n# See how we were called.\ncase \"$1\" in\n  start)\n    start\n    ;;\n  stop)\n    stop\n    ;;\n  status)\n    status -p ${pidfile} memcached\n    RETVAL=$?\n    ;;\n  restart|reload|force-reload)\n    restart\n    ;;\n  condrestart|try-restart)\n    [ -f ${lockfile} ] &amp;&amp; restart || :\n    ;;\n  *)\n    echo $\"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}\"\n    RETVAL=2\n        ;;\nesac\n\nexit $RETVAL\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I have chat engine which is based on the Memcached variables, putting them into arrays and reading them in other end via jquery, which works fine 95% of the times, however when the server load is high memcached (presume its the memcached) the crash and browser gets stucks up. I dont think its jquery issue [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6663","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6663"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6663\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}