Shared Server Issues

Status
Not open for further replies.

philhanson

Ars Scholae Palatinae
1,397
Out company has a shared server with about 15 thousand WP running on it over WHM and Cpanel. Last week the server just died and now all sites are sporadic in loading anything from MySql. The company we host with said one of the sites has a bad plug in taking down the rest of the server, is this possible? How would we go about finding just which WP install has the bad plug-in? We are a small company so don't have a dedicated server person and the company we have a server through only looks t hardware related issues. Couple other things.

Load is extremely high, like between 20-40.
/tmp folder get filled up constantly with .MYD files, I assume MySql backups?
There is only a few hundred megs of RAM free at any given time, almost 62 gigs of 64 is cached.

I'm just a designer but, any ideas what we could look for. Thanks.
 

kperrier

Ars Legatus Legionis
21,511
There is only a few hundred megs of RAM free at any given time, almost 62 gigs of 64 is cached
For a linux server, this is totally normal.

I don't know anything about WordPress (I assume that is what WP is) so I can't tell you.

/tmp folder get filled up constantly with .MYD files, I assume MySql backups?
Don't know. A mysql backup can be named anything since a db backup us just the mysqldump command with the output redirected to a file. The file could be called resume.docx if you wanted to name it that.

Load is extremely high, like between 20-40.
Is it possible that a cron job was created that runs every minute and takes a long time to run? I suppose a bad WordPress plug-in could be doing something too but, again, I don't know anything about WordPress to even direct you in the right direction. Is there a way to see the install date of the plug-ins? Disable, or roll back if it was an upgrade, the newest one installed and see if that fixes the issue. Or, remove one virtual server from the apache config, restart apache and see of the load issue comes back. If it does, put that config back and remove another one. Repeat until you find the smoking gun. This will be easy if each apache config is a separate file in /etc/httpd/conf.d (assuming you are using a Red Hat variant, no idea where debian httpd puts its virtual host configurations.
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
Short answer: Hire someone who knows how to administrate your server for you. At least on a contract or hourly consulting basis.

Long answer:

Yes, wordpress and its plugins can be huge security problems and resource pigs for any of a million reasons, *especially* if you are not updating them religiously. Those 15 thousand wordpress sites are probably about 14 thousand sources of spam, viruses and network attacks if you are not keeping up to date and running proper hardening practices and plugins on those wordpress installs (every one of them).

My first recommendation would be to nuke the machine and start clean unless you know that the wordpress installs have been kept up to date and secure (each should have different passwords etc).

If you can't do that and you actually want to keep all that junk running, get Cloudlinux for that machine. It can do a great job of managing resource use automatically on a WHM server with a lot of user accounts. Also, since you are probably paying for Cpanel license and maybe support, make sure that is updated as well and reach out to their support for any additional help.

To troubleshoot the actual problem, you need to start with some basic Linux sysadmin skills like using commands like top (like the task manager in windows sort of), ps, lsof, iftop and iotop. The program mytop can show you top 'processes' in mysql in more or less realtime and can be super helpful in troubleshooting performance issues in the database server. Googling those commands/programs will show you a ton of recommendations and guides for tracking down processes, problems and slowdowns on a server. For exploit/hack possibilities check into running maldet on the server. It can scan and find a lot of nasty things that are probably on there.

WHM has a ton of tools in its interface to help with this too. They have guides for how to find the busy user accounts, high storage users, high network users, etc. Very helpful stuff.
 

Defenestrator

Ars Scholae Palatinae
923
Subscriptor++
Step 1 is to find your bottleneck. Is it CPU? Disk I/O? "load avg" by itself doesn't mean a whole lot. "vmstat" and "iostat -x" will tell you a bit more for the disk, and just "top" is good for CPU. If your bottleneck is I/O, then "iotop" will tell you what's using the disk so much

Like metadaemon said, the MYD files are temporary tables for MySQL that usually imply some sort of large queries.

There's not enough info to be entirely sure, but my guess is that you're not feeding MySQL enough of the system's RAM. Double-check that you're using InnoDB for most or all of your tables and not MyISAM (and switch to InnoDB if not). Make sure you're using O_DIRECT in MySQL and increase the size of the innodb_buffer_pool, tmp_table_size, and max_heap_table_size.
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
Yeah, I am assuming he has it since it is apparently their dedicated server. Not having root access makes running WHM a pain too.
Oh, watch for the root cron file in that directory. Probably don't want to move that one. You can take a look at it and see if there is anything strange looking in there. This is where having an experienced admin comes into play though. Someone with experience will take a few seconds to a minute to track this stuff down and know what is supposed to be there and what looks wrong. Doing it without that experience can take days of research and trial and error, possibly causing real issues on the server as you poke at things. :scared:
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
If you can't access phpmyadmin from Cpanel you need some big boy help on the server. Open a ticket with Cpanel support and they will get you fixed up. If they can't do so easily, your server is a huge mess and needs to be wiped and restored, most likely. You could spend hours tracking down logs on why the basic database access is not working but you have WHM/Cpanel for a reason. Part of that is maintenance and support. ;)
 
Status
Not open for further replies.