Posts

Showing posts with the label Linux

How to Fix High RAM Usage on a Linux Dedicated Server

Image
Experiencing sluggish performance, unresponsive terminals, or unexpected application crashes on your MIG servers infrastructure usually points to memory exhaustion. This guide provides the exact diagnostic commands and mitigation strategies to stabilize your Linux environment and permanently resolve memory leaks, using production-safe best practices. 1. Evaluate Current Memory Availability Before taking action, you must understand how your server distributes its resources. Run the following command to get a snapshot of your system's memory: free -h Metric Description Actionable Insight Total Physical RAM installed on your MIG Server. Baseline reference for your hardware capacity. Available Memory currently free and ready for new processes. If this is consistently near zero and swap is growing, your server is struggling. Buff/Cache RAM used by the Linux ker...

How to Detect a DDoS Attack on a Linux Server via CLI Tools

Image
  When your Linux server load suddenly spikes, guessing the cause is not an option. Your websites slow down, APIs time out, and even your SSH connection might begin to lag. In these critical moments, you need to know immediately whether you are dealing with a legitimate traffic surge, a misbehaving internal application, or a Distributed Denial-of-Service (DDoS) attack. This tutorial provides a hands-on, step-by-step guide to diagnosing malicious traffic using standard Linux command-line utilities. 1. Monitor Network Interface Traffic (Volumetric Attacks) The most common form of a DDoS attack is a volumetric flood. Before digging into your web server logs, you should check the raw traffic hitting your network interfaces. Monitor Real-Time Bandwidth with iftop   Run the following command: sudo iftop -n (Note: The -n flag prevents DNS resolution, which is crucial during an attack because DNS lookups will severely slow down the tool) Check Packets Per Second (PPS) with sar  ...

How to Build a High-Availability (HA) Cluster on Bare Metal

Image
  When deploying mission-critical applications, a Single Point of Failure (SPOF) is a disaster waiting to happen. High Availability (HA) is one of the key architectural requirements for achieving uptime targets such as 99.99%, provided that the surrounding infrastructure is also redundant. In this guide, we will architect a production-grade, 7-node High-Availability cluster from scratch using bare-metal servers connected via a Private VLAN. Phase 1: Architecture Explanation (Visualizing the Setup) Before touching the command line, you need a clear mental model of the topology. We are distributing our services across three isolated tiers: Floating IP (VIP): The single public IP address (203.0.113.100) that users hit. Tier 1 (Load Balancers): Running HAProxy and Keepalived in an Active/Passive setup. Tier 2 (Web Servers): Running Nginx and your application code. Tier 3 (Database Cluster): Running a MariaDB Galera Cluster for certification-based replication. IP Addressing Scheme H...

The SysAdmin Guide: Installing Prometheus & Node Exporter on CentOS Stream 9

Image
  If you are managing Linux infrastructure, having real-time visibility into your servers is absolutely non-negotiable. Prometheus is the industry-standard, open-source monitoring and alerting toolkit. When paired with Node Exporter , it becomes a powerhouse for collecting crucial host metrics like CPU usage, memory consumption, load averages, and network interface statistics. However, if you look for tutorials online, many of them suggest installing these tools using outdated third-party RPMs. While that might seem easier, it is not the best practice for production environments. In our latest technical guide, we break down how to deploy Prometheus and Node Exporter on CentOS Stream 9 using the official upstream binaries . This approach is cleaner, more secure, and much easier to audit. Why Avoid Outdated RPMs? Relying on old third-party repositories can introduce version mismatches, missing features, and potential security vulnerabilities. By downloading directly from the offici...