I have a problem where mysqld is using 95 - 97% CPU usage all the time.
How can I see what user is causing this ? I have installed mytop but when I use it I get
Quote:
[root@server1 ~]# mytop
Cannot connect to MySQL server. Please check the:
* database you specified "test" (default is "test")
* username you specified "root" (default is "root")
* password you specified "" (default is "")
* hostname you specified "localhost" (default is "localhost")
* port you specified "3306" (default is 3306)
* socket you specified "" (default is "")
The options my be specified on the command-line or in a ~/.mytop
config file. See the manual (perldoc mytop) for details.
Here's the exact error from DBI. It might help you debug:
Access denied for user 'root'@'localhost' (using password: NO)
we've currently got a 2 server setup, apache+mysql
Mysql server is a Xeon 3.2Ghz with 2Gb ram, scsi 73gb raid1 disks
Server has been running a while, steadily increasing in traffic. whilst 90% of the time it's running ok (load around 0.5 - 1.0, cpu around 25-50% busy mainly mysql, disk i/o around 3% busy) during heavy traffic times everything slows right down
At the moment the mysql box is only running mysql so we've allocated about 1.5gb out of the 2gb to mysql.
At present, when we get busy the apache server is queing up requests as it waits for the mysql server. Query log shows most queries are <1sec, any other's are being optimised but due to the nature of our website there are a few pesky queries (only occasionally being slow though).
question is, can this config be tuned any more or is it time for an upgrade - mainly ram to add more innodb buffers?
Here's the result of tuning-primer.sh
Code: SLOW QUERIES The slow query log is enabled. Current long_query_time = 2 sec. You have 9 out of 159346 that take longer than 2 sec. to complete Your long_query_time seems to be fine
BINARY UPDATE LOG The binary update log is enabled The expire_logs_days is not set. The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manually Setting expire_log_days will allow you to remove old binary logs automatically See http://dev.mysql.com/doc/refman/4.1/en/purge-master-logs.html
WORKER THREADS Current thread_cache_size = 384 Current threads_cached = 15 Current threads_per_sec = 0 Historic threads_per_sec = 0 Your thread_cache_size is fine
MAX CONNECTIONS Current max_connections = 150 Current threads_connected = 4 Historic max_used_connections = 18 The number of used connections is 12% of the configured maximum. Your max_connections variable seems to be fine.
MEMORY USAGE Max Memory Ever Allocated : 1 G Configured Max Per-thread Buffers : 5 G Configured Max Global Buffers : 803 M Configured Max Memory Limit : 6 G Physical Memory : 1.99 G
Max memory limit exceeds 90% of physical memory
KEY BUFFER Current MyISAM index space = 82 K Current key_buffer_size = 5 M Key cache miss rate is 1 : 1862 Key buffer fill ratio = 100.00 % Your key_buffer_size seems to be fine
QUERY CACHE Query cache is supported but not enabled Perhaps you should set the query_cache_size
SORT OPERATIONS Current sort_buffer_size = 16 M Current read_rnd_buffer_size = 7 M Sort buffer seems to be fine
JOINS Current join_buffer_size = 4.00 M You have had 0 queries where a join could not use an index properly Your joins seem to be using indexes properly join_buffer_size >= 4 M This is not advised
OPEN FILES LIMIT Current open_files_limit = 11095 files The open_files_limit should typically be set to at least 2x-3x that of table_cache if you have heavy MyISAM usage. Your open_files_limit value seems to be fine
TABLE CACHE Current table_cache value = 5467 tables You have a total of 732 tables You have 155 open tables. The table_cache value seems to be fine
TEMP TABLES Current max_heap_table_size = 255 M Current tmp_table_size = 256 M Of 21109 temp tables, 35% were created on disk Effective in-memory tmp_table_size is limited to max_heap_table_size. Perhaps you should increase your tmp_table_size and/or max_heap_table_size to reduce the number of disk-based temporary tables Note! BLOB and TEXT columns are not allow in memory tables. If you are using these columns raising these values might not impact your ratio of on disk temp tables.
TABLE SCANS Current read_buffer_size = 7 M Current table scan ratio = 929 : 1 read_buffer_size seems to be fine
TABLE LOCKING Current Lock Wait ratio = 1 : 117 You may benefit from selective use of InnoDB. If you have long running SELECT's against MyISAM tables and perform frequent updates consider setting 'low_priority_updates=1' Server is mainly Innodb due to previous row-locking issues.
How can i check (using SSH) which databases/users cause server load to mysql ?
I've tried "mysqladmin proc stat" but it shows just the current. How can i get stats of the last 24 hours for example ?
I've also seen slow connections stats. What is the command to check more detailed report of the slow connections; which databases caused it etc', in the last 24 hours for example as well.
I would like to know how to check load via ssh and check files causing load?
I want the ssh codes for 2 different set of control panels, one with cpanel+whm and other with kloxo+hypervm
and I would also know how to check the files causing the load, such as some files could have been interrupted while processing, so they could be causing load some times, so I want to stop such processes if any are running on the vps on my friends accounts
I installed the MySQL binary packages in /usr/local/mysql/ after removing the MySQL RPM package. MySQL is functioning when I executed /usr/local/mysql/bin/safe_mysqld. I reinstalled MySQL before I installed PHP. When I used a PHP script to access a MySQL database, it outputs an error:
Code: Warning: mysqli::mysqli() [function.mysqli-mysqli]: (HY000/2002): can't connect to local mysql server through socket /var/lib/mysql/mysql.sock in index.php on line 2 However, I installed MySQL in /usr/local/mysql, not in /var/lib/mysql. How do I fix MySQL?
Tue Mar 20 16:00:02 SGT 2007 on blue.mydomain.com Server Load: 16:00:02 up 21 days, 14:02, 0 users, load average: 2.73, 2.20, 2.08 Warning: Malicious Nobody Process Found ========================================= Options: kill bad proc=1 logging lvl=1
Cipher list []. Due to weaknesses in the SSLv2 cipher you should disable SSLv2 in WHM > Apache Configuration > Global Configuration > SSLCipherSuite > Add -SSLv2 to SSLCipherSuite and/or remove +SSLv2. Do not forget to Save AND then Rebuild Configuration and Restart Apache, otherwise the changes will not take effect in httpd.conf
Can someone explain this in laymen terms? I know this is new in Cpanel. I'm already running Apache 2.2, PHP 5.2.9 with suPHP enabled and mod_security as well (these rules: [url]
Also, what exactly are these CSF checks?
Check csf PT_SKIP_HTTP option This option disables checking of processes running under apache and can limit false-positives but may then miss running exploits
Check csf SAFECHAINUPDATE option This option closes a window of opportunity that opens when dynamic chain updates occur
I have one client who cannot see my server and all domains on it. I;ve checked if his IP is block or not and I didn't see his IP on the apf deny host file. How to you check IP if it can see my server? I just want to make sure before calling the ISP.
Now, via command line how can I check that ALL these work and are enabled for example? I'm not talking about visually seeing the files there, I mean actually enabled.
I recently added ubl.unsubscore.com to my email server. I only have that one and the SpamHaus (Zen) activated.
I am able to see the SpamHaus listed on DNSStuff and on SpamHaus website that the person trying to email me is not listed.
So I have to think that it is ubl.unsubscore.com list. But what domain name can I enter into the browser to check this list? www.unsubscore.com does not work. A little searching led me to lashback, but the IP is not listed there either.
Few days ago I had a problem with my httpd. I finally nailed it down and came on a conclusion that my MaxClients were set too low so I had to set it to high number and it seems like that the proble of "Network Timeout" had been resolved but now the problem is still continued. Here is what I think is wrong
Cpu(s): 1.5%us, 0.4%sy, 0.0%ni, 96.7%id, 0.3%wa, 0.3%hi, 0.8%si, 0.0%st The 96.7%id always stays above 90% is that bad and how do i fix it?
i just don't remember what was the command to check logfile in linux to see what was going on in my server, since i think someone hacked in to my server and i was ddos last couple days.
Am am running through a checklist of to-do's on a new VPS I just received. I haven't used it in a production environment yet.
While doing a root kit check I got these lines back that perturb me.
Checking `bindshell'... INFECTED (PORTS: 465) Checking `lkm'... You have 103 process hidden for readdir command chkproc: Warning: Possible LKM Trojan installed
how serious the implications are of those lines? And should I expect this on a machine that has no traffic and is a fresh install?
One of my hosted user complained that he can't access his website nor he can ping the website. When I asked him to access my 2nd server (same datacenter), it went fine. I could be thinking that my server is blocking his IP.
How do I check if his IP is blocked?
I am using APF+BFD Iptables firewall (i don't know but i hope this make sense)