mysql
mysqldump 不鎖 table 備份 command , nolock , no lock
mysqldump -u -p -h host --lock-tables=false stat tbl_test | gzip -cf > 1.gz
amazon aws ami LAMP / NGINX / PHP / memcache steps
// —–
Using NGINX + PHP5-FPM sudo apt-get install nginx php5-fpm php5-mysql cd /etc/init.d/ sudo service apache2 stop sudo update-rc.d -f apache2 remove http://yoodey.com/how-install-configure-nginx-php-fpm-memcached-work-drupal-7-ubuntu-1010-maverick Install Memcached sudo apt-get install memcached libmemcached-dev php5-memcached php5-memcache
// ====================
Getting a new virtual machine up and running from the default AMI is easy. Here’s my cookbook: Install basic services yum install mysql mysql-server mysql-devel yum install httpd httpd-devel yum install php php-devel php-mysql php-gd php-dom php-pear php-json yum install svn Configure those services to start at boot chkconfig –level 345 httpd on chkconfig –level 345 mysqld on chkconfig –list Install APC I couldn’t find a package, and this bug report explains why we have to use the beta. yum install gcc pcre-devel pecl install apc-beta echo extension=apc.so > /etc/php.d/apc.ini Install memcached yum install libevent libevent-devel curl -O http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz cd memcached-1.4.5 ./configure make ; make install /usr/local/bin/memcached -u nobody -d -m 30 -l 127.0.0.1 -p 11211 // ---- <pre> [root@ip-10-130-9-23 log]# cat /etc/fstab # LABEL=/ / ext4 defaults,noatime 1 1 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 [root@ip-10-130-9-23 log]# cat /etc/mtab /dev/xvda1 / ext4 rw,noatime 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 devpts /dev/pts devpts rw,gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs rw 0 0 none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 </pre>
建 mysql partition table 遇到的問題
1. Out of resources when opening file
在 my.cnf 加 open-files-limit = 6000
2. Too many partitions were defined
Ref. URL : https://www.monster.com.tw/archives/2504
[memo] MySQL PROCEDURE ANALYSE / schema 分析 / performance running
SELECT * FROM SYS_USER PROCEDURE ANALYSE() \G;
URL : http://dev.mysql.com/doc/refman/5.0/en/procedure-analyse.html