Optimalize VPS Server

innweb

New member
Joined
Apr 6, 2019
Messages
1
Hi,

I need help with optimalizing my directadmin server. I tried multiple tips from this forum I still have high "Load Avarage" peaks - even to 15.00-25.00
On that sever I have few websites and aproximatly 30 mailboxes.

My KVM VPS:
  • SSD: 250GB
  • CPU: 8x2.4 GHz
  • RAM: 16GB
  • WAN: 100Mbsp (unlimited transfer)

Biggest problems that I cant handle:
1. What Can I do to increase RAM usage - i have 16GB - but even on peaks it is using max 1.2GB
2. Mysqld is taking most of CPU - I used some tips from this forum but nothing helped..
3. I enabled OPcache for PHP but I dont see any difference in using it or not.

My Mysql my.cnf:
Code:
[mysqld]
thread_stack = 256K       #default: 32bit: 192K, 64bit: 256K
sort_buffer_size =  1M    #default: 2M, larger may cause perf issues
read_buffer_size =  1M    #default: 128K, change in increments of 4K
read_rnd_buffer_size = 1M         #default: 256K
join_buffer_size = 1M     #default: 128K
binlog_cache_size = 64K #default: 32K, size of buffer to hold TX queries

## Query Cache
query_cache_size = 32M     #global buffer
query_cache_limit = 512K #max query result size to put in cache

max_connections = 2000    #multiplier for memory usage via per-thread buffers
max_connect_errors = 100          #default: 10
concurrent_insert = 2         #default: 1, 2: enable insert for all instances
connect_timeout = 30 #default -5.1.22: 5, +5.1.22: 10

## Table and TMP settings
max_heap_table_size = 1G        #recommend same size as tmp_table_size
bulk_insert_buffer_size = 1G    #recommend same size as tmp_table_size
tmp_table_size = 1G #recommend 1G min

## Thread settings
thread_concurrency = 0 #recommend 2x CPU cores [0 create as many as needed]
thread_cache_size = 100 #recommend 5% of max_connections
Please help - someone?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
Hello,

First you should identify who or what causes a higher load. Check log, apache's server status, mysql logs and mysql processes list.

Then with the gathered information you can define a best way for a protection.

There is no a single magic configuration for MySQL which would suit all the cases and solve all possible and impossible issues. No magic tablets exist.

Forums and help.directadmin.com contains enough information on:

- how to read logs
- how to see apache's server status
- how to check mysql processes list

Gather -> Analyse -> Implement.

Possible cases:

- legitimate users and too heavy MySQL queries from CMS
- bots spamming your feed-back, contact forms
- bots attacking xmlrpc.php, wp-login.php etc
- other kind of malware

Possible solutions:

- CSF/LFD+ Directadmin's BFM
- Disable access to xmlrpc.php
- Enable reCaptcha
- Install cache plugins for CMS

If it's something too new and complicated for you, then I highly suggest that you hire an admin for this work.
 
Top