Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Troubleshooting
  6. /
  7. Slow Server Performance
GUIDETroubleshooting

Slow Server Performance — Optimization Guide

4 min read

A slow server affects user experience, search engine rankings, and business revenue. This guide helps you identify the cause of poor performance and apply targeted optimizations to speed things up.

Step 1 — Identify the Bottleneck

Server performance issues are typically caused by one of four resources:

Check CPU Usage

bash
htop

If CPU is consistently above 80%, identify the top processes and determine if they need optimization.

Check Memory

bash
free -h

If available memory is very low (under 100 MB), you may need to optimize memory usage or upgrade.

Check Disk Space and I/O

bash
# Disk space
df -h

Disk I/O performance

iostat -x 5

High I/O wait (%iowait in top or vmstat) indicates disk bottlenecks.

Check Network

bash
# Bandwidth usage
sudo nethogs

Network connections

ss -tuln

Step 2 — CPU Optimization

Identify CPU-Hungry Processes

bash
# Sort by CPU usage
ps aux --sort=-%cpu | head -20

Common CPU Consumers and Fixes

ProcessFix
MySQL/MariaDBOptimize queries, add indexes, increase buffer pool
PHP-FPMReduce worker processes, enable opcache
ApacheReduce MaxRequestWorkers, switch to event MPM or Nginx
Node.jsCheck for infinite loops, optimize code
Cron jobsStagger schedules, optimize scripts
Malware/minersInvestigate unknown processes, secure server

Optimize MySQL

sql
-- Find slow queries
SHOW PROCESSLIST;

-- Enable slow query log SET GLOBAL slow_query_log = 'ON'; SET GLOBAL long_query_time = 2;

Step 3 — Memory Optimization

Identify Memory-Hungry Processes

bash
ps aux --sort=-%mem | head -20

Reduce Memory Usage

Web server:

bash
# Nginx — reduce worker connections
sudo nano /etc/nginx/nginx.conf

Set: worker_connections 512;

Apache — reduce MaxRequestWorkers

sudo nano /etc/apache2/mods-enabled/mpm_prefork.conf

Reduce MaxRequestWorkers to match available RAM

PHP:

bash
sudo nano /etc/php/*/fpm/php.ini

Set: memory_limit = 128M (reduce from 256M if possible)

Database:

bash
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Tune innodb_buffer_pool_size to ~70% of available RAM for dedicated DB servers

Add Swap Space (Temporary Fix)

bash
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Swap is not a replacement for adequate RAM — it prevents crashes but is slower.

Step 4 — Disk Optimization

Free Up Disk Space

bash
# Find large files
du -sh /var/log/* | sort -h | tail -10

Clear package cache

sudo apt clean # Ubuntu/Debian sudo dnf clean all # CentOS/AlmaLinux

Rotate and compress logs

sudo logrotate -f /etc/logrotate.conf

Improve Disk I/O

  • Enable caching — Use Redis or Memcached for frequently accessed data.
  • Optimize database queries — Reduce disk reads with proper indexing.
  • Move to SSD — If on HDD storage, consider upgrading to an SSD-backed plan.

Step 5 — Web Server Optimization

Enable Gzip Compression (Nginx)

nginx
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml;
gzip_min_length 256;

Enable Browser Caching (Nginx)

nginx
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff2)$ {
    expires 30d;
    add_header Cache-Control "public, immutable";
}

Enable PHP OPcache

bash
sudo nano /etc/php/*/fpm/php.ini
ini
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60

Restart PHP-FPM:

bash
sudo systemctl restart php*-fpm

Step 6 — Application Optimization

  • Enable application caching — Use Redis or Memcached for session storage and page caching.
  • Optimize database queries — Add indexes, rewrite slow queries, use query caching.
  • Optimize images — Compress images and serve appropriate sizes.
  • Use a CDN — Offload static assets to a Content Delivery Network.
  • Minimize HTTP requests — Combine CSS/JS files, use lazy loading.

When to Upgrade

If optimizations are not enough, consider upgrading your plan:

  • CPU consistently above 80% after optimization.
  • Available RAM consistently below 200 MB.
  • Disk space above 85% after cleanup.
  • Traffic growth exceeding current capacity.
See How to Upgrade Your Server Plan.

What to Do Next

  • Monitoring Server Performance — Track resource usage.
  • How to Upgrade Your Server Plan — Scale up resources.
  • Website Down — Quick Diagnosis — If performance leads to downtime.
  • Complete Server Security Checklist — Ensure security is not causing overhead.

Was this article helpful?

← Back to TroubleshootingBrowse all categories →

Still have questions?

Contact Support →Submit a Ticket