douhan0562 2015-04-22 22:22
浏览 24

MySQL有结果但不会将结果返回给Web服务器

I found a strange situation that would like to have your help, here is my scenario.

  1. Webserver runs Apache + PHP + MySQL(5.6.12) Master mode

  2. OLAP runs MySQL(5.6.19) Slave mode

So, when users make a request to get a report from the webserver, it sends SQL stmt to OLAP to get result. Here is the problem, if the smtm has a small date range like 1 month, the data will return normally, but if the report takes a long time to process because it has a date range like one year, it will return nothing.

Let me explain "it will return nothing" meaning.

  1. The webserver sends a long-processed SQL stmt to the OLAP server.
  2. The OLAP server process the stmt for a while ( "Query" status in MySQL processlist) then turns to "Sleep" status.
  3. After going to Sleep status, it waits until 180 second (wait_timeout) which was set in MySQL, and then gets killed.
  4. In term of networking status, it shows ESTABLISHED, then FIN_WAIT1 and close connection with the webserver like normal TCP connection states.
  5. I tried to use Navicate for query the same stmt, Navicate gives me a result.
  6. I tried to use strace in both the web and OLAP, what I can get is Apache open "read" system call, and waiting data back from the OLAP server. At the same time, OLAP shows "poll" system call, but never return result back to the web server.

Please help me if you have been through the same situation.

Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog