- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们正在运行两台服务器。两者都运行 Server 2008(1 = Web,1 = 标准)。
在两台服务器上,我们在 IIS 环境中运行 OSticket,并配置了 php。 (两个不同的 osTicket 实现和数据库)
在一台服务器上,一切正常,有数千张票证。在另一台服务器上,查询最多需要 90 秒...大多数是 30-40 秒...这些看起来非常简单的查询...这个数据库中有大约 16K 个票证...其中一些具有相当大的大小附件...
两台服务器都运行相同版本的 OSticket。
The issue reminds me of a mySQL code implementation that I once did, which also suffered these type of delays with basic queries... I had to make some simple query changes, and it sped up by a factor. This issue smells very similar.
我在 mySQL 中尝试了以下操作
服务器真的很空闲。它有 16GB RAM,8 个核心。它也运行其他服务,IIS、MSSQL 等,但如上所述,它处于空闲状态。我看不出这是服务器配置/资源问题。
MySQL 消耗大约 1GB 的 RAM,有时大约 5-15% 的 cpu...(CPU 对我来说似乎很高...)
慢速查询的示例是:
SET timestamp=1411987784;
SELECT thread.*, info.email_mid, info.headers ,count(DISTINCT attach.attach_id) as attachments FROM ost_ticket_thread thread LEFT JOIN ost_ticket_email_info info
ON (thread.id=info.thread_id) LEFT JOIN ost_ticket_attachment attach
ON (thread.ticket_id=attach.ticket_id
AND thread.id=attach.ref_id) WHERE thread.id=108610 AND thread.thread_type='N' GROUP BY thread.id;
# Time: 140929 12:49:44
# User@Host: osticket[osticket] @ PLM-S01 [192.168.10.11] Id: 154
# Query_time: 28.177612 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 108472
InnoDB状态查询返回:
'
=====================================
2014-09-29 14:25:16 25b0 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 57 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 1972 srv_active, 0 srv_shutdown, 5354 srv_idle
srv_master_thread log flush and writes: 7325
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 1366361
OS WAIT ARRAY INFO: signal count 1108283
Mutex spin waits 2150949, rounds 3167588, OS waits 18721
RW-shared spins 1435812, rounds 40962905, OS waits 1344494
RW-excl spins 2597, rounds 57911, OS waits 1364
Spin rounds per wait: 1.47 mutex, 28.53 RW-shared, 22.30 RW-excl
------------
TRANSACTIONS
------------
Trx id counter 6366171
Purge done for trx''s n:o < 6366156 undo n:o < 0 state: running but idle
History list length 325
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 14, OS thread handle 0x25b0, query id 61326 localhost 127.0.0.1 osticket init
SHOW ENGINE INNODB STATUS
---TRANSACTION 0, not started
MySQL thread id 13, OS thread handle 0xa94, query id 57911 localhost 127.0.0.1 osticket cleaning up
---TRANSACTION 0, not started
MySQL thread id 6, OS thread handle 0x1cd4, query id 404 PLM-S01 192.168.10.11 osticket cleaning up
---TRANSACTION 6366167, ACTIVE 49 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 360, 1 row lock(s)
MySQL thread id 318, OS thread handle 0x20b8, query id 60114 PLM-S01 192.168.10.11 osticket updating
UPDATE ost_ticket SET isoverdue=1, updated=NOW() WHERE ticket_id=21086
Trx read view will not see trx with id >= 6366168, sees < 6366153
------- TRX HAS BEEN WAITING 48 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 136 page no 142 n bits 216 index `PRIMARY` of table `plm_osticket`.`ost_ticket` trx id 6366167 lock_mode X locks rec but not gap waiting
Record lock, heap no 30 PHYSICAL RECORD: n_fields 24; compact format; info bits 0
0: len 4; hex 0000525e; asc R^;;
1: len 6; hex 0000006123c9; asc a# ;;
2: len 7; hex 6f000002e201ca; asc o ;;
3: len 6; hex 373939353332; asc 799532;;
4: len 4; hex 000003a0; asc ;;
5: len 4; hex 00000000; asc ;;
6: len 4; hex 00000001; asc ;;
7: len 4; hex 00000002; asc ;;
8: len 4; hex 00000002; asc ;;
9: len 4; hex 00000000; asc ;;
10: len 4; hex 0000000a; asc ;;
11: len 4; hex 00000000; asc ;;
12: len 4; hex 00000005; asc ;;
13: len 13; hex 3139322e3136382e31302e3836; asc 192.168.10.86;;
14: len 1; hex 02; asc ;;
15: len 1; hex 01; asc ;;
16: len 1; hex 00; asc ;;
17: SQL NULL;
18: len 5; hex 9993f541b1; asc A ;;
19: SQL NULL;
20: len 5; hex 9993f541b1; asc A ;;
21: len 5; hex 9993ecb9a6; asc ;;
22: len 5; hex 9993eca222; asc ";;
23: len 5; hex 9993fae4da; asc ;;
------------------
---TRANSACTION 6366153, ACTIVE 351 sec fetching rows, thread declared inside InnoDB 1070
mysql tables in use 2, locked 0
33 lock struct(s), heap size 6544, 33 row lock(s), undo log entries 208
MySQL thread id 314, OS thread handle 0x1864, query id 61324 PLM-S01 192.168.10.11 osticket Sending data
SELECT thread.*, info.email_mid, info.headers ,count(DISTINCT attach.attach_id) as attachments FROM ost_ticket_thread thread LEFT JOIN ost_ticket_email_info info
ON (thread.id=info.thread_id) LEFT JOIN ost_ticket_attachment attach
ON (thread.ticket_id=attach.ticket_id
AND thread.id=attach.ref_id) WHERE thread.id=109028 AND thread.thread_type=''M'' GROUP BY thread.id
Trx read view will not see trx with id >= 6366154, sees < 6366114
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (read thread)
I/O thread 4 state: wait Windows aio (read thread)
I/O thread 5 state: wait Windows aio (read thread)
I/O thread 6 state: wait Windows aio (write thread)
I/O thread 7 state: wait Windows aio (write thread)
I/O thread 8 state: wait Windows aio (write thread)
I/O thread 9 state: wait Windows aio (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o''s: 0, sync i/o''s: 2
Pending flushes (fsync) log: 0; buffer pool: 0
7329448 OS file reads, 28218 OS file writes, 9771 OS fsyncs
1264.75 reads/s, 16384 avg bytes/read, 4.51 writes/s, 1.70 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 17, seg size 19, 3190 merges
merged operations:
insert 3265, delete mark 252, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 722273, node heap has 1 buffer(s)
566.90 hash searches/s, 68.35 non-hash searches/s
---
LOG
---
Log sequence number 5444405216
Log flushed up to 5444396184
Pages flushed up to 5444396184
Last checkpoint at 5444396184
1 pending log writes, 0 pending chkp writes
3744 log i/o''s done, 0.67 log i/o''s/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 373637120; in additional pool allocated 0
Dictionary memory allocated 399883
Buffer pool size 22272
Free buffers 1010
Database pages 21261
Old database pages 7828
Modified db pages 12
Pending reads 1
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 16540365, not young 61439991
2726.25 youngs/s, 8876.23 non-youngs/s
Pages read 7329387, created 989, written 23206
1264.80 reads/s, 0.21 creates/s, 3.63 writes/s
Buffer pool hit rate 950 / 1000, young-making rate 107 / 1000 not 351 / 1000
Pages read ahead 61.74/s, evicted without access 7.81/s, Random read ahead 0.00/s
LRU len: 21261, unzip_LRU len: 0
I/O sum[59357]:cur[18], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
1 queries inside InnoDB, 0 queries in queue
2 read views open inside InnoDB
Main thread id 8924, state: flushing log
Number of rows inserted 3212, updated 1123, deleted 8, read 132865050
1.58 inserts/s, 0.25 updates/s, 0.00 deletes/s, 19276.61 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
'
我会很感激一些关于我可以从哪里开始摆弄的想法......
最佳答案
最终创建了一个全新的数据库并从头开始。
关于php - OsTicket + IIS + mySQL + 极慢的查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26099812/
我有三张 table 。表 A 有选项名称(即颜色、尺寸)。表 B 有选项值名称(即蓝色、红色、黑色等)。表C通过将选项名称id和选项名称值id放在一起来建立关系。 我的查询需要显示值和选项的名称,而
在mysql中,如何计算一行中的非空单元格?我只想计算某些列之间的单元格,比如第 3-10 列之间的单元格。不是所有的列...同样,仅在该行中。 最佳答案 如果你想这样做,只能在 sql 中使用名称而
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 7 年前。 Improve this ques
我正在为版本7.6进行Elasticsearch查询 我的查询是这样的: { "query": { "bool": { "should": [ {
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 7 年前。 Improve this ques
是否可以编写一个查询来检查任一子查询(而不是一个子查询)是否正确? SELECT * FROM employees e WHERE NOT EXISTS (
我找到了很多关于我的问题的答案,但问题没有解决 我有表格,有数据,例如: Data 1 Data 2 Data 3
以下查询返回错误: 查询: SELECT Id, FirstName, LastName, OwnerId, PersonEmail FROM Account WHERE lower(PersonEm
以下查询返回错误: 查询: SELECT Id, FirstName, LastName, OwnerId, PersonEmail FROM Account WHERE lower(PersonEm
我从 EditText 中获取了 String 值。以及提交查询的按钮。 String sql=editQuery.getText().toString();// SELECT * FROM empl
我有一个或多或少有效的查询(关于结果),但处理大约需要 45 秒。这对于在 GUI 中呈现数据来说肯定太长了。 所以我的需求是找到一个更快/更高效的查询(几毫秒左右会很好)我的数据表大约有 3000
这是我第一次使用 Stack Overflow,所以我希望我以正确的方式提出这个问题。 我有 2 个 SQL 查询,我正在尝试比较和识别缺失值,尽管我无法将 NULL 字段添加到第二个查询中以识别缺失
什么是动态 SQL 查询?何时需要使用动态 SQL 查询?我使用的是 SQL Server 2005。 最佳答案 这里有几篇文章: Introduction to Dynamic SQL Dynami
include "mysql.php"; $query= "SELECT ID,name,displayname,established,summary,searchlink,im
我有一个查询要“转换”为 mysql。这是查询: select top 5 * from (select id, firstName, lastName, sum(fileSize) as To
通过我的研究,我发现至少从 EF 4.1 开始,EF 查询上的 .ToString() 方法将返回要运行的 SQL。事实上,这对我来说非常有用,使用 Entity Framework 5 和 6。 但
我在构造查询来执行以下操作时遇到问题: 按activity_type_id过滤联系人,仅显示最近事件具有所需activity_type_id或为NULL(无事件)的联系人 表格结构如下: 一个联系人可
如何让我输入数据库的信息在输入数据 5 分钟后自行更新? 假设我有一张 table : +--+--+-----+ |id|ip|count| +--+--+-----+ |
我正在尝试搜索正好是 4 位数字的 ID,我知道我需要使用 LENGTH() 字符串函数,但找不到如何使用它的示例。我正在尝试以下(和其他变体)但它们不起作用。 SELECT max(car_id)
我有一个在 mysql 上运行良好的 sql 查询(查询 + 连接): select sum(pa.price) from user u , purchase pu , pack pa where (
我是一名优秀的程序员,十分优秀!