Sunday, July 22, 2018

linux - server with high CPU and memory usage

I have a server with one WordPress website on it, but the resources of the server is almost finished. please check the image:



here



Where should i start to figure out the problem? should i get a server with higher resources ?



The server has one website with 600MB DB and about 900 visits per day
Some details about the server:

- mpm prefork



    

StartServers 100
#StartServers 10
MinSpareServers 100
MaxSpareServers 400
MaxRequestWorkers 800
MaxConnectionsPerChild 800

ServerLimit 800




2- my.cnf



 key_buffer      = 1G

key_buffer = 512M


max_allowed_packet= 512M

max_connections = 10000

max_connections = 1000

innodb_buffer_pool_size = 10G

innodb_log_file_size = 10G


innodb_file_per_table = 1

innodb_autoextend_increment=256

innodb_buffer_pool_size=10G

innodb_buffer_pool_instances=4

innodb_buffer_pool_instances=2


innodb_log_file_size = 104857600

innodb_log_files_in_group = 5

innodb_log_buffer_size = 268435456

innodb_io_capacity = 10000

innodb_io_capacity = 1000


thread_cache_size = 16

thread_cache_size = 8



key_buffer = 16M

max_allowed_packet = 16M


thread_stack = 192K

thread_cache_size = 16

thread_cache_size = 8

query_cache_type = 1

query_cache_limit = 20M


query_cache_limit = 10M

query_cache_size = 100M

query_cache_size = 50M



tmp_table_size = 512M


table_open_cache_instances = 16


slow_query_log = 1

slow_query_log_file = /var/log/mysql/slow.log


3- meminfo




    MemTotal:       32459956 kB

MemFree: 6863712 kB

MemAvailable: 13162120 kB

Buffers: 1393928 kB

Cached: 5670744 kB


SwapCached: 39276 kB

Active: 20290788 kB

Inactive: 4120816 kB

Active(anon): 17336008 kB

Inactive(anon): 973836 kB


Active(file): 2954780 kB

Inactive(file): 3146980 kB

Unevictable: 0 kB

Mlocked: 0 kB

SwapTotal: 1046520 kB


SwapFree: 240992 kB

Dirty: 9088 kB

Writeback: 0 kB

AnonPages: 17307716 kB

Mapped: 263800 kB


Shmem: 962912 kB

Slab: 742360 kB

SReclaimable: 601588 kB

SUnreclaim: 140772 kB

KernelStack: 9760 kB


PageTables: 179828 kB

NFS_Unstable: 0 kB

Bounce: 0 kB

WritebackTmp: 0 kB

CommitLimit: 17276496 kB


Committed_AS: 33425764 kB

VmallocTotal: 34359738367 kB

VmallocUsed: 329084 kB

VmallocChunk: 34358947836 kB

HardwareCorrupted: 0 kB


AnonHugePages: 20480 kB

HugePages_Total: 0

HugePages_Free: 0

HugePages_Rsvd: 0

HugePages_Surp: 0


Hugepagesize: 2048 kB

DirectMap4k: 295140 kB

DirectMap2M: 15108096 kB

DirectMap1G: 17825792 kB

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...