Thứ Ba, 10 tháng 9, 2013

How to log MySQL slow queries

Since I upgraded mywebsite to VPS, I can analyse the slow queries by loggin them into a file without restarting mysql as follows:

# touch /var/log/slow
# chown mysql:mysql /var/log/slowqueries
# mysql -e 'SET GLOBAL slow_query_log=1;'
# mysql -e 'SET GLOBAL slow_query_log_file="/var/log/slowqueries";'
# mysql -e 'SET GLOBAL long_query_time=5;'

Or I can add these lines to my.cnf:
slow_query_log=1
slow_query_log_file=/var/log/slowqueries
long_query_time=2

To test if it is working correctly, try:
# mysql -e 'SELECT SLEEP(6);'

Chủ Nhật, 1 tháng 9, 2013

Romajidesu is back!

After three days upgrading, RomajiDesu Japanese dictionary is back on a new powerful VPS server. After one year, Romajidesu steady gain the trust from Japanese leaner community and the traffic reach approximately 3000 visits per days, or nearly 20000 page views per day. Another great upgrade of RomajiDesu before that is the website framework. The underline framework is also upgraded to a more powerful and extensible one, which cannot be seen from the surface.