Fixing High CPU or RAM Usage

High CPU or RAM usage can cause lag, slow response times, crashes, and an overall poor experience for users. Here is how to diagnose and address the issue.

Game Servers

Too many plugins or mods: Each plugin or mod consumes resources. If you have installed a large number of them, try disabling non-essential ones to see if performance improves.

Excessive world size or entities: Large worlds with many loaded chunks, entities (mobs, items, vehicles), or complex redstone can be very demanding. Use tools specific to your game to prune or optimise the world.

Misconfigured settings: Settings like view distance (Minecraft) or resource tick rates (FiveM) directly impact performance. Lowering these values can significantly reduce resource usage.

Memory leaks: Some plugins or mods may have memory leaks that cause RAM usage to increase over time. Regular restarts (using the Pterodactyl scheduler) can mitigate this.

Web Hosting

Unoptimised scripts: Poorly written PHP code, inefficient database queries, or missing caching can cause high CPU usage. Install a caching plugin (like WP Super Cache for WordPress) and optimise your database.

Traffic spikes: Sudden increases in visitors can overwhelm shared resources. Consider enabling a CDN (like Cloudflare) to offload static content.

Cron jobs: Overly frequent cron jobs running heavy scripts can consume significant resources. Review your cron schedule in your control panel.

VPS / Dedicated

Use htop or top to identify which processes are consuming the most resources. Common culprits include database servers (MySQL/MariaDB) that need tuning, web servers under heavy load without caching, runaway processes or scripts stuck in infinite loops, and insufficient swap space. Address the specific process causing the issue, or consider upgrading your plan if you have genuinely outgrown your current resources.

Tip: If your game server consistently uses over 80% of its allocated RAM, it is time to either optimise your setup or upgrade to a plan with more memory.

 

Was this article helpful?