Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Fix memcached-tool script file #804

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

cheesecrust
Copy link

@cheesecrust cheesecrust commented Nov 11, 2024

πŸ”— Related Issue

  • https://github.com/jam2in/arcus-works/issues/629
  • https://github.com/jam2in/arcus-works/issues/633
  • memcahed-tool script λ₯Ό μˆ˜ν–‰ν•˜κ²Œ 되면 stats cachedump μˆ˜ν–‰μ‹œ λ°˜ν™˜ 값이 κΈ°μ‘΄ μ½”λ“œμ˜ μ •κ·œμ‹μ—μ„œ μΆ”μΆœν•˜μ§€ λͺ»ν•˜κ²Œ λ©λ‹ˆλ‹€.
  • 이에 이 pr 을 μ μš©ν•˜κ²Œ 되면 memcached-tool을 μˆ˜ν–‰ν–ˆμ„λ•Œ ν˜„μž¬ arcus-memcached의 cachedump λ°˜ν™˜κ°’μ„ κ·ΈλŒ€λ‘œ 보여주도둝 ν•©λ‹ˆλ‹€.

⌨️ What I did

  • μ˜€ν”ˆμ†ŒμŠ€ memcached μ„œλ²„μ— stats cachedump <bucket> <items>λ₯Ό μ‹€ν–‰ν•˜λ©΄ ITEM foo [6 b; 1176415152 s] 값을 λ°˜ν™˜ν•©λ‹ˆλ‹€.(μ΄λ•Œμ˜ b μ•žμ˜ μˆ«μžλŠ” ν‚€ 포함 ν•­λͺ© 크기(λ°”μ΄νŠΈ)λ₯Ό μ˜λ―Έν•˜κ³ , s μ•žμ˜ μˆ«μžλŠ” Expiration timestamp(arcus의 exptime κ³Ό κ°™μŠ΅λ‹ˆλ‹€.) μž…λ‹ˆλ‹€.)
    그리고 memcached-toolμ—μ„œλŠ” key λ§ˆλ‹€ ν•­λͺ©μ˜ λ°”μ΄νŠΈ 크기λ₯Ό λ³΄μ—¬μ£Όμ—ˆμŠ΅λ‹ˆλ‹€.
  • ν•˜μ§€λ§Œ, arcus memcached μ„œλ²„λŠ” stats cachedump <bucket> <items>λ₯Ό μ‹€ν–‰ν•˜κ²Œ 되면 ITEM arcus [acctime=22, exptime=0]와 같이 좜λ ₯λ©λ‹ˆλ‹€.
  • λ”°λΌμ„œ, cachedumpκ°€ 좜λ ₯ν•˜λŠ” ν˜•νƒœκ°€ μ˜€ν”ˆμ†ŒμŠ€ memcahedμ™€λŠ” 달라짐에 따라 arcus-memcached μ„œλ²„μ—μ„œ λ°˜ν™˜ν•˜λŠ” exptime을 μΆ”μΆœν•˜μ—¬ 보여주기 μœ„ν•΄ μ •κ·œμ‹μ„ (/^ITEM (\S+) \[(.*?exptime=(\d+)\]/) 이와 같이 μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

scripts/memcached-tool Outdated Show resolved Hide resolved
@namsic namsic removed their request for review November 12, 2024 01:05
@cheesecrust
Copy link
Author

  • memcached-tool을 μ‹€ν–‰ν•˜κ²Œ 되면
print "add $k $flags $keyexp{$k} $len\r\n$val\r\n";

μœ„μ™€ 같은 포멧으둜 좜λ ₯λ©λ‹ˆλ‹€.
λ”°λΌμ„œ μ•„λž˜μ™€ 같은 κ²°κ³Όλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.

  Dumping memcache contents
    Number of buckets: 1
    Number of items  : 1
  Dumping bucket 0 - 1 total items
  add key 0 529 5
  cache

λ”°λΌμ„œ μ΄λ•Œ 529κ°€ exptime μž…λ‹ˆλ‹€.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants