我有一组 100 个日志文件,使用 gzip 压缩。我需要找到与给定表达式匹配的所有行。我会使用 grep,但当然,这有点像噩梦,因为我必须一个一个地解压缩所有文件,grep 它们并删除解压缩的版本,因为如果它们不适合我的服务器都被解压了。
任何人都有如何快速完成这项工作的小技巧?
我有一组 100 个日志文件,使用 gzip 压缩。我需要找到与给定表达式匹配的所有行。我会使用 grep,但当然,这有点像噩梦,因为我必须一个一个地解压缩所有文件,grep 它们并删除解压缩的版本,因为如果它们不适合我的服务器都被解压了。
任何人都有如何快速完成这项工作的小技巧?
我们使用具有 512MB 实例的 Slicehost。我们在它们上面运行 Ubuntu 9.10。我安装了一些软件包,现在我正在尝试优化 RAM 消耗,然后再在那里运行任何东西。
一个简单ps
的给我正在运行的进程列表:
# ps faux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2 0.0 0.0 0 0 ? S< Jan04 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S< Jan04 0:15 \_ [migration/0]
root 4 0.0 0.0 0 0 ? S< Jan04 0:01 \_ [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [watchdog/0]
root 6 0.0 0.0 0 0 ? S< Jan04 0:04 \_ [events/0]
root 7 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [cpuset]
root 8 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [khelper]
root 9 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [async/mgr]
root 10 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xenwatch]
root 11 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xenbus]
root 13 0.0 0.0 0 0 ? S< Jan04 0:02 \_ [migration/1]
root 14 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [ksoftirqd/1]
root 15 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [watchdog/1]
root 16 0.0 0.0 0 0 ? S< Jan04 0:07 \_ [events/1]
root 17 0.0 0.0 0 0 ? S< Jan04 0:02 \_ [migration/2]
root 18 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [ksoftirqd/2]
root 19 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [watchdog/2]
root 20 0.0 0.0 0 0 ? R< Jan04 0:07 \_ [events/2]
root 21 0.0 0.0 0 0 ? S< Jan04 0:04 \_ [migration/3]
root 22 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [ksoftirqd/3]
root 23 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [watchdog/3]
root 24 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [events/3]
root 25 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kintegrityd/0]
root 26 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kintegrityd/1]
root 27 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kintegrityd/2]
root 28 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kintegrityd/3]
root 29 0.0 0.0 0 0 ? S< Jan04 0:01 \_ [kblockd/0]
root 30 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kblockd/1]
root 31 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kblockd/2]
root 32 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kblockd/3]
root 33 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kseriod]
root 34 0.0 0.0 0 0 ? S Jan04 0:00 \_ [khungtaskd]
root 35 0.0 0.0 0 0 ? S Jan04 0:05 \_ [pdflush]
root 36 0.0 0.0 0 0 ? S Jan04 0:06 \_ [pdflush]
root 37 0.0 0.0 0 0 ? S< Jan04 1:02 \_ [kswapd0]
root 38 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [aio/0]
root 39 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [aio/1]
root 40 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [aio/2]
root 41 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [aio/3]
root 42 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [jfsIO]
root 43 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [jfsCommit]
root 44 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [jfsCommit]
root 45 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [jfsCommit]
root 46 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [jfsCommit]
root 47 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [jfsSync]
root 48 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfs_mru_cache]
root 49 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfslogd/0]
root 50 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfslogd/1]
root 51 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfslogd/2]
root 52 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfslogd/3]
root 53 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsdatad/0]
root 54 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsdatad/1]
root 55 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsdatad/2]
root 56 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsdatad/3]
root 57 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsconvertd/0]
root 58 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsconvertd/1]
root 59 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsconvertd/2]
root 60 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [xfsconvertd/3]
root 61 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [glock_workqueue]
root 62 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [glock_workqueue]
root 63 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [glock_workqueue]
root 64 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [glock_workqueue]
root 65 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [delete_workqueu]
root 66 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [delete_workqueu]
root 67 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [delete_workqueu]
root 68 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [delete_workqueu]
root 69 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kslowd]
root 70 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kslowd]
root 71 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [crypto/0]
root 72 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [crypto/1]
root 73 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [crypto/2]
root 74 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [crypto/3]
root 77 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [net_accel/0]
root 78 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [net_accel/1]
root 79 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [net_accel/2]
root 80 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [net_accel/3]
root 81 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [sfc_netfront/0]
root 82 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [sfc_netfront/1]
root 83 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [sfc_netfront/2]
root 84 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [sfc_netfront/3]
root 310 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [kstriped]
root 315 0.0 0.0 0 0 ? S< Jan04 0:00 \_ [ksnapd]
root 1452 0.0 0.0 0 0 ? S< Jan04 4:31 \_ [kjournald]
root 1 0.0 0.1 19292 948 ? Ss Jan04 0:15 /sbin/init
root 1545 0.0 0.1 13164 1064 ? S Jan04 0:00 upstart-udev-bridge --daemon
root 1547 0.0 0.1 17196 996 ? S<s Jan04 0:00 udevd --daemon
root 1728 0.0 0.2 20284 1468 ? S< Jan04 0:00 \_ udevd --daemon
root 1729 0.0 0.1 17192 792 ? S< Jan04 0:00 \_ udevd --daemon
root 1881 0.0 0.0 8192 152 ? Ss Jan04 0:00 dd bs=1 if=/proc/kmsg of=/var/run/rsyslog/kmsg
syslog 1884 0.0 0.2 185252 1200 ? Sl Jan04 1:00 rsyslogd -c4
103 1894 0.0 0.1 23328 700 ? Ss Jan04 1:08 dbus-daemon --system --fork
root 2046 0.0 0.0 136 32 ? Ss Jan04 4:05 runsvdir -P /etc/service log: gems/custom_require.rb:31:in `require'??from /mnt/app/superfeedr-firehoser/current/script/component:52?/opt/ruby-enterprise/lib/ruby/si
root 2055 0.0 0.0 112 32 ? Ss Jan04 0:00 \_ runsv chef-client
root 2060 0.0 0.0 132 40 ? S Jan04 0:02 | \_ svlogd -tt ./main
root 2056 0.0 0.0 112 28 ? Ss Jan04 0:20 \_ runsv superfeedr-firehoser_2
root 2059 0.0 0.0 132 40 ? S Jan04 0:29 | \_ svlogd /var/log/superfeedr-firehoser_2
root 2057 0.0 0.0 112 28 ? Ss Jan04 0:20 \_ runsv superfeedr-firehoser_1
root 2062 0.0 0.0 132 44 ? S Jan04 0:26 \_ svlogd /var/log/superfeedr-firehoser_1
root 2058 0.0 0.0 18708 316 ? Ss Jan04 0:01 cron
root 2095 0.0 0.1 49072 764 ? Ss Jan04 0:06 /usr/sbin/sshd
root 9832 0.0 0.5 78916 3500 ? Ss 00:37 0:00 \_ sshd: root@pts/0
root 9846 0.0 0.3 17900 2036 pts/0 Ss 00:37 0:00 \_ -bash
root 10132 0.0 0.1 15020 1064 pts/0 R+ 09:51 0:00 \_ ps faux
root 2180 0.0 0.0 5988 140 tty1 Ss+ Jan04 0:00 /sbin/getty -8 38400 tty1
root 27610 0.0 1.4 47060 8436 ? S Apr04 2:21 python /usr/sbin/denyhosts --daemon --purge --config=/etc/denyhosts.conf --config=/etc/denyhosts.conf
root 22640 0.0 0.7 119244 4164 ? Ssl Apr05 0:05 /usr/sbin/console-kit-daemon
root 10113 0.0 0.0 3904 316 ? Ss 09:46 0:00 /usr/sbin/collectdmon -P /var/run/collectdmon.pid -- -C /etc/collectd/collectd.conf
root 10114 0.0 0.2 201084 1464 ? Sl 09:46 0:00 \_ collectd -C /etc/collectd/collectd.conf -f
如您所见,这里没有什么严重的。如果我总结所有这一切的 RSS 行,我会得到以下信息:
# ps -aeo rss | awk '{sum+=$1} END {print sum}'
30096
这是有道理的。
然而,当我做一个免费的时候,我有一个很大的惊喜:
# free
total used free shared buffers cached
Mem: 591180 343684 247496 0 25432 161256
-/+ buffers/cache: 156996 434184
Swap: 1048568 0 1048568
如您所见,60% 的可用内存已经被消耗……如果我想避免交换,我只有 40% 可以运行我自己的应用程序。相当令人失望!
出现2个问题:
这是我们的 MySQL 设置:
“复制环”中的 3 个 MySQL 服务器:它们都是主服务器,S1 是 S2 的从属服务器,S3 是 S3 的从属服务器,S3 是 S4 的从属服务器。
到目前为止,我们会为机器做快照,但这不是我们可以/不想做的事情。我们正在尝试将数据库的完整备份备份到 S3。
我的想法是我们需要mysqldump
每隔几个小时制作一次,然后将其上传到 S3。问题在于,当您拥有超过几百 MB 的数据(我们是 8GB)时,转储非常昂贵。
保存二进制日志是一种选择,但恢复可能需要几天时间,因为我们需要应用所有二进制日志:/
对我们来说有什么很棒的解决方案吗?
MySQL 不是我的菜,但我需要微调我们的一台服务器。
以下是要求/规格:
按照现在的配置,我们的 MySQL 服务器慢慢开始消耗所有可用内存(我们使用 collectd,这是一个图表)。在某个时候(几天/几周后),它停止执行查询(今晚停止了 2 个小时,我不得不重新启动 MySQL 服务器:参见第二张图片):
(抱歉,新用户无法发布图片,并且只有 1 个超链接:/)
每周:http: //i27.tinypic.com/6ticyv.jpg
今天:i31.tinypic.com/ir53yg.png
这是我们当前的 my.cnf
#
# The MySQL database server configuration file.
#
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# yann changed this on a friday balbla
#bind-address = 127.0.0.1
bind-address = 0.0.0.0
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 2000
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 3
log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
# Fine tunig added by JG on 06/03 based on http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/
innodb_buffer_pool_size = 1G
#innodb_log_file_size = 256M
innodb_log_buffer_size = 4M
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_file_per_table
transaction-isolation = READ-COMMITTED
innodb_table_locks = 0
#
# * Federated
#
# The FEDERATED storage engine is disabled since 5.0.67 by default in the .cnf files
# shipped with MySQL distributions (my-huge.cnf, my-medium.cnf, and so forth).
#
skip-federated
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
这是慢查询的转储:
$ mysqldumpslow /var/log/mysql/mysql-slow.log
Reading mysql slow query log from /var/log/mysql/mysql-slow.log
Count: 5 Time=3689348814741910528.00s (-1s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
SET insert_id=N;
INSERT IGNORE INTO `feeds` (`url`) VALUES ('S')
Count: 41 Time=1349761761490942720.00s (-1s) Lock=0.12s (5s) Rows=253.0 (10373), superfeeder[superfeeder]@localhost
SHOW GLOBAL STATUS
Count: 25 Time=737869762948382080.00s (-1s) Lock=0.00s (0s) Rows=18.1 (452), superfeeder[superfeeder]@[172.21.1.158]
SELECT `feeds`.* FROM `feeds` WHERE (`fetch_session_id` = 'S')
Count: 12952 Time=1424239042133230.25s (-1s) Lock=0.00s (1s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
SET insert_id=N;
INSERT IGNORE INTO `entries` (`chunks`, `time`, `feed_id`, `unique_id`, `link`, `chunk`) VALUES ('S', 'S', N, 'S', 'S', 'S')
Count: 29 Time=656.55s (19040s) Lock=5.28s (153s) Rows=0.8 (23), superfeeder[superfeeder]@[172.21.1.175]
select salt,crypted_password from users where login='S'
Count: 39 Time=505.23s (19704s) Lock=2.41s (94s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
DELETE FROM `feeds` WHERE (url LIKE 'S')
Count: 2275 Time=502.50s (1143184s) Lock=3.48s (7922s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `next_fetch` = 'S', `fetch_session_id` = 'S' WHERE (`next_fetch` < 'S') LIMIT N
Count: 1 Time=443.00s (443s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `next_fetch` = 'S' WHERE (`feeds`.`url` IN (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL))
Count: 14 Time=289.43s (4052s) Lock=0.71s (10s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `next_fetch` = 'S' WHERE (`feeds`.`url` IN ('S','S'))
Count: 2 Time=256.00s (512s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `next_fetch` = 'S' WHERE (`feeds`.`url` IN (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL))
Count: 1 Time=237.00s (237s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `next_fetch` = 'S' WHERE (`feeds`.`url` IN ('S'))
Count: 24 Time=191.58s (4598s) Lock=1.12s (27s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `next_fetch` = 'S' WHERE (`feeds`.`id` = 'S')
Count: 5 Time=144.20s (721s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `next_fetch` = 'S' WHERE (`feeds`.`url` IN (NULL,NULL,NULL))
Count: 1 Time=101.00s (101s) Lock=1.00s (1s) Rows=1.0 (1), superfeeder[superfeeder]@[172.21.1.158]
SELECT * FROM `users` WHERE (`login` = 'S') LIMIT N
Count: 79 Time=35.51s (2805s) Lock=2.52s (199s) Rows=0.2 (12), superfeeder[superfeeder]@[172.21.1.184]
SELECT `feeds`.id FROM `feeds` WHERE (`feeds`.`url` = BINARY 'S' AND `feeds`.id <> N) LIMIT N
Count: 1 Time=28.00s (28s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
UPDATE `feeds` SET `last_maintenance_at` = 'S', `updated_at` = 'S' WHERE `id` = N
Count: 51 Time=23.51s (1199s) Lock=0.12s (6s) Rows=19.2 (981), superfeeder[superfeeder]@2hosts
SELECT version FROM schema_migrations
Count: 5 Time=20.60s (103s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
BEGIN
Count: 65 Time=15.86s (1031s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = 'S', `last_sup_update_id` = NULL, `updated_at` = 'S', `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = 'S', `active` = 'S', `last_fetch` = 'S', `created_at` = 'S', `max_period` = 'S' WHERE (`id` = N)
Count: 23 Time=11.52s (265s) Lock=0.00s (0s) Rows=231.0 (5313), superfeeder[superfeeder]@2hosts
#
Count: 132 Time=10.53s (1390s) Lock=0.02s (2s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = 'S', `last_sup_update_id` = NULL, `updated_at` = 'S', `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = 'S', `active` = 'S', `last_fetch` = 'S', `created_at` = NULL, `max_period` = 'S' WHERE (`id` = N)
Count: 62 Time=9.81s (608s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.184]
ROLLBACK
Count: 151 Time=8.94s (1350s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@2hosts
DELETE FROM `entries` WHERE (`time` < 'S')
Count: 25 Time=8.76s (219s) Lock=0.00s (0s) Rows=1.0 (24), superfeeder[superfeeder]@[172.21.1.158]
SELECT * FROM `feeds` WHERE (`url` = 'S') LIMIT N
Count: 2 Time=8.50s (17s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
set SQL_AUTO_IS_NULL=N
Count: 8802 Time=8.44s (74319s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
INSERT IGNORE INTO `entries` (`chunks`, `time`, `feed_id`, `unique_id`, `link`, `chunk`) VALUES ('S', 'S', N, 'S', 'S', 'S')
Count: 1 Time=8.00s (8s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
INSERT IGNORE INTO `subscriptions` (`user_id`, `feed_id`) VALUES (N, N)
Count: 38 Time=7.92s (301s) Lock=0.00s (0s) Rows=1.0 (38), superfeeder[superfeeder]@[172.21.1.184]
SELECT count(DISTINCT `users`.id) AS count_users_id FROM `users` INNER JOIN `subscriptions` ON `users`.id = `subscriptions`.user_id WHERE ((`subscriptions`.feed_id = N))
Count: 9 Time=7.67s (69s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
INSERT IGNORE INTO `feeds` (`url`) VALUES ('S')
Count: 244 Time=7.20s (1756s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = N, `last_sup_update_id` = NULL, `updated_at` = 'S', `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = N, `active` = 'S', `last_fetch` = 'S', `created_at` = 'S', `max_period` = 'S' WHERE (`id` = N)
Count: 336 Time=6.85s (2301s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = N, `last_sup_update_id` = NULL, `updated_at` = 'S', `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = N, `active` = 'S', `last_fetch` = 'S', `created_at` = NULL, `max_period` = 'S' WHERE (`id` = N)
Count: 16 Time=6.38s (102s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = N, `last_sup_update_id` = NULL, `updated_at` = NULL, `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = N, `active` = 'S', `last_fetch` = 'S', `created_at` = NULL, `max_period` = 'S' WHERE (`id` = N)
Count: 122 Time=5.91s (721s) Lock=0.00s (0s) Rows=1.0 (119), superfeeder[superfeeder]@[172.21.1.158]
SELECT DISTINCT `users`.* FROM `users` INNER JOIN `subscriptions` ON (`subscriptions`.`user_id` = `users`.`id`) WHERE (`subscriptions`.`feed_id` = N)
Count: 299 Time=5.78s (1727s) Lock=0.00s (0s) Rows=1.0 (299), superfeeder[superfeeder]@[172.21.1.158]
SELECT * FROM `feeds` WHERE (`id` = 'S')
Count: 21 Time=5.48s (115s) Lock=0.00s (0s) Rows=1.0 (21), superfeeder[superfeeder]@[172.21.1.158]
SELECT * FROM `subscriptions` WHERE ((`user_id` = N) AND (`feed_id` = N)) LIMIT N
Count: 27 Time=5.37s (145s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = 'S', `last_sup_update_id` = NULL, `updated_at` = NULL, `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = 'S', `active` = 'S', `last_fetch` = 'S', `created_at` = NULL, `max_period` = 'S' WHERE (`id` = N)
Count: 9 Time=4.33s (39s) Lock=0.00s (0s) Rows=0.0 (0), superfeeder[superfeeder]@[172.21.1.158]
UPDATE `feeds` SET `last_error_message` = 'S', `period` = 'S', `last_sup_update_id` = NULL, `updated_at` = NULL, `modified` = 'S', `fetch_session_id` = 'S', `streamed` = 'S', `last_parse` = 'S', `etag` = 'S', `last_entry_time` = 'S', `min_period` = 'S', `url` = 'S', `id` = 'S', `feed_type` = NULL, `sup_id` = NULL, `sup_url_id` = NULL, `next_fetch` = 'S', `hashed_content` = 'S', `last_maintenance_at` = 'S', `last_ping` = NULL, `last_http_code` = NULL, `active` = 'S', `last_fetch` = 'S', `created_at` = NULL, `max_period` = 'S' WHERE (`id` = N)
Count: 1 Time=4.00s (4s) Lock=0.00s (0s) Rows=1.0 (1), superfeeder[superfeeder]@[172.21.1.175]
select id from users where login='S'
Count: 1 Time=3.00s (3s) Lock=0.00s (0s) Rows=22.0 (22), debian-sys-maint[debian-sys-maint]@localhost
select concat("S",
TABLE_SCHEMA, "S", TABLE_NAME, "S")
from information_schema.TABLES where ENGINE="S"
Count: 1056 Time=0.11s (111s) Lock=0.00s (0s) Rows=126.9 (133998), superfeeder[superfeeder]@[172.21.1.184]
SELECT * FROM `feeds` WHERE (last_maintenance_at < 'S')
Count: 1049 Time=0.00s (1s) Lock=0.00s (0s) Rows=3.1 (3303), superfeeder[superfeeder]@[172.21.1.184]
SELECT * FROM `users` WHERE (one_week_anniversary_sent = N AND activated_at < 'S')
Count: 21 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), 0users@0hosts
administrator command: Ping
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), debian-sys-maint[debian-sys-maint]@localhost
select count(*) into @discard from `information_schema`.`COLUMNS`
Count: 8 Time=0.00s (0s) Lock=0.00s (0s) Rows=30.0 (240), superfeeder[superfeeder]@[172.21.1.184]
SELECT DISTINCT `feeds`.* FROM `feeds` INNER JOIN `subscriptions` ON `feeds`.id = `subscriptions`.feed_id WHERE ((`subscriptions`.user_id = N)) AND ((`subscriptions`.user_id = N)) LIMIT N, N
Count: 31 Time=0.00s (0s) Lock=0.00s (0s) Rows=1.0 (31), superfeeder[superfeeder]@2hosts
SELECT count(*) AS count_all FROM `feeds`
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), debian-sys-maint[debian-sys-maint]@localhost
select count(*) into @discard from `information_schema`.`TRIGGERS`
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), debian-sys-maint[debian-sys-maint]@localhost
select count(*) into @discard from `information_schema`.`VIEWS`
Count: 52 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.7 (34), superfeeder[superfeeder]@[172.21.1.184]
SELECT * FROM `users` WHERE (`users`.`remember_token` = 'S') LIMIT N
Count: 120 Time=0.00s (0s) Lock=0.00s (0s) Rows=1.0 (120), superfeeder[superfeeder]@2hosts
SELECT * FROM `feeds` ORDER BY feeds.id DESC LIMIT N
Count: 19 Time=0.00s (0s) Lock=0.00s (0s) Rows=15.7 (299), superfeeder[superfeeder]@2hosts
SELECT count(*) AS count_all, last_http_code AS last_http_code FROM `feeds` GROUP BY last_http_code
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), debian-sys-maint[debian-sys-maint]@localhost
select count(*) into @discard from `information_schema`.`ROUTINES`
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=1.0 (1), debian-sys-maint[debian-sys-maint]@localhost
SELECT count(*) FROM mysql.user WHERE user='S' and password='S'
提要的表定义:
+---------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| url | varchar(255) | YES | UNI | NULL | |
| last_parse | datetime | YES | | 2009-08-10 14:51:46 | |
| etag | varchar(255) | YES | | etag | |
| modified | datetime | YES | | 2009-08-10 14:51:46 | |
| active | tinyint(1) | YES | MUL | 1 | |
| last_fetch | datetime | YES | | 2009-08-10 14:51:46 | |
| next_fetch | datetime | YES | MUL | 2009-08-10 14:51:46 | |
| fetch_session_id | varchar(255) | YES | MUL | | |
| period | int(11) | YES | | 240 | |
| hashed_content | varchar(255) | YES | | | |
| streamed | tinyint(1) | YES | | 0 | |
| sup_id | varchar(255) | YES | MUL | NULL | |
| last_sup_update_id | varchar(255) | YES | | NULL | |
| last_entry_time | datetime | YES | | 2009-08-10 14:51:46 | |
| last_ping | datetime | YES | | NULL | |
| last_http_code | int(11) | YES | | NULL | |
| last_error_message | varchar(255) | YES | | | |
| sup_url_id | int(11) | YES | MUL | NULL | |
| created_at | datetime | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
| last_maintenance_at | datetime | YES | | 2008-08-10 21:51:50 | |
| min_period | int(11) | YES | | 60 | |
| max_period | int(11) | YES | | 900 | |
+---------------------+--------------+------+-----+---------------------+----------------+
+-------+------------+--------------------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------+------------+--------------------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+
| feeds | 0 | PRIMARY | 1 | id | A | 166 | NULL | NULL | | BTREE | |
| feeds | 0 | index_feeds_on_url | 1 | url | A | 166 | NULL | NULL | YES | BTREE | |
| feeds | 1 | index_feeds_on_next_fetch_and_active | 1 | next_fetch | A | 1 | NULL | NULL | YES | BTREE | |
| feeds | 1 | index_feeds_on_next_fetch_and_active | 2 | active | A | 1 | NULL | NULL | YES | BTREE | |
| feeds | 1 | index_feeds_on_sup_id | 1 | sup_id | A | 1 | NULL | NULL | YES | BTREE | |
| feeds | 1 | index_feeds_on_sup_url_id | 1 | sup_url_id | A | 1 | NULL | NULL | YES | BTREE | |
| feeds | 1 | index_feeds_on_fetch_session_id | 1 | fetch_session_id | A | 1 | NULL | NULL | YES | BTREE | |
+-------+------------+--------------------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+