Link to home
Start Free TrialLog in
Avatar of Jasmin shahrzad
Jasmin shahrzad

asked on

cpu for mysql

I have 8core cpu
model name   : AMD EPYC 7501 32-Core Processor
on ubuntu 16. i running mysql on this server and som apache2. nothing else.
Server is Extremely slow. i have 32 gig memory.
some process is going to 170 in cpu process and it's mysqld. and other cpu do noting.
is wrong cpu or what can be here? HELP
Avatar of Kimputer
Kimputer

MySQL and Apache2 will even run on the most old CPU you can find from over 10 years ago (I know,I can easily run Wordpress sites on old PC's).

So the real question is: How much data in de database and how complex are the queries?


Tune the mysql, do you have phpmyadmin installed?
Do not restart mysql before you check the stats and recommendations.

what type of site do you have?
are you running CMS, drupal, wordpress, etc.

enable slowquery logging to see if that is the issue.

32core with 32 meg seems too much power with little ...
often RAM improves performance
As Kimputer said a smaller, and older machine should perform ....
ASKER CERTIFIED SOLUTION
Avatar of rindi
rindi
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jasmin shahrzad

ASKER

I can't check the mysql code.
this is a server from linode (virtual). there is a 5TB data on this server.
What i can see in my ubuntu monitoring (glances,...) there is a mysqldmp constant running min. 100% and most of time 140%. 
MySQL's own documentation:

mysqldump advantages include the convenience and flexibility of viewing or even editing the output before restoring. You can clone databases for development and DBA work, or produce slight variations of an existing database for testing. It is not intended as a fast or scalable solution for backing up substantial amounts of data. With large data sizes, even if the backup step takes a reasonable time, restoring the data can be very slow because replaying the SQL statements involves disk I/O for insertion, index creation, and so on.

It seems your database is contantly backup up or something. Probably one run doesn't end, when the next run has begun. Please check your backup jobs, and find a more suitable solution (maybe from the Enterprise subscription). Backing up that 5TB probably takes days.
Hi,

I strongly recommend that you install mysqltuner from the repo and run the script periodically and tune the database according to the recommendations that the script provides.
The script can identify a lot of bottlenecks and missconfiguration that your MySQL system may have considering how your data is and how queries are running on it.

Regards,
    Tomas Helgi
5TB of data with 32GB of Ram, seems this is why mysql is tied to a single CPU and cranching the data.
Is this is a warehouse style data, i.e. mostly read minimal writes.

You do not have to implement anything the phpmyadmin stats based recomendation say nor the mysqltunner, but it will provide you a basis on which to act, possibly to increase the RAM on the VM
Very strenge. I have 32 gig ram. They using 18 cache 8 and 6 free.
Swap 58% of 1.5 gig swap.
Swap was selecting wrong from start
Only 250mb i sdb. It's added 1gig in sda as swap. 
what is the system supposed to do?
If you have constant traffic, say on a WordPress or other CMS system, you'll see constant CPU load.

If you have 8x cores + see 170% usage, this means 1.7X cores are saturated.

This is very common.

If required, the way you... unload CPU cycles + also reduce Disk I/O thrash, is to use mysqltuner to tune your MySQL instance to run at memory speed...

So... Use InnoDB tables (not MyISAM)... then run mysqltuner repeatedly (by the hour, then day, then week) adding in tunings whenever a tuning is specified.

If you have 32G of memory, for most common workloads, this is sufficient memory for MySQL to be tuned to run at memory speed.
The system is 8 processors of AMD EPYC 7501 32-Core Processor?
@arnold: Yes. Glances say it is 8 core
And cpu is AMD.... 
Is the complete server rented out to you, or is it just the current VM? Hypervisors often don't reflect the correct CPU, how do you get the info about it? Did you install the VM yourself, or was that done by the provider?

If it really is the "AMD EPYC 7501 32-Core Processor", then it has 32 Cores & Hyperthreading, so if Hyperthreading is enabled in the BIOS, it would appear as a 64 Core CPU...

As you can define how many Cores are presented to the VM within it's settings, it is possible you have been assigned 4 Cores & 8 Threads..., making it appear as an 8 Core CPU.

But anyway, that should still be enough to handle your system.
IT is linode server for 2yeare ago or more. Sign in on linode and Buy virtuel server. And....
Information about cpu i look at cat cpu command and find cpu model and name. 
Oh, ok 8core VM running on a host that has the AMD 32core processor/s

8 cores as rindi so nicely, put would mean that if hyperthreading is enabled, your system has 16 logical processors with 32GB or memory, 5TB of data.  
Much depends on nature of data and queries.

Tunning query first to get an idea whether the DB is optimally configured and if not what are the recommendations to start off with. i.e. the query allocated memory is too much meaning the queries when run exhaust the available resource. or too small, and the thing has to swap.
is the apache log reflect that it has child spawns that hang around because the SQL side is taking too long to respond.....

etc.
ok. unfortunately is disabled
fx. for cpu0  file 
/sys/bus/cpu/devices/cpu0/topology/thread_siblings_list  
show  0  which means it's still 32 and system has 8 logical process. What now?
Not sure I understand the response.
Cat /proc/cpuinfo

The make of the CPU provides info on host cou, while the count reflects what the system has.

If your MySQL is 5TB in size, unless it is filled with binary data, images as an example or documents where queries run fast, but extracting the data to serve it up to the client is where the processing might be the issue.
32 gb might not be enough depending on query complexity and data returned per average query.

Caching settings, query resource allocation/set aside

IMHO, tunning MySQL or at least get a gauge of whether it is Eden needed, to then focus whether the webserver is setup to address the volume of expected requests.
at /proc/cpuinfo  | grep 'name'| uniq
model name   : AMD EPYC 7501 32-Core Processor
and as i mention i last post  /sys/bus/cpu/devices/cpu0/topology/thread_siblings_list  is 0
this means we are not running 64 
The problem is, that unless you have direct access to the server Hardware, you can't really see what is actually running there. As far as I know, your hosting Company uses KVM as it's HyperVisor.

I also use KVM on my PC's. Now as an Example, the Notebook I'm using right now to answer this Comment, a Dell Latitude e6530 with a Core i5 3230 CPU (2 Cores with HyperThreading on, so to the OS it appears as a 4 Core CPU, since Hyperthreading makes it look as if your Cores have doubled).

Now is I open the "Virt-Manager" utility (that is a GUI tool which I can use to configure, Setup & Manage my VM's), & open one of the VM's and look at it's properties, select CPU, it shows Logical Host CPU's as 4 (I can reduce that number if I wanted to, down to one), & under Configuration it shows "Copy Host CPU Topology" as enabled.
User generated image

 Now If I start the VM, you will see that the VM itself sees a totally different CPU as Host (XEON E3-12xx), with 4 Cores/4 Threads, which would mean Hyperthreading would be off, which actually isn't the case... So the VM itself doesn't need to reflect the actual Configuration.


User generated image
In the VM's Properties I could also uncheck the "Copy Host CPU Configuration" Then I get a list of possible CPU's, but that still doesn't mean that the VM will then report the correct CPU Model.

Under CPU Topology I can change the sockets to 1, Cores to 2, & Threads to 2.


User generated image
Now the VM at least shows 2 Cores, 4 Threads correctly.


User generated image
This shows that What the VM reports isn't necessarily according to the facts, & it also depends on how your provider configured it all.