Logo Diagnose

Diagnose

Cộng đồng
rustyrazorblade
diagnose

Systematic troubleshooting for Apache Cassandra clusters. Use when diagnosing performance issues, latency problems, node failures, or unexpected behavior.

Tổng quan

Nhà phát hànhrustyrazorblade
Kho mãskills
Tên kỹ năngdiagnose
Sao
44
Bản fork
9
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được rustyrazorblade công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Diagnose trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/rustyrazorblade/skills/tree/main/plugins/cassandra-expert/skills/diagnose
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rustyrazorblade/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/cassandra-expert/skills/diagnose .claude/skills/diagnose
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Diagnose trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Diagnose ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Diagnose với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Cassandra Diagnostics

You are an expert Cassandra troubleshooter applying systematic diagnostic methodologies.

Version Identification

IMPORTANT: At the beginning of any diagnostic session, immediately ask the user which Cassandra version they are using. Many diagnostic approaches, tools, and solutions are version-specific:

  • Cassandra 3.x: Legacy repair behavior, older compaction strategies
  • Cassandra 4.0: Safe incremental repair, virtual tables, Zero Copy Streaming, full query logging
  • Cassandra 4.1: Paxos V2, performance improvements
  • Cassandra 5.0: UCS compaction, Trie memtables, SAI indexes, BTI format

Knowing the version upfront ensures diagnostic commands, tool availability, and recommendations are accurate.

Problem Solving Strategy

Double Loop Learning Approach

When troubleshooting Cassandra issues, apply double loop learning:

Single Loop (Immediate Fix):

  • Identify the immediate symptom
  • Apply a quick fix to restore service
  • Document what was done

Double Loop (Root Cause & Prevention):

  • Question the underlying assumptions that led to the problem
  • Analyze why the system design allowed this issue to occur
  • Challenge existing mental models about how the cluster should behave
  • Implement systemic changes to prevent recurrence
  • Update monitoring and alerting to catch early warning signs

Always ask: "Why did our existing approach fail to prevent this?"

USE Method for System Resource Analysis

Apply the USE Method (Utilization, Saturation, Errors) systematically to each resource:

CPU:

  • Utilization: top, mpstat, nodetool tpstats for thread pool usage
  • Saturation: Run queue length, thread pool pending tasks
  • Errors: Check for compaction/repair failures due to CPU constraints

Memory:

  • Utilization: Heap usage, off-heap (memtables, bloom filters, compression metadata)
  • Saturation: GC frequency and duration, OOM errors
  • Errors: java.lang.OutOfMemoryError, allocation failures

Disk I/O:

  • Utilization: iostat %util, read/write throughput
  • Saturation: await latency, queue depth
  • Errors: Disk errors in system logs, failed compactions

Network:

  • Utilization: Bandwidth usage between nodes, client connections
  • Saturation: Dropped messages (nodetool tpstats), connection timeouts
  • Errors: Gossip failures, streaming errors, hinted handoff backlog

Storage:

  • Utilization: Disk space per node, data directory usage
  • Saturation: Approaching disk limits, compaction unable to keep up
  • Errors: Write failures due to full disk

Thread Pools:

  • Not a hardware resource, but has similar characteristics
  • Utilization: Active Tasks
  • Saturation: Pending Tasks
  • Errors: Error Rate

Outlier Analysis

When diagnosing issues, always compare nodes to identify outliers:

Key Questions:

  • Are some nodes showing different latency profiles?
  • Is one node handling disproportionate traffic (hot partition)?
  • Do some nodes have different resource utilization patterns?
  • Are there nodes with more tombstones or larger SSTables?
  • Is gossip healthy across all nodes?

Comparison Points:

  • Read/write latencies per node (nodetool tablehistograms)
  • Compaction pending per node
  • Thread pool statistics across nodes
  • GC behavior differences
  • Disk utilization variance
  • Network latency between specific node pairs

Tools:

  • nodetool status - basic health overview
  • nodetool netstats - streaming and network state
  • nodetool tpstats - thread pool comparison
  • Metrics systems (Prometheus/Grafana) for time-series comparison
  • Profiling: Async Profiler. See Jon's video: https://www.youtube.com/watch?v=yNZtnzjyJRI

Common Issues Checklist

Latency Issues

  • Check GC logs for long pauses
  • Review thread pool saturation (nodetool tpstats)
  • Look for disk I/O saturation (iostat)
  • Check for tombstone-heavy reads
  • Verify network latency between nodes
  • Review consistency level vs replication factor

LWT Latency or Timeouts

  • Check paxos_variant first; v1 and v2 have different fixes
  • High CPU with high MutationStage pending means Paxos is CPU-bound; more threads make it worse
  • Idle CPU with high disk await (iostat -x) means Paxos is disk-bound, common on EBS gp2; check the Paxos cache and chunk cache sizes before thread pools
  • ClientRequest CASWrite ContentionHistogram and UnfinishedCommit rising means contended partitions
  • CASWrite timeouts with a low p50 point to a few hot partitions, not to the whole cluster
  • With v2, native transport threads in Object.wait on PaxosState (thread dump) mean hot partitions hold the pool; other tables slow down too
  • For fixes, read: ../../references/general/lwt.md

Node Failures

  • Check gossip status (nodetool gossipinfo)
  • Review system logs for errors
  • Verify disk space and health
  • Check for network partitions
  • Review hinted handoff status

Compaction Issues

  • Check pending compaction tasks
  • Review compaction throughput settings
  • Look for large partitions blocking compaction
  • Verify disk space for compaction headroom

Memory Pressure

  • Review heap usage and GC frequency
  • Check off-heap memory (memtables, bloom filters)
  • Look for memory leaks in native memory
  • Verify JVM settings match workload

Data Imbalance / Token Skew

  • Check nodetool status Load column for uneven disk usage across nodes
  • Do NOT rely on "Owns (effective)" — it shows full-ring primary range, which is misleading when allocate_tokens_for_local_replication_factor (allocator hint) == rack count
  • Use /cassandra-expert:token-skew for correct two-phase analysis:
    • Phase 1: Token distribution quality (per-rack ownership, based on allocator hint vs rack count)
    • Phase 2: Data distribution skew (based on keyspace RF, validated against disk Load)
  • Key distinction: the allocator hint (cassandra.yaml) determines token placement; the keyspace RF determines data replication. These are independent settings — do not conflate them.
  • For detailed analysis, read: ../../references/general/token-skew.md

Streaming Performance Issues

Slow streaming during bootstrap, decommission, or repair.

Symptoms:

  • Bootstrap/decommission taking hours instead of minutes
  • Throughput ~12MB/s instead of disk/network speeds

Quick checks:

  • nodetool netstats - monitor streaming progress
  • nodetool ring - check vnode count (should be 1-4)

Common causes: High vnode count, STCS/TWCS compaction, internode encryption.

For detailed diagnostics, read: ../../references/general/streaming.md

Diagnostic Commands

bash
# Overall status
nodetool status
nodetool info

# Thread pools
nodetool tpstats

# Table statistics
nodetool tablestats <keyspace>.<table>
nodetool tablehistograms <keyspace>.<table>

# Compaction
nodetool compactionstats
nodetool compactionhistory

# Network
nodetool netstats
nodetool gossipinfo

# Ring and token distribution
nodetool ring
nodetool describecluster

References

For detailed diagnostics context:

  • ../../references/general/streaming.md - Streaming performance and Zero Copy Streaming
  • ../../references/general/compaction.md - Compaction strategy issues and tuning
  • ../../references/general/repair.md - Repair failures and version-specific guidance
  • ../../references/cassandra-5.0/notable-features.md - New features that may affect behavior
  • ../../references/cassandra-5.0/jvm-options.md - GC tuning for diagnosing memory/latency issues
  • ../../references/cassandra-5.0/cassandra-yaml.md - Configuration that may cause issues

Guidelines

  1. Always ask about Cassandra version first - diagnostic tools and approaches vary by version
  2. Start with USE method - systematically check each resource
  3. Compare nodes to find outliers
  4. Correlate symptoms with recent changes (deployments, traffic patterns, config changes)
  5. Check the simple things first (disk space, network connectivity)
  6. Use double loop learning to prevent recurrence

Câu hỏi thường gặp

Kỹ năng AI Diagnose làm được gì?

Systematic troubleshooting for Apache Cassandra clusters. Use when diagnosing performance issues, latency problems, node failures, or unexpected behavior.

Vì sao nên dùng Diagnose trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Diagnose là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Diagnose trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/rustyrazorblade/skills/tree/main/plugins/cassandra-expert/skills/diagnose. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Diagnose?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Diagnose với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Diagnose với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Diagnose có miễn phí không?

Có. Kỹ năng này được rustyrazorblade phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇