SlideShare uma empresa Scribd logo
1 de 84
my $memd = Cache::Memcached::Fast->new({
	   servers => [qw!192.168.67.31:11211 192.168.67.32:11211!]
});

if ( my $nickname = $memd->get('nickname:1') ) {
	   return $nickname;
}

my $dbh = DBI->connect('DBI:mysql:boofy:host=localhost');
my $nickname = $dbh->selectrow_array(
    'SELECT nickname FROM user WHERE id=?', undef, 1);
if ( $nickname ) {
	   $memd->add('nickname:1', $nickname, 24*60*60);
	   return $nickname;
}

return;
% ./memstrike -l localhost -p 11211 -t 10 -k 8 -v 8 50000
number of threads    : 10
number of requests   : 50000
requests per thread : 5000
get multiplex        : 1
size of key          : 8 bytes
size of value        : 8 bytes
----
[gggggggggg] ...
0.683260 sec
0.762939 MB
9.366859 Mbps
73178.585019 req/sec
13.665200 usec/req
VS
VS
memcached   ×
% sudo ./memcached -c 262144 -u nobody
4532 int maxfiles = settings.maxconns;
4533 if (rlim.rlim_cur < maxfiles)
4534     rlim.rlim_cur = maxfiles;
4535 if (rlim.rlim_max < rlim.rlim_cur)
4536     rlim.rlim_max = rlim.rlim_cur;
4537 if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) {
4538     fprintf(stderr, "failed to set rlimit for open
files. Try running as root or requesting smaller
maxconns value.n");
4539     exit(EX_OSERR);
4540 }
% ./memcached -l 127.0.0.1
% ./memcached -l 192.168.67.31
% ./memcached -l 192.168.67.31

..

% ssh myserver
% telnet localhost 11211
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host:
Connection refused
% sudo ./memcached -c 262144 -u nobody
% ./memcached -vvv
slab class   1: chunk size       96 perslab    10922


slab class 40: chunk size    1048576 perslab      1
<26 server listening (auto-negotiate)
<27 server listening (auto-negotiate)
<28 send buffer was 124928, now 268435456
<28 server listening (udp)
<28 server listening (udp)
<28 server listening (udp)
<28 server listening (udp)
<29 send buffer was 124928, now 268435456
<29 server listening (udp)
<29 server listening (udp)
<29 server listening (udp)
<29 server listening (udp)
% ./memcached -p 11211 -U 0
% ./memcached -U 0




% ./memcached -U 12345
% ./memcached -m 16G
% ./memcached -C -m 16G
% ./memcached -c 32768 -u nobody 
              -C -m 16G -p 11211 -U 0
% telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
stats settings
STAT   maxbytes 16777216
STAT   maxconns 32768
STAT   tcpport 11211
STAT   udpport 0
STAT   inter NULL
STAT   verbosity 0
STAT   oldest 0
STAT   evictions on
STAT   growth_factor 1.25
STAT   chunk_size 48
STAT   num_threads 4
STAT   cas_enabled no
STAT   tcp_backlog 4096
STAT   binding_protocol auto-negotiate
STAT   auth_enabled_sasl no
STAT   item_size_max 1048576
END
define host{
  use         generic-host
  host_name    memserver
  alias        memserver
  address      192.168.67.30
}
define service{
  use                    generic-service
  host_name              memserver
  service_description    memcached
  check_command          check_memcached
}

define command {
  command_name    check_memcached
  command_line   ...
}
define command {
  command_name    check_memcached
  command_line    $USER1$/check_tcp 
    -H $HOSTADDRESS$ 
    -p 11211 
    -t 5
}
define command {
  command_name    check_memcached
  command_line      $USER1$/check_tcp
    -H $HOSTADDRESS$ 
    -p 11211 
    -t 5 
    -s 'statsrnquitrn' 
    -E 
    -e 'uptime' 
    -M crit
}
stats                             STAT   decr_misses 0
STAT pid 4825                     STAT   decr_hits 0
STAT uptime 7842604               STAT   cas_misses 0
STAT time 1284432055              STAT   cas_hits 0
STAT version 1.4.4                STAT   cas_badval 0
STAT pointer_size 32              STAT   auth_cmds 0
STAT rusage_user 23623.394698     STAT   auth_errors 0
STAT rusage_system 31550.652571   STAT   bytes_read 219935315170
STAT curr_connections 1243        STAT   bytes_written 788448026716
STAT total_connections 30886226   STAT   limit_maxbytes 1073741824
STAT connection_structures 1373   STAT   accepting_conns 1
STAT cmd_get 730786415            STAT   listen_disabled_num 0
STAT cmd_set 345660130            STAT   threads 4
STAT cmd_flush 0                  STAT   conn_yields 146
STAT get_hits 455135951           STAT   bytes 740742845
STAT get_misses 275650464         STAT   curr_items 3623646
STAT delete_misses 17887026       STAT   total_items 347251509
STAT delete_hits 10283848         STAT   evictions 6986784
STAT incr_misses 4281893          END
STAT incr_hits 111734935
#!/usr/local/bin/activeperl

use   strict;
use   warnings;
use   Getopt::Long;
use   IO::Socket::INET;

GetOptions(
   'H=s' => my $HOST,
   'p=s' => my $PORT,
   'k=s' => my $KEY
);

my $sock = IO::Socket::INET->new(
   PeerAddr => $HOST, PeerPort => $PORT
);
if ( !$sock ) {
    print "Couldnt connect to $HOST:$PORT: $!n";
    exit(3);
}

$sock->syswrite("get $KEYrn");
$sock->sysread( my $result, 16 );

if ( $result =~ m!^VALUE! ) {
    exit(0); #OK
}

print "Not found $KEY on $HOST:$PORTn";
exit(2);
define command {
  command_name   check_memcached
  command_line   $USER1$/check_memkey.pl
    -H $HOSTADDRESS$ 
    -p 11211 
    -k dankogai
}
$ sudo yum install net-snmp net-snmp-perl 
                   rrdtool rrdtool-perl

$   git clone git://github.com/kazeburo/cloudforecast.git
$   cd cloudforecast
$   curl -L -o cpanm http://cpanmin.us/
$   chmod u+x cpanm
$   ./cpanm -l extlib --installdeps .
#
$ cp cloudforecast_sample.yaml cloudforecast.yaml

#
$ cat server_list.yaml
--- #Memcached
servers:
 - config: memcached.yaml
   hosts:
     - 192.168.67.30 memserver memcached server
     - 192.168.67.31 memserver memcached server

#
$ cat host_config/memcached.yaml
resources:
 - traffic:eth1
 - basic
 - memcached:11211
# Web      port 5000   Listen
$ ./cloudforecast_web -p 5000 
         -c cloudforecast.yaml -l server_list.yaml


#            5
$ ./cloudforecast_radar -c cloudforecast.yaml 
                        -l server_list.yaml
STAT   1:chunk_size 80            STAT   2:cmd_set 34606948
STAT   1:chunks_per_page 13107    STAT   2:delete_hits 19083
STAT   1:total_pages 1            STAT   2:incr_hits 283422
STAT   1:total_chunks 13107       STAT   2:decr_hits 0
STAT   1:used_chunks 3            STAT   2:cas_hits 0
STAT   1:free_chunks 32           STAT   2:cas_badval 0
STAT   1:free_chunks_end 13072    ..
STAT   1:mem_requested 220        STAT   42:chunk_size 1048576
STAT   1:get_hits 4438            STAT   42:chunks_per_page 1
STAT   1:cmd_set 11998            STAT   42:total_pages 1
STAT   1:delete_hits 0            STAT   42:total_chunks 1
STAT   1:incr_hits 0              STAT   42:used_chunks 1
STAT   1:decr_hits 0              STAT   42:free_chunks 0
STAT   1:cas_hits 0               STAT   42:free_chunks_end 0
STAT   1:cas_badval 0             STAT   42:mem_requested 779480
STAT   2:chunk_size 104           STAT   42:get_hits 81
STAT   2:chunks_per_page 10082    STAT   42:cmd_set 665
STAT   2:total_pages 16           STAT   42:delete_hits 0
STAT   2:total_chunks 161312      STAT   42:incr_hits 0
STAT   2:used_chunks 116168       STAT   42:decr_hits 0
STAT   2:free_chunks 45144        STAT   42:cas_hits 0
STAT   2:free_chunks_end 0        STAT   42:cas_badval 0
STAT   2:mem_requested 11573385   STAT   active_slabs 40
STAT   2:get_hits 29690676        STAT   total_malloced 1073454184
STAT   items:1:number 3               STAT   items:3:number 1541997
STAT   items:1:age 7841268            STAT   items:3:age 6285649
STAT   items:1:evicted 0              STAT   items:3:evicted 2546432
STAT   items:1:evicted_nonzero 0      STAT   items:3:evicted_nonzero 0
STAT   items:1:evicted_time 0         STAT   items:3:evicted_time 1557089
STAT   items:1:outofmemory 0          STAT   items:3:outofmemory 0
STAT   items:1:tailrepairs 0          STAT   items:3:tailrepairs 0
STAT   items:2:number 116210          ...
STAT   items:2:age 6150456            STAT   items:42:number 1
STAT   items:2:evicted 269            STAT   items:42:age 7834430
STAT   items:2:evicted_nonzero 0      STAT   items:42:evicted 0
STAT   items:2:evicted_time 1594950   STAT   items:42:evicted_nonzero 0
STAT   items:2:outofmemory 0          STAT   items:42:evicted_time 0
STAT   items:2:tailrepairs 0          STAT   items:42:outofmemory 0
                                      STAT   items:42:tailrepairs 0
Configuring and Monitoring Memcached with CloudForecast
Configuring and Monitoring Memcached with CloudForecast
Configuring and Monitoring Memcached with CloudForecast
Configuring and Monitoring Memcached with CloudForecast

Mais conteúdo relacionado

Mais procurados

UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresConnor McDonald
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQLConnor McDonald
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousConnor McDonald
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesConnor McDonald
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql featuresConnor McDonald
 
APEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQLAPEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQLConnor McDonald
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacksphanleson
 
Rooted 2010 ppp
Rooted 2010 pppRooted 2010 ppp
Rooted 2010 pppnoc_313
 
Sangam 18 - Great Applications with Great SQL
Sangam 18 - Great Applications with Great SQLSangam 18 - Great Applications with Great SQL
Sangam 18 - Great Applications with Great SQLConnor McDonald
 
WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011
WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011
WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011John Ford
 
PGDay UK 2016 -- Performace for queries with grouping
PGDay UK 2016 -- Performace for queries with groupingPGDay UK 2016 -- Performace for queries with grouping
PGDay UK 2016 -- Performace for queries with groupingAlexey Bashtanov
 
ROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
ROS2勉強会@別府 第7章PythonクライアントライブラリrclpyROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
ROS2勉強会@別府 第7章PythonクライアントライブラリrclpyAtsuki Yokota
 
Profiling of Oracle Function Calls
Profiling of Oracle Function CallsProfiling of Oracle Function Calls
Profiling of Oracle Function CallsEnkitec
 
Optimizing Queries with Explain
Optimizing Queries with ExplainOptimizing Queries with Explain
Optimizing Queries with ExplainMYXPLAIN
 

Mais procurados (20)

UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL features
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQL
 
KScope19 - SQL Features
KScope19 - SQL FeaturesKScope19 - SQL Features
KScope19 - SQL Features
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on Autonomous
 
Flashback ITOUG
Flashback ITOUGFlashback ITOUG
Flashback ITOUG
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
 
Saii log
Saii logSaii log
Saii log
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
 
Command
CommandCommand
Command
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
 
APEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQLAPEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQL
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacks
 
Rooted 2010 ppp
Rooted 2010 pppRooted 2010 ppp
Rooted 2010 ppp
 
Sangam 18 - Great Applications with Great SQL
Sangam 18 - Great Applications with Great SQLSangam 18 - Great Applications with Great SQL
Sangam 18 - Great Applications with Great SQL
 
WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011
WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011
WordPress Security: Be a Superhero - WordCamp Raleigh - May 2011
 
PGDay UK 2016 -- Performace for queries with grouping
PGDay UK 2016 -- Performace for queries with groupingPGDay UK 2016 -- Performace for queries with grouping
PGDay UK 2016 -- Performace for queries with grouping
 
ROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
ROS2勉強会@別府 第7章PythonクライアントライブラリrclpyROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
ROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
 
Profiling of Oracle Function Calls
Profiling of Oracle Function CallsProfiling of Oracle Function Calls
Profiling of Oracle Function Calls
 
Optimizing Queries with Explain
Optimizing Queries with ExplainOptimizing Queries with Explain
Optimizing Queries with Explain
 
ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
 

Destaque

gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作るgumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作るgumilab
 
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例gumilab
 
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについてgumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについてgumilab
 
gumiStudy#3 Django – 次の一歩
gumiStudy#3 Django – 次の一歩gumiStudy#3 Django – 次の一歩
gumiStudy#3 Django – 次の一歩gumilab
 
gumiStudy#4 mixiアプリのスマートフォン版について
gumiStudy#4 mixiアプリのスマートフォン版についてgumiStudy#4 mixiアプリのスマートフォン版について
gumiStudy#4 mixiアプリのスマートフォン版についてgumilab
 
A geek's guide to getting hired
A geek's guide to getting hiredA geek's guide to getting hired
A geek's guide to getting hiredDave Ross
 

Destaque (6)

gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作るgumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
 
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
 
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについてgumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
 
gumiStudy#3 Django – 次の一歩
gumiStudy#3 Django – 次の一歩gumiStudy#3 Django – 次の一歩
gumiStudy#3 Django – 次の一歩
 
gumiStudy#4 mixiアプリのスマートフォン版について
gumiStudy#4 mixiアプリのスマートフォン版についてgumiStudy#4 mixiアプリのスマートフォン版について
gumiStudy#4 mixiアプリのスマートフォン版について
 
A geek's guide to getting hired
A geek's guide to getting hiredA geek's guide to getting hired
A geek's guide to getting hired
 

Semelhante a Configuring and Monitoring Memcached with CloudForecast

OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging RubyAman Gupta
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22Yuya Takei
 
Bsides
BsidesBsides
Bsidesm j
 
More Than po: Debugging in LLDB @ CocoaConf SJ 2015
More Than po: Debugging in LLDB @ CocoaConf SJ 2015More Than po: Debugging in LLDB @ CocoaConf SJ 2015
More Than po: Debugging in LLDB @ CocoaConf SJ 2015Michele Titolo
 
Troubleshooting tips and tricks for Oracle Database Oct 2020
Troubleshooting tips and tricks for Oracle Database Oct 2020Troubleshooting tips and tricks for Oracle Database Oct 2020
Troubleshooting tips and tricks for Oracle Database Oct 2020Sandesh Rao
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby SystemsEngine Yard
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기Ji Hun Kim
 
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxmetadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxARIV4
 
Watching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficWatching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficJosiah Ritchie
 
Aplicações 10x a 100x mais rápida com o postgre sql
Aplicações 10x a 100x mais rápida com o postgre sqlAplicações 10x a 100x mais rápida com o postgre sql
Aplicações 10x a 100x mais rápida com o postgre sqlFabio Telles Rodriguez
 
Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...
Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...
Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...Ontico
 
Troubleshooting Tips and Tricks for Database 19c ILOUG Feb 2020
Troubleshooting Tips and Tricks for Database 19c   ILOUG Feb 2020Troubleshooting Tips and Tricks for Database 19c   ILOUG Feb 2020
Troubleshooting Tips and Tricks for Database 19c ILOUG Feb 2020Sandesh Rao
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQLConnor McDonald
 
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019Sandesh Rao
 

Semelhante a Configuring and Monitoring Memcached with CloudForecast (20)

OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
Cpu utilization
Cpu utilizationCpu utilization
Cpu utilization
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
Bsides
BsidesBsides
Bsides
 
More Than po: Debugging in LLDB @ CocoaConf SJ 2015
More Than po: Debugging in LLDB @ CocoaConf SJ 2015More Than po: Debugging in LLDB @ CocoaConf SJ 2015
More Than po: Debugging in LLDB @ CocoaConf SJ 2015
 
Explain this!
Explain this!Explain this!
Explain this!
 
Troubleshooting tips and tricks for Oracle Database Oct 2020
Troubleshooting tips and tricks for Oracle Database Oct 2020Troubleshooting tips and tricks for Oracle Database Oct 2020
Troubleshooting tips and tricks for Oracle Database Oct 2020
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
Kernel crashdump
Kernel crashdumpKernel crashdump
Kernel crashdump
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxmetadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
 
Watching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficWatching And Manipulating Your Network Traffic
Watching And Manipulating Your Network Traffic
 
Aplicações 10x a 100x mais rápida com o postgre sql
Aplicações 10x a 100x mais rápida com o postgre sqlAplicações 10x a 100x mais rápida com o postgre sql
Aplicações 10x a 100x mais rápida com o postgre sql
 
Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...
Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...
Deep dive into PostgreSQL internal statistics / Алексей Лесовский (PostgreSQL...
 
Troubleshooting Tips and Tricks for Database 19c ILOUG Feb 2020
Troubleshooting Tips and Tricks for Database 19c   ILOUG Feb 2020Troubleshooting Tips and Tricks for Database 19c   ILOUG Feb 2020
Troubleshooting Tips and Tricks for Database 19c ILOUG Feb 2020
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
 

Último

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Último (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Configuring and Monitoring Memcached with CloudForecast

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. my $memd = Cache::Memcached::Fast->new({ servers => [qw!192.168.67.31:11211 192.168.67.32:11211!] }); if ( my $nickname = $memd->get('nickname:1') ) { return $nickname; } my $dbh = DBI->connect('DBI:mysql:boofy:host=localhost'); my $nickname = $dbh->selectrow_array( 'SELECT nickname FROM user WHERE id=?', undef, 1); if ( $nickname ) { $memd->add('nickname:1', $nickname, 24*60*60); return $nickname; } return;
  • 25. % ./memstrike -l localhost -p 11211 -t 10 -k 8 -v 8 50000 number of threads : 10 number of requests : 50000 requests per thread : 5000 get multiplex : 1 size of key : 8 bytes size of value : 8 bytes ---- [gggggggggg] ... 0.683260 sec 0.762939 MB 9.366859 Mbps 73178.585019 req/sec 13.665200 usec/req
  • 26.
  • 27. VS
  • 28. VS
  • 29.
  • 30.
  • 31. memcached ×
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. % sudo ./memcached -c 262144 -u nobody
  • 37. 4532 int maxfiles = settings.maxconns; 4533 if (rlim.rlim_cur < maxfiles) 4534 rlim.rlim_cur = maxfiles; 4535 if (rlim.rlim_max < rlim.rlim_cur) 4536 rlim.rlim_max = rlim.rlim_cur; 4537 if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) { 4538 fprintf(stderr, "failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.n"); 4539 exit(EX_OSERR); 4540 }
  • 38.
  • 39. % ./memcached -l 127.0.0.1 % ./memcached -l 192.168.67.31
  • 40. % ./memcached -l 192.168.67.31 .. % ssh myserver % telnet localhost 11211 Trying ::1... Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused
  • 41. % sudo ./memcached -c 262144 -u nobody
  • 42.
  • 43. % ./memcached -vvv slab class 1: chunk size 96 perslab 10922 slab class 40: chunk size 1048576 perslab 1 <26 server listening (auto-negotiate) <27 server listening (auto-negotiate) <28 send buffer was 124928, now 268435456 <28 server listening (udp) <28 server listening (udp) <28 server listening (udp) <28 server listening (udp) <29 send buffer was 124928, now 268435456 <29 server listening (udp) <29 server listening (udp) <29 server listening (udp) <29 server listening (udp)
  • 44. % ./memcached -p 11211 -U 0
  • 45. % ./memcached -U 0 % ./memcached -U 12345
  • 48. % ./memcached -c 32768 -u nobody -C -m 16G -p 11211 -U 0
  • 49. % telnet localhost 11211 Trying ::1... Connected to localhost. Escape character is '^]'. stats settings STAT maxbytes 16777216 STAT maxconns 32768 STAT tcpport 11211 STAT udpport 0 STAT inter NULL STAT verbosity 0 STAT oldest 0 STAT evictions on STAT growth_factor 1.25 STAT chunk_size 48 STAT num_threads 4 STAT cas_enabled no STAT tcp_backlog 4096 STAT binding_protocol auto-negotiate STAT auth_enabled_sasl no STAT item_size_max 1048576 END
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58. define host{ use generic-host host_name memserver alias memserver address 192.168.67.30 } define service{ use generic-service host_name memserver service_description memcached check_command check_memcached } define command { command_name check_memcached command_line ... }
  • 59. define command { command_name check_memcached command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 11211 -t 5 }
  • 60. define command { command_name check_memcached command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 11211 -t 5 -s 'statsrnquitrn' -E -e 'uptime' -M crit }
  • 61. stats STAT decr_misses 0 STAT pid 4825 STAT decr_hits 0 STAT uptime 7842604 STAT cas_misses 0 STAT time 1284432055 STAT cas_hits 0 STAT version 1.4.4 STAT cas_badval 0 STAT pointer_size 32 STAT auth_cmds 0 STAT rusage_user 23623.394698 STAT auth_errors 0 STAT rusage_system 31550.652571 STAT bytes_read 219935315170 STAT curr_connections 1243 STAT bytes_written 788448026716 STAT total_connections 30886226 STAT limit_maxbytes 1073741824 STAT connection_structures 1373 STAT accepting_conns 1 STAT cmd_get 730786415 STAT listen_disabled_num 0 STAT cmd_set 345660130 STAT threads 4 STAT cmd_flush 0 STAT conn_yields 146 STAT get_hits 455135951 STAT bytes 740742845 STAT get_misses 275650464 STAT curr_items 3623646 STAT delete_misses 17887026 STAT total_items 347251509 STAT delete_hits 10283848 STAT evictions 6986784 STAT incr_misses 4281893 END STAT incr_hits 111734935
  • 62.
  • 63.
  • 64. #!/usr/local/bin/activeperl use strict; use warnings; use Getopt::Long; use IO::Socket::INET; GetOptions( 'H=s' => my $HOST, 'p=s' => my $PORT, 'k=s' => my $KEY ); my $sock = IO::Socket::INET->new( PeerAddr => $HOST, PeerPort => $PORT ); if ( !$sock ) { print "Couldnt connect to $HOST:$PORT: $!n"; exit(3); } $sock->syswrite("get $KEYrn"); $sock->sysread( my $result, 16 ); if ( $result =~ m!^VALUE! ) { exit(0); #OK } print "Not found $KEY on $HOST:$PORTn"; exit(2);
  • 65. define command { command_name check_memcached command_line $USER1$/check_memkey.pl -H $HOSTADDRESS$ -p 11211 -k dankogai }
  • 66.
  • 67.
  • 68.
  • 69. $ sudo yum install net-snmp net-snmp-perl rrdtool rrdtool-perl $ git clone git://github.com/kazeburo/cloudforecast.git $ cd cloudforecast $ curl -L -o cpanm http://cpanmin.us/ $ chmod u+x cpanm $ ./cpanm -l extlib --installdeps .
  • 70. # $ cp cloudforecast_sample.yaml cloudforecast.yaml # $ cat server_list.yaml --- #Memcached servers: - config: memcached.yaml hosts: - 192.168.67.30 memserver memcached server - 192.168.67.31 memserver memcached server # $ cat host_config/memcached.yaml resources: - traffic:eth1 - basic - memcached:11211
  • 71. # Web port 5000 Listen $ ./cloudforecast_web -p 5000 -c cloudforecast.yaml -l server_list.yaml # 5 $ ./cloudforecast_radar -c cloudforecast.yaml -l server_list.yaml
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79. STAT 1:chunk_size 80 STAT 2:cmd_set 34606948 STAT 1:chunks_per_page 13107 STAT 2:delete_hits 19083 STAT 1:total_pages 1 STAT 2:incr_hits 283422 STAT 1:total_chunks 13107 STAT 2:decr_hits 0 STAT 1:used_chunks 3 STAT 2:cas_hits 0 STAT 1:free_chunks 32 STAT 2:cas_badval 0 STAT 1:free_chunks_end 13072 .. STAT 1:mem_requested 220 STAT 42:chunk_size 1048576 STAT 1:get_hits 4438 STAT 42:chunks_per_page 1 STAT 1:cmd_set 11998 STAT 42:total_pages 1 STAT 1:delete_hits 0 STAT 42:total_chunks 1 STAT 1:incr_hits 0 STAT 42:used_chunks 1 STAT 1:decr_hits 0 STAT 42:free_chunks 0 STAT 1:cas_hits 0 STAT 42:free_chunks_end 0 STAT 1:cas_badval 0 STAT 42:mem_requested 779480 STAT 2:chunk_size 104 STAT 42:get_hits 81 STAT 2:chunks_per_page 10082 STAT 42:cmd_set 665 STAT 2:total_pages 16 STAT 42:delete_hits 0 STAT 2:total_chunks 161312 STAT 42:incr_hits 0 STAT 2:used_chunks 116168 STAT 42:decr_hits 0 STAT 2:free_chunks 45144 STAT 42:cas_hits 0 STAT 2:free_chunks_end 0 STAT 42:cas_badval 0 STAT 2:mem_requested 11573385 STAT active_slabs 40 STAT 2:get_hits 29690676 STAT total_malloced 1073454184
  • 80. STAT items:1:number 3 STAT items:3:number 1541997 STAT items:1:age 7841268 STAT items:3:age 6285649 STAT items:1:evicted 0 STAT items:3:evicted 2546432 STAT items:1:evicted_nonzero 0 STAT items:3:evicted_nonzero 0 STAT items:1:evicted_time 0 STAT items:3:evicted_time 1557089 STAT items:1:outofmemory 0 STAT items:3:outofmemory 0 STAT items:1:tailrepairs 0 STAT items:3:tailrepairs 0 STAT items:2:number 116210 ... STAT items:2:age 6150456 STAT items:42:number 1 STAT items:2:evicted 269 STAT items:42:age 7834430 STAT items:2:evicted_nonzero 0 STAT items:42:evicted 0 STAT items:2:evicted_time 1594950 STAT items:42:evicted_nonzero 0 STAT items:2:outofmemory 0 STAT items:42:evicted_time 0 STAT items:2:tailrepairs 0 STAT items:42:outofmemory 0 STAT items:42:tailrepairs 0

Notas do Editor