Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Memcache exception timeout diagnosis tool mctop

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to use Memcache exception timeout diagnosis tool mctop, I believe that many inexperienced people do not know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Yesterday, when checking the MC connection timeout, it was found that no exception was found in the other MC of the same business. Through monitoring, it was found that the network did not lose packets but the traffic of the two MC was obviously inconsistent. When the number of connections is basically the same, the difference in bandwidth is 3 times. It can be concluded that it is caused by the excessive value of a certain key called by the business.

All right, now that we know why, how can we locate which key? The following is a general practice:

Frequently called request packets are found by grabbing packets

Analyze whether the key value is too large by MC protocol.

It seems that you are a little dizzy, ha ha, this method is very cumbersome, positioning reasons are relatively slow, is there a better way? Here is an introduction to mctop.

Mctop is an open source detection tool that relies on ruby's pcap for packet capture and analysis. The download address of the package is GITHUP https://github.com/etsy/mctop.

Decompress and execute:

#. / mctop

/ usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load-- pcap (LoadError)

From / usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

From. /.. / lib/cmdline.rb:2

From / usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'

From / usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

From. / mctop:10

Through the error report, I learned that pcap needs to be installed, but there is still a problem after installation. There is no way to upgrade ruby. I am now 1.8.7 to 1.9.2 download address, I need to install the following components

# / usr/local/bin/gem install bundle

# / usr/local/bin/gem install rake

# / usr/local/bin/gem install ruby-pcap

# rm-f / usr/bin/ruby

# ln-s / usr/local/bin/ruby / usr/bin/ruby

Run it again.

#. / mctop-help

Usage: mctop [options]

-I-- interface=NIC Network interface to sniff (required)

-- host=HOST Network host to sniff on (default all)

-p,-- port=PORT Network port to sniff on (default 11211)

-d,-- discard=THRESH Discard keys with request/sec rate below THRESH

-r,-- refresh=MS Refresh the stats display every MS milliseconds

-h,-- help Show usage info

Then quickly use it to monitor the abnormal port:

#. / mctop-I eth2-- host=10.x.x.85-p xxx-r 1000

The figure below is as follows

You can see at a glance that the value of esf-wordfilter__all takes up the bandwidth of 4m/s and notifies the business unit to optimize it.

After reading the above, have you mastered how to use the Memcache exception timeout diagnosis tool mctop? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report