How To Check Which Mysql Databases Cause Server Load
Jul 30, 2007
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.
View 4 Replies
ADVERTISEMENT
Jul 16, 2009
I have cPanle shared account.
Is there a way to automatically check and repair mysql databases and tables, that can be scheduled as cron job?
View 9 Replies
View Related
Jul 1, 2009
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
View 5 Replies
View Related
Jul 14, 2007
my server load was above 200+ today on this specific time.
How do I check from logs what is going on? Where do I begin?
16:28:11 up 32 days, 22 min, 2 users, load average: 241.03, 108.69, 54.24
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
mi pts/0 xxx.82.73.xxx Thu20 0.00s 0.06s 0.39s sshd: mi [priv]
mi pts/1 xxx.82.73.xxx Thu21 18.00s 1:07m 0.37s sshd: mi [priv]
View 9 Replies
View Related
Mar 24, 2008
Since I have never worked on the server end of things I had a quick question for all you web hosting gurus.
Is it possible to have PHP installed on ONE single server and still have the ability for the server to work with both MS Access AND MySQL at the same time?
I would think YES, but I am being told by our server branch at my current job that this is not the case. They claim there is no way for the server on one machine to be able to handle both types of databases. Are they right?
If they are wrong and it is possible to have one server run both type of databases, what steps would be necessary to set up the server to handle both types? Do we need to tweak the php.ini file or is there another method of allowing the server the ability to work with both MySQL and MS Access.
Sorry if this question seems stupid or odd, as I said, I have minimal experience on the server end but I am confident that a server can handle both.
View 10 Replies
View Related
Dec 16, 2007
Anybody got a good script to check the server load and to send email if it is pretty high? Perl or bash one?
View 4 Replies
View Related
Feb 11, 2008
I recently had a harddrive failure and luckliy I can still access certain directories on this failed drive. I can still access the /var/lib/mysql/ directory which holds all the users databases and have backed all these up separately using tar.
Now what I need to know is how do you restore these database files to another server? I tried simply untar'ing one of these to the new servers /var/lib/mysql/ direcotry and it stuffed Mysql up - it went offline. I had to get a cpanel tech to bring Mysql back online.
how can I get these database files to fully work on a new server?
View 2 Replies
View Related
Sep 24, 2008
I need to export all databases on my server to put it on my new server. Is there a quick and easy way to do that without doing the WHM transfer?
View 4 Replies
View Related
Oct 25, 2009
Just wanted to ask, which folder are the MySQL databases held in for Cpanel? Running CentOS 5 VPS.
View 7 Replies
View Related
Dec 14, 2008
I've recently been asked to do a lot of data extraction from a state that has about 20 databases, each with between 10 and 100 tables. I often find myself diagramming things out on paper to try to visualize how everything works together.
I wondered if there's a tool that would "draw" the tables, columns, and relationships? I hesitate to say this, but almost like how MS Access does it, but that runs on Linux and does MySQL. Is there such a thing? I know about phpMyAdmin and MySQL's Query Browser, but it's not what I'm looking for.
View 3 Replies
View Related
Mar 9, 2007
I am running a dedicated server with Debian, and I installed a community sofware that has a lot of mySQL entries, many of which need to be changed to fit my needs
However, it is very hard to know exactly where each value I need to change is stored. Is there a way to search all database tables for a specific value?
For example, one thing that is stored in the database is the site's title displayed in the browser's title bar. The sofware does not give me the option to change it, so I have to find where it is located in the database and change it myself, but it would be extremely time comsuming to check all tables one by one for any occurences of the current title.
View 10 Replies
View Related
Sep 14, 2007
My HD was failing. So ServerBeach quickly set me up with a fresh box with the dying drive installed as a secondary drive. (nice job guys)
I'm able to mount the secondary drive and browse/copy the files... but when I get to the most important files of all, the database binaries, my /var/lib dir looks like this:
Code:
[root@rosemary v2]# ls -l /mnt/dying/var/lib/
total 68
...
....
-rw-r--r-- 1 root root 2171 Sep 14 03:02 logrotate.status
drwxrwsr-x 6 root 41 4096 Oct 12 2005 mailman
drwxr-xr-x 2 root root 4096 Oct 12 2005 misc
?--------- ? ? ? ? ? mysql
drwxr-xr-x 4 root root 4096 Oct 12 2005 nfs
drwxr-xr-x 2 ntp ntp 4096 Sep 14 10:31 ntp
...
...
And if I try to cd into the dir, I get this:
Code:
[root@rosemary v2]# cd /mnt/dying/var/lib/mysql
-bash: cd: /mnt/dying/var/lib/mysql: Input/output error
I really *really* need this data!
Am I just totally S.O.L. ?
View 1 Replies
View Related
Jul 20, 2007
I host with hostgator and I was wondering if there are any software programs or services, or even something in my cpanel that can automatically grab my MySQL databases and everything on my server and make a backup on my personal PC?
I know I can manually do this, but I would like something that automatically does it once a week or something to insure my clients data is always backed up.
View 2 Replies
View Related
Sep 4, 2007
when mysql has heavy load average what else can be done rather than restarting mysql service.
View 6 Replies
View Related
Jan 8, 2007
There is a problem with mysql and server load. Some how mysql usage is going to over 100, but server load is not increasing, but it is crashing more often.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5931 mysql 16 0 111m 20m 3888 S 71 2.1 10488:45 /usr/sbin/mysqld --basedir=/ --datadir=/var
What could cause the problem? I did mysqladmin pr and only 2 database connections are existing.
View 4 Replies
View Related
May 10, 2008
I have a corrupted VPS, and have some mysql databases on it.
I want to backup databases and restore them on the new server.
Cpanel service is down on the vps and I cannot transfer accts.
Is it possible to do so ?
1- Zip or Tar the username folder in /home dir.
2- zip or tar the database name in /var/lib/mysql folder
Either by SSH or File manager trough HyperVM
Then transfer files some where safe...
When vps is rebuilt, restore the archives and databases to
the folders I have backed up before rebuilt.
There are also some accounts on a terminated vps that there is only an image of the vps available so, I only can tar files using a jailed shell account, move to the new vps and untar them.
how to do it and avoid database problems.
View 0 Replies
View Related
Feb 8, 2008
My site is databases driven and runs on around 15 mySQL databases. Im wanting to download a local copy of these databases daily, however, if i try and back them up via cPanel (on a WHM VPS) they give me blank files. Each databases is around 55mb and growing. I can back them up one by one via phpmyadmin, it just takes around 5 minutes per database. Meaning around 40 minutes per night..
Is there any solution for having a script downloading them automatically so i can download them via ftp? I've tried [url].htm but it gives me blank files.
View 10 Replies
View Related
Apr 1, 2007
how to backup MySQL databases by cron and have the backups sent to you by email, or have them uploaded by FTP. It is based on a script I found at another website though I can confirm it is fully working.
Change the commented variables in the following file and save it as backup.sh:
Code:
#!/bin/sh
# This script will backup one or more mySQL databases
# and then optionally email them and/or FTP them
# This script will create a different backup file for each database by day of the week
# i.e. 1-dbname1.sql.gz for database=dbname1 on Monday (day=1)
# This is a trick so that you never have more than 7 days worth of backups on your FTP server.
# as the weeks rotate, the files from the same day of the prev week are overwritten.
#/bin/sh /home/user/directory/scriptname.sh > /dev/null
############################################################
#===> site-specific variables - customize for your site
# List all of the MySQL databases that you want to backup in here,
# each seperated by a space
# If not run by root, only one db per script instance
databases="mydbname"
# Directory where you want the backup files to be placed
backupdir=/home/mydomain/backups
# MySQL dump command, use the full path name here
mysqldumpcmd=/usr/bin/mysqldump
# MySQL Username and password
userpassword=" --user=myuser --password=mypasswd"
# MySQL dump options
dumpoptions=" --quick --add-drop-table --add-locks --extended-insert --lock-tables"
# Unix Commands
gzip=/bin/gzip
uuencode=/usr/bin/uuencode
mail=/bin/mail
# Send Backup? Would you like the backup emailed to you?
# Set to "y" if you do
sendbackup="n"
subject="mySQL Backup"
mailto="me@mydomain.com"
#===> site-specific variables for FTP
ftpbackup="y"
ftpserver="myftpserver.com"
ftpuser="myftpuser"
ftppasswd="myftppasswd"
# If you are keeping the backups in a subdir to your FTP root
ftpdir="forums"
#===> END site-specific variables - customize for your site
############################################################
# Get the Day of the Week (0-6)
# This allows to save one backup for each day of the week
# Just alter the date command if you want to use a timestamp
DOW=`date +%w`
# Create our backup directory if not already there
mkdir -p ${backupdir}
if [ ! -d ${backupdir} ]
then
echo "Not a directory: ${backupdir}"
exit 1
fi
# Dump all of our databases
echo "Dumping MySQL Databases"
for database in $databases
do
$mysqldumpcmd $userpassword $dumpoptions $database > ${backupdir}/${DOW}-${database}.sql
done
# Compress all of our backup files
echo "Compressing Dump Files"
for database in $databases
do
rm -f ${backupdir}/${DOW}-${database}.sql.gz
$gzip ${backupdir}/${DOW}-${database}.sql
done
# Send the backups via email
if [ $sendbackup = "y" ]
then
for database in $databases
do
$uuencode ${backupdir}/${DOW}-${database}.sql.gz > ${backupdir}/${database}.sql.gz.uu
$mail -s "$subject : $database" $mailto < ${backupdir}/${DOW}-${database}.sql.gz.uu
done
fi
# FTP it to the off-site server
echo "FTP file to $ftpserver FTP server"
if [ $ftpbackup = "y" ]
then
for database in $databases
do
echo "==> ${backupdir}/${DOW}-${database}.sql.gz"
ftp -n $ftpserver <<EOF
user $ftpuser $ftppasswd
bin
prompt
cd $ftpdir
lcd ${backupdir}
put ${DOW}-${database}.sql.gz
quit
EOF
done
fi
# And we're done
ls -l ${backupdir}
echo "Dump Complete!"
exit
Upload backup.sh to your server, to any directory you want. A directory which is not web-accessible will stop your login information being seen by just anyone .
You should chmod the file to 777:
Code:
chmod 777 backup.sh
If you uploaded this file from a Windows machine you will need to convert the file to Unix format. You should run the following command by SSH in the appropriate directory:
Code:
dos2unix backup.sh
If you don't have dos2unix installed, you can install it using yum if you have that:
Code:
yum install dos2unix
If you don't have yum, get it here.
You may want to test the script at this point to make sure it's doing what you want it to. Change to the appropriate directory and run this command:
Code:
./backup.sh
Once you're happy with it, enter it into the crontab to run daily (or whenever you want). Cron jobs vary a lot depending on the configuration of your system, so check Google for how to do it on your system. The command you will need to run by cron is:
Code:
/path/to/file/backup.sh
View 2 Replies
View Related
Dec 18, 2008
MySQL the last few days seems to be constantly the most demanding process in top, which it never was before. As far as I can tell, nothing has substantially changed with regards to traffic to MySQL driven sites on the server. Is there anything that might be wrong with the databases, etc., that might throw MySQL into a tizzy?
View 8 Replies
View Related
Mar 26, 2009
I'm trying to use the "mysqldump" command to get a copy of all databases on the server...
but I need each database to go into a "databaseXYZ.tar.gz" file.
Does anyone know how to do this? So far, I can only get all the databases into a single file. But I need each database to have its own file.
View 4 Replies
View Related
Sep 26, 2007
Just wondering if mysql load balancing is possible in a shared environment.
Example:
I have 3 shared accounts. On one server, I have the write and the 2nd and 3rd server I have the read (select). Or vice versa .. Would it be possible to create a php script to perform this function?
View 2 Replies
View Related
Apr 21, 2008
So the site got featured on [url]and now the server is drowning...
The Coppermine Gallery usually hovers around 30~50 users daily and now, 1800, and im at a lost as how I should configure mysql to take on such a load. right now it takes about 10 secs or more to load a page and sometimes it would time out. Because it si coppermine, all pages are dynamic and can't be cached -_-"
Here's the my.cnf right now after i played around with the numbers
server spec
Opteron 170 (2ghz)
2gb ram
250 7200rpm
[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
#skip-networking
back_log = 75
key_buffer = 256M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1800
thread_cache_size = 384
wait_timeout = 7200
max_connections = 600
connect_timeout = 100
wait_timeout = 12000
tmp_table_size = 100M
max_heap_table_size = 64M
max_allowed_packet = 15M
max_connect_errors = 9999999
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 40M
query_cache_size = 150M
query_cache_type = 1
query_prealloc_size = 65536
tmp_table_size = 64M
query_alloc_block_size = 131072
default-storage-engine = MyISAM
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
nice = -5
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
httpd.conf
Timeout 20
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive Off
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 200
MaxClients 200
MaxRequestsPerChild 1500
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
View 11 Replies
View Related
Apr 21, 2008
What are the best tools to check if our sites load quickly or not?
View 6 Replies
View Related
Jan 29, 2009
Anyone know a good script that I can run with cron or something? Mysql seems to be the #1 problem with a lot of my web sites, a restart usually fixes it right away for me, but I can't keep restarting my servers everyday manually.
View 1 Replies
View Related
Apr 27, 2007
we have mysql 5 setup and this morning at around 10:07 tables started disappearing as they were being accessed by different clients.
Databases that had 40 tables now had 30, etc. Only the tables that were attempted to be accessed were gone. This is the first time something like this has happened.
The following output was given:
This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose the
problem, but since we have already crashed, something is definitely wrong and this may fail.
key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=208
max_connections=500
threads_connected=156
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 1096188 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
thd=0xaf82930
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xb143932c, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x816b1a0
0xaf1898
0x20
0x81ac49d
0x8182914
0x8189010
0x8189df1
0x818a738
0x818ae5c
0xaeb371
0x9c4ffe
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read [url]and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xaf36620 = SELECT * FROM `sessions` WHERE `PHPSESSID` = '5e6775cd3c6f187d8c575127ba73be19'
thd->thread_id=113407
The manual page at [url]contains
information that should help you find out what is causing the crash.
mysqld: my_new.cc:51: int __cxa_pure_virtual(): Assertion `"Pure virtual method called." == "Aborted"' failed.
Number of processes running now: 0
070427 10:07:49 mysqld restarted
070427 10:07:50 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
070427 10:07:53 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 227822203.
InnoDB: Doing recovery: scanned up to log sequence number 0 227822203
070427 10:07:53 InnoDB: Started; log sequence number 0 227822203
070427 10:07:54 [Note] /usr/sbin/mysqld: ready for connections.
View 0 Replies
View Related
Oct 24, 2008
I am looking for a Windows VPS, preferably inexpensive, but the primary goal is to have a fast pipe to it and be capable of running the WAPT windows load testing tool [url]
I currently have a Zone VPS, and have looked using http_load, or siege from it, but they don't appear to be anywhere near as full featured ad WAPT.
I need to run the tests against both a corportate website to see what our current capacity is, and want to make sure I am not bandwidth limited, as would be the case if I was testing via a T1 or DSL connection, hence the reason for wanting a Windows VPS on a thick pipe that I can run the tests on.
View 2 Replies
View Related
Oct 31, 2009
I have a server that is running linux with cpanel and I am running out of space on a partition.
I was getting this error:
Drive Warning: /dev/sda3 (/var) is 83% full
I looked in the folder and went to /var/lib/mysql and noticed that I have about 6 databases that are a little over 1 GB each. The sda3 partition only has a capacity for 9.9 GB and I was suggested to configure mysql to hold my databases on another partition that has more space..
View 3 Replies
View Related