View previous topic :: View next topic |
Author |
Message |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Thu Aug 13, 2009 7:59 am Post subject: How do I look for the reasons for a very slow webserver |
|
|
I have a VM with Apache server placed outside of the network. Sometimes, it just grinds to a halt, and loading a webpage takes anywhere in the range 5-60 seconds.
I don't know where to start looking.
It could be apache, ssl, the network, a firewall, hardware, and most likely a long line of other things.
After googling, I found the suggestion to put httpd.conf on a modules diet, which I did, but the problem remains. This was done in a dumb brute force fashion y by removing most modules, and then starting to add modules back until the server worked as expected. At the time, this felt like the solution, as the loadtime felt significantly shorter, but this morning, the problem is back.
Any suggestions on where I start?
Here is a list of the un-commented modules.
Code: | LoadModule python_module modules/mod_python.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule mime_module modules/mod_mime.so
<IfDefine CACHE>
LoadModule cache_module modules/mod_cache.so
</IfDefine>
<IfDefine DAV>
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule dav_svn_module modules/mod_dav_svn.so
</IfDefine>
<IfDefine CACHE>
LoadModule disk_cache_module modules/mod_disk_cache.so
</IfDefine>
<IfDefine CACHE>
LoadModule file_cache_module modules/mod_file_cache.so
</IfDefine>
<IfDefine INFO>
LoadModule info_module modules/mod_info.so
</IfDefine>
<IfDefine CACHE>
LoadModule mem_cache_module modules/mod_mem_cache.so
</IfDefine>
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
<IfDefine STATUS>
LoadModule status_module modules/mod_status.so
</IfDefine>
<IfDefine USERDIR>
LoadModule userdir_module modules/mod_userdir.so
</IfDefine> |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
vincent- Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/20284099874ffebed385b01.png)
Joined: 13 Jan 2007 Posts: 415 Location: Valencia (Spain)
|
Posted: Thu Aug 13, 2009 8:17 am Post subject: |
|
|
Any possibility to try into the same local network as the server? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Thu Aug 13, 2009 9:58 am Post subject: |
|
|
You mean transfer the VM?
Or do you mean just trying to install apache locally and see what happens?
If the former, then I guess I could try, but I'm not sure about the details of running the VM. I think it's using vSphere, which would require a computer to install that first, and that might take a lot of time. But could also be very fast, I don't know |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
vincent- Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/20284099874ffebed385b01.png)
Joined: 13 Jan 2007 Posts: 415 Location: Valencia (Spain)
|
Posted: Thu Aug 13, 2009 10:20 am Post subject: |
|
|
I mean connect to the server using a PC on the same local network (connected to the same router), to discard that Internet conection is slow between the clients and your server. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Thu Aug 13, 2009 10:34 am Post subject: |
|
|
peratu wrote: | I mean connect to the server using a PC on the same local network (connected to the same router), to discard that Internet conection is slow between the clients and your server. |
I realised that just recently too, that there's a much easier way of getting to the local network. Why bring the mountain to me when I can go there?
I will head over to the local net and see what happens. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
clouds222 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 13 Jul 2009 Posts: 187 Location: Shanghai
|
Posted: Fri Aug 14, 2009 2:20 am Post subject: |
|
|
Letharion
Have you enabled MPM? this enable your server to creat multi-threads to process the http requests.
you can add mpm support to your apache server by:
Code: |
USE="threads apache2_mpms_worker" emerge --newuses apache php
|
also you can use " apache2_mpms_prefork" or "apache2_mpms_event"
and then, configure your mpm configuration files located at: /etc/apache2/modules.d/00_mpm.conf
Code: |
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 10000
</IfModule>
|
though this will do better to your server.
other ways to make your server faster is to enable compress output. You can look at the other posts of the forum. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cach0rr0 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/14936637654ee19d6630f96.gif)
Joined: 13 Nov 2008 Posts: 4123 Location: Houston, Republic of Texas
|
Posted: Fri Aug 14, 2009 2:52 am Post subject: |
|
|
two cents - I recommend prefork
I'm posting from the crapper, so not convenient to go into detail as to why _________________ Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
clouds222 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 13 Jul 2009 Posts: 187 Location: Shanghai
|
Posted: Fri Aug 14, 2009 7:35 am Post subject: |
|
|
Well, you can choose which module to use by actual application. And you may need to read the difference between each other from the documents:
http://www.apache2.es/2.2.2.en/mpm.html
Quote: | The server can be better customized for the needs of the particular site. For example, sites that need a great deal of scalability can choose to use a threaded MPM like worker or event, while sites requiring stability or compatibility with older software can use a prefork.
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Fri Aug 14, 2009 8:20 am Post subject: |
|
|
Thanks, I've read on the different mpms, and it looks like I can basically choose from worker or prefork.
I'm currently using prefork, so maybe I'll try the worker. I talked to the admin of the network on the other end, and he said he'd seem the problem before, so maybe it's there. Will investigare further ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lesourbe l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/76587934349f17e9f8519e.jpg)
Joined: 24 Nov 2005 Posts: 710 Location: Champagne !
|
Posted: Fri Aug 14, 2009 8:36 am Post subject: |
|
|
I'll try to investigate with these tools first :
fireplug
wireshark
and try to trigger the issue. _________________ Is that a banhammer ?
LeSourbe, Member of EPowerforce. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Wed Aug 26, 2009 12:49 pm Post subject: |
|
|
I'm currently on the local network, logged in with putty, and browsing a trac-site. It's a bit faster, but still really, really slow.
fire"plug"?
If you mean firebug, that sounds like a good idea. Never heard of a plug, nor does google reveal anything intersting.
Wireshark also sounds interesting, but I fear that I might get more information than I'm able to interpret. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lesourbe l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/76587934349f17e9f8519e.jpg)
Joined: 24 Nov 2005 Posts: 710 Location: Champagne !
|
Posted: Wed Aug 26, 2009 3:07 pm Post subject: |
|
|
Letharion wrote: | I'm currently on the local network, logged in with putty, and browsing a trac-site. It's a bit faster, but still really, really slow.
fire"plug"?
If you mean firebug, that sounds like a good idea. Never heard of a plug, nor does google reveal anything intersting.
Wireshark also sounds interesting, but I fear that I might get more information than I'm able to interpret. |
indeed I mistyped firebug.
Wireshark allow live capture and filtering, it helps analysis. _________________ Is that a banhammer ?
LeSourbe, Member of EPowerforce. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Thu Aug 27, 2009 8:13 am Post subject: |
|
|
Host thinks there's an issue with the VM-server, it will be reinstalled. Will await results of this. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Letharion Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Wed Nov 18, 2009 12:51 pm Post subject: |
|
|
Ok, long long overdue.
A faulty switch had been replaced on the host side, however, my problem remained.
After playing around a bit with the kernel looking for configuration mistakes, Trac got an "Internal Error". I don't know what I did to cause this, but quickly found a fix on google that I applied to httpd.conf.
After that Trac isn't that slow anymore. Otherwise, the server doesn't feel much faster, but Trac loads in less than a tenth of what it used to. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|