search
HomeBackend DevelopmentPHP Tutorial 网站变慢 重启apache后通常

网站变慢 重启apache后正常
网站变慢 重启apache后正常,重启后一段时间又变慢了,服务器cpu和内存都正常,而且用的都很少的,ping反应也快,一般10多ms,不过就是出现打开网站慢的情况,最近出现的,请问大牛们应该这个排查,额,不要回答就说查apache日志哈,最好说哈应该咋个查,估计是那种情况出现的问题,如果出现了在日志里表现是怎么样的.....

------解决方案--------------------
其实我也遇到过,过了一阵自己就好了,至今原因未知。
------解决方案--------------------
关键就在于 用的都很少的
由于用的很少,所以 apache 所需的内存被挤到硬盘上去了,甚至所需的动态链接库都被从内存中卸载了
等到用的时候再从硬盘中加载,甚至还要加载动态链接库。那当然就慢啦
------解决方案--------------------
重启apache后正常
原因根本就是apache

重新安装后,试一试。


------解决方案--------------------
老大这个解释似乎不妥啊,如果是你说的这个原因,那只要用浏览器访问几次,应该就能恢复正常了,楼主恐怕也就不会提这个问题了。

探讨
关键就在于 用的都很少的
由于用的很少,所以 apache 所需的内存被挤到硬盘上去了,甚至所需的动态链接库都被从内存中卸载了
等到用的时候再从硬盘中加载,甚至还要加载动态链接库。那当然就慢啦

------解决方案--------------------
优化一下参数试试。。
------解决方案--------------------
可能服务器问题吧,
------解决方案--------------------
清清缓存试试
------解决方案--------------------
apache的连接数怎么样? 带宽够用吧
------解决方案--------------------
首先确定是apache问题,会不会是解析url变慢了,重启一下机器能不能好点呢
------解决方案--------------------
重启后一切都正常,表明apache什么的都没问题, 过段时间就变慢了,,这下问题就出现了,,,你在慢慢排查吧,,,
这问题表示很蛋疼...
------解决方案--------------------
win还是linux?
------解决方案--------------------
确实挺蛋疼的...
------解决方案--------------------
探讨
网站变慢 重启apache后正常,重启后一段时间又变慢了,服务器cpu和内存都正常,而且用的都很少的,ping反应也快,一般10多ms,不过就是出现打开网站慢的情况,最近出现的,请问大牛们应该这个排查,额,不要回答就说查apache日志哈,最好说哈应该咋个查,估计是那种情况出现的问题,如果出现了在日志里表现是怎么样的.....

------解决方案--------------------
是不是跟程序有关? 程序写得不好也会让apache很累的。。。即使访问量比较少
------解决方案--------------------
http://www.blogjava.net/itvincent/archive/2009/12/11/305522.html
------解决方案--------------------
电脑的原因吧……
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Performance Tuning for High Traffic WebsitesPHP Performance Tuning for High Traffic WebsitesMay 14, 2025 am 12:13 AM

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

Dependency Injection in PHP: Code Examples for BeginnersDependency Injection in PHP: Code Examples for BeginnersMay 14, 2025 am 12:08 AM

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

PHP Performance: is it possible to optimize the application?PHP Performance: is it possible to optimize the application?May 14, 2025 am 12:04 AM

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

PHP Performance Optimization: The Ultimate GuidePHP Performance Optimization: The Ultimate GuideMay 14, 2025 am 12:02 AM

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools