Welcome to Centmin Mod Community
Register Now

MemcachedAdmin

Discussion in 'Feature Requests & Suggestions' started by Matt, May 29, 2014.

  1. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    6:31 PM
    1.7.1
    MariaDB 10
  2. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah I use to use phpmemcacheadmin too. But 1.2.2 seems outdated 2+yrs and doesn't report correct memory usage stats so not sure how much is accurate with phpmemcacheadmin

    For example
    • memcache.php included with memcache 1.4.20 25/96MB used
    • phpmemcacheadmin 1.2.2 reports 83/96MB used with 56MB wasted so 27MB diff ?
    • memcached-tool with memcache 1.4.20 reports close to memcache.php usage at 26,256,600 bytes used
    Code:
    memcached-tool 127.0.0.1:11211 stats
    #127.0.0.1:11211   Field       Value
             accepting_conns           1
                   auth_cmds           0
                 auth_errors           0
                       bytes    26256600
                  bytes_read   309607366
               bytes_written  1018526301
                  cas_badval           0
                    cas_hits           0
                  cas_misses           0
                   cmd_flush          20
                     cmd_get      239027
                     cmd_set       23032
                   cmd_touch           0
                 conn_yields           0
       connection_structures          14
           crawler_reclaimed           0
            curr_connections           4
                  curr_items         708
                   decr_hits           0
                 decr_misses           0
                 delete_hits           2
               delete_misses           0
           evicted_unfetched           0
                   evictions           0
           expired_unfetched        4439
                    get_hits      226133
                  get_misses       12894
                  hash_bytes      524288
           hash_is_expanding           0
            hash_power_level          16
                   incr_hits           0
                 incr_misses           0
                    libevent 2.0.21-stable
              limit_maxbytes   100663296
         listen_disabled_num           0
                malloc_fails           0
                         pid       22938
                pointer_size          64
                   reclaimed        6782
                reserved_fds          10
               rusage_system   20.833331
                 rusage_user    5.149999
       slab_reassign_running           0
                 slabs_moved           0
                     threads           2
                        time  1401314830
           total_connections        8527
                 total_items       23032
                  touch_hits           0
                touch_misses           0
                      uptime      126229
                     version      1.4.20
    edit: okay wasted memory is like buffer cache, is available for memcached if needed http://serverfault.com/questions/397532/unexpected-high-wasted-memory-in-memcached
     
  3. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    6:31 PM
    1.7.1
    MariaDB 10
    Oh didn't know that. I'll take a look on mine and see if there is a difference in what they are reporting.
     
  4. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    6:31 PM
    1.7.1
    MariaDB 10
    upload_2014-5-29_7-18-9.png

    upload_2014-5-29_7-18-28.png

    Code:
    [root@host public]# memcached-tool 127.0.0.1:11211 stats
    #127.0.0.1:11211   Field       Value
             accepting_conns           1
                   auth_cmds           0
                 auth_errors           0
                       bytes   241863980
                  bytes_read   588740177
               bytes_written 23760576512
                  cas_badval           0
                    cas_hits           0
                  cas_misses           0
                   cmd_flush           0
                     cmd_get     3798656
                     cmd_set      185866
                   cmd_touch           0
                 conn_yields           0
       connection_structures          43
           crawler_reclaimed           0
            curr_connections           5
                  curr_items       93808
                   decr_hits           0
                 decr_misses           0
                 delete_hits         171
               delete_misses           2
           evicted_unfetched           0
                   evictions           0
           expired_unfetched          15
                    get_hits     3704406
                  get_misses       94250
                  hash_bytes      524288
           hash_is_expanding           0
            hash_power_level          16
                   incr_hits           0
                 incr_misses           0
                    libevent 2.0.21-stable
              limit_maxbytes  1073741824
         listen_disabled_num           0
                malloc_fails           0
                         pid       25567
                pointer_size          64
                   reclaimed         939
                reserved_fds          20
               rusage_system  179.852000
                 rusage_user   55.672000
       slab_reassign_running           0
                 slabs_moved           0
                     threads           4
                        time  1401344350
           total_connections      112956
                 total_items      185861
                  touch_hits           0
                touch_misses           0
                      uptime      300379
                     version      1.4.20
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    cheers.. guess i have alot of small cache entries in memcached :)
     
  6. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Very good to add :)

    Can you please post commands to install on Centminmod server?

    Thank you
     
  7. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    6:31 PM
    1.7.1
    MariaDB 10
    Code:
    cd YOUR/WEB/DIRECTORY/
    mkdir MemcachedAdmin
    cd MemcachedAdmin
    wget http://phpmemcacheadmin.googlecode.com/files/phpMemcachedAdmin-1.2.2-r262.zip
    unzip phpMemcachedAdmin-1.2.2-r262.zip
    Done. Nothing special needs to be done. Only thing I normally do is lock down the folder to my own static IP address or password protection for customers
    Code:
            location /MemcachedAdmin {
            auth_basic "Private";
            auth_basic_user_file /usr/local/nginx/conf/htpasswd;
            include /usr/local/nginx/conf/staticfiles.conf;
            include /usr/local/nginx/conf/php.conf;
            }
     
    • Like Like x 3
  8. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Thanks Matt :)

    Any chmod +x stuff?
     
  9. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    6:31 PM
    1.7.1
    MariaDB 10
    Should work as the root user, but can always chown nginx:nginx the files.
     
  10. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    As i do not have static ip i must remove only this line?

    Code:
    include /usr/local/nginx/conf/staticfiles.conf;
     
  11. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    6:31 PM
    1.7.1
    MariaDB 10
    No, that is the generic configuration for how static files are served via nginx.
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    @pamamolf as @Matt stated, that file defines the static file extensions that Nginx is told to handle

    Code:
        location ~* \.(3gp|gif|jpg|jpeg|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
            gzip_static off;
            #add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            expires 30d;
            break;
            }
    
        location ~* \.(js)$ {
            #add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            expires 30d;
            break;
            }
    
        location ~* \.(css)$ {
            #add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            expires 30d;
            break;
            }
    
        location ~* \.(html|htm|txt)$ {
            #add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            expires 1d;
            break;
            }
    
        location ~* \.(eot|svg|ttf|woff)$ {
            #add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            expires 30d;
            break;
            }
     
  13. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Ops sorry i was read wrong and i thought that he was locking down the folder using a file...

    Sorry :)
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    No worries :D
     
  15. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Is this installed now as default?

    I got this info at the end of installation of centminmod and was great to have this as default :)

    Better and easier to view stats now !
     
  16. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    no not default if it is added, it will be as an addon just like phpmyadmin.sh
     
  17. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    It seems that i drink a lot tonight :)

    After installation i got login info from Centminmod at the end for:

    Memcached Server Admin Login: /usr/local/nginx/html/memcache_27624.php

    And then i login to it and i got stats for memcached cache ....
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    yeah that's the default :)
     
  19. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    8:31 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    How can i add the login info here?

    Code:
    auth_basic_user_file /usr/local/nginx/conf/htpasswd; 
    htpasswd is empty now .

    I mean in which format?
     
  20. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,137
    Local Time:
    3:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    same way you did using htpasswd.py at https://community.centminmod.com/th...le-to-allocate-memory-for-pool.541/#post-2385

    Use htpasswd.py script at /usr/local/nginx/conf/htpasswd.py to setup
    username and password using following command:
    Code:
    python /usr/local/nginx/conf/htpasswd.py -b /usr/local/nginx/conf/htpasswd yourusername yourpassword
    change yourusername and yourpassword to unique values of your own.