大网数据广告活动
服务器运维问答

Apache server is very slow taking minutes to respond

· 52CE 我爱测

I have Ubuntu 12.04 64-bit and Apache 2.2.22 installed on my machine used for development. Anyway, it seems from one day to the next that it would serve the pages in milliseconds to now 5 minutes 1 second every time. I believe th…

问题原文

原帖链接 · bubblebath · CC BY-SA 3.0

I have Ubuntu 12.04 64-bit and Apache 2.2.22 installed on my machine used for development. Anyway, it seems from one day to the next that it would serve the pages in milliseconds to now 5 minutes 1 second every time. I believe that this is because the timeout value is 300 in the apache.conf. What I don't understand is why it is timing out.

I have xdebug installed but I am not triggering it and it is not on autostart so I really think this would have made no difference and they were working together fine before.

I am a complete noob at Apache and not sure how to start debugging the issue. I have checked the logs but they don't seem to give me anything interesting. The Apache error.log is not changing and only producing a notice log when it boots.

The actual app log is a bit more interesting as in it does update the app-access.log and the app-error.log, however the access log just says the GET requests and the error log is all info. The make no sense to me so here is an example of one from a request.

[Mon Jan 20 12:01:39 2014] [info] [client 127.0.0.1] (32)Broken pipe: core_output_filter: writing data to the network
[Mon Jan 20 12:01:43 2014] [info] [client ::1] Connection to child 6 established (server app:443)
[Mon Jan 20 12:01:43 2014] [info] Seeding PRNG with 656 bytes of entropy
[Mon Jan 20 12:01:43 2014] [info] [client ::1] SSL library error 1 in handshake (server app:443)
[Mon Jan 20 12:01:43 2014] [info] SSL Library Error: 336027900 error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol speaking not SSL to HTTPS port!?
[Mon Jan 20 12:01:43 2014] [info] [client ::1] Connection closed to child 6 with abortive shutdown (server app:443)

The thing is that it only produces a log when the page is served which is minutes later (after the apparent 5 min timeout). It seems that it takes ages for the request to actually hit the app. I am not sure what is the best way to go about finding why this is the case. I have made no changes recently to my configuration so I really don't see why it has suddenly gone awry.

已采纳解答

原帖链接 · Chris · CC BY-SA 4.0

Well if the config didn't change, you have no choice but to limit the timeout to 2 seconds, then you have 3 second load time.. ;) Okey, let's try something helpful..

You say you use it for local development testing?

Can you remember what the very last change was to any of the following:

  • Your web application, any changes between when it was working and when it wasn't?
    • Is there a for .. loop that runs infinitely?
    • Or is your application making a request to a another server that is not responding?
  • Any other logs to check? PHP's error log or any other scripting language's that you may be using.
  • Database settings, table structures? Constraints? Procedures?
    • Are you using a database that has some locks that your application is waiting for?
  • Scripting language settings (PHP, Perl, Python, Ruby which are you running?)
  • Apache settings
    • Modules
    • Virtual Hosts
    • .htaccess files?
  • Any updates to any other services on the server?
  • Any firewall changes?
  • Any updates of database, scripting language or Apache?

Other things to check:

  • If that does not help, you should increase the verbosity of Apache's logging up to debug in steps and see what is going on during the 5 minutes..
  • You may also see which process is using the cpu while the request is running (if any at all), e.g. PHP taking up an entire CPU core? Or maybe mysqld (or any other database daemon)..

[EDIT] See this too: https://web.archive.org/web/20170225085205/http://servertune.com/kbase/?View=entry&EntryID=109

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-01-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。